Skip to content
This repository was archived by the owner on Oct 29, 2025. It is now read-only.

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

Conditionless Join Builder

CrossJoinBuilder

Example

from mariadb_sqlbuilder.builder.join_builder import CrossJoinBuilder

conn.table("myTable").select("*").join(CrossJoinBuilder("otherTable")).join_select("otherTable", "*").fetchall()

Condition Join Builder

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

Example

.condition("val1", "otherVal1")

InnerJoinBuilder

Example

from mariadb_sqlbuilder.builder.join_builder import InnerJoinBuilder

conn.table("myTable").select("*").join(InnerJoinBuilder("otherTable").condition("my", "other")).join_select(
    "otherTable", "*").fetchall()

LeftJoinBuilder

Example

from mariadb_sqlbuilder.builder.join_builder import LeftJoinBuilder

conn.table("myTable").select("*").join(LeftJoinBuilder("otherTable").condition("my", "other")).join_select("otherTable",
                                                                                                           "*").fetchall()

RightJoinBuilder

Example

from mariadb_sqlbuilder.builder.join_builder import RightJoinBuilder

conn.table("myTable").select("*").join(RightJoinBuilder("otherTable").condition("my", "other")).join_select(
    "otherTable", "*").fetchall()

Clone this wiki locally