This repository was archived by the owner on Oct 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Join Builders
Miku edited this page Mar 17, 2023
·
3 revisions
All general information about what the joins do can be found on the official site
from mariadb_sqlbuilder.builder.join_builder import CrossJoinBuilder
conn.table("myTable").select("*").join(CrossJoinBuilder("otherTable")).join_select("otherTable", "*").fetchall()Currently is only AND possible for multiplie conditions.
In the condition you first specify a column from the main table, then a column from the join table
.condition("val1", "otherVal1")
from mariadb_sqlbuilder.builder.join_builder import InnerJoinBuilder
conn.table("myTable").select("*").join(InnerJoinBuilder("otherTable").condition("my", "other")).join_select(
"otherTable", "*").fetchall()from mariadb_sqlbuilder.builder.join_builder import LeftJoinBuilder
conn.table("myTable").select("*").join(LeftJoinBuilder("otherTable").condition("my", "other")).join_select("otherTable",
"*").fetchall()from mariadb_sqlbuilder.builder.join_builder import RightJoinBuilder
conn.table("myTable").select("*").join(RightJoinBuilder("otherTable").condition("my", "other")).join_select(
"otherTable", "*").fetchall()