join

Appends a JOIN statement to a query

// … FROM book JOIN author ON author.id = author_id …
Query q = table("book").qb.join(
    table("author"),
    "id",
    "author_id"
);
// or:
Query q = table("book").qb.join(
    column(table("author"), "id"),
    "author_id"
);

enum book = table("book");
enum author = table("author");
Query q = book.qb.join(
    column(author, "id"),
    column(book, "author_id")
);
// --> … FROM book JOIN author ON author.id = book.author_id …
  1. Query join(Query q, Column joinTarget, Column sourceColumn)
  2. Query join(Query q, Column joinTarget, string sourceColumn)
  3. Query join(Query q, Table joinTarget, string joinOnTargetColumn, string onSourceColumn)
    @safe pure
    join
    (,,
    const string joinOnTargetColumn
    ,
    const string onSourceColumn
    )

Parameters

joinTarget Table

determines which table to join with (and which column to use in the join constraint (“ON”))

Meta