class Marten::DB::Query::SQL::Join

Overview

Represents an SQL join used in the context of a specific query.

SQL joins are managed as a tree, which means that each join can be associated with a list of underlying children joins (for the joins following the considered relationship). SQL joins are "flattened" when the raw SQL queries are generated.

Defined in:

marten/db/query/sql/join.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(id : Int32, type : JoinType, from_model : Model.class, from_common_field : Field::Base, reverse_relation : ReverseRelation | Nil, to_model : Model.class, to_common_field : Field::Base, selected : Bool, table_alias_prefix : String = "t", children : Array(Marten::DB::Query::SQL::Join) = [] of self) #

[View source]

Instance Method Detail

def add_child(child : self) : Nil #

[View source]
def children : Array(Marten::DB::Query::SQL::Join) #

[View source]
def clone : self #

[View source]
def column_name(name) : String #

[View source]
def columns : Array(String) #

[View source]
def from_common_field : Marten::DB::Field::Base #

[View source]
def from_model : Marten::DB::Model.class #

[View source]
def id : Int32 #

[View source]

[View source]
def replace_table_alias_prefix(new_table_alias_prefix : String) : Hash(String, String) #

[View source]
def reverse_relation : Marten::DB::ReverseRelation? #

[View source]
def selected? : Bool #

[View source]
def table_alias : String #

[View source]
def table_alias_prefix : String #

[View source]
def to_a : Array(self) #

[View source]
def to_common_field : Marten::DB::Field::Base #

[View source]
def to_model : Marten::DB::Model.class #

[View source]
def to_sql : String #

[View source]

[View source]