class Miner::Table

Defined in:

miner/table.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, analias : String | Nil = nil, database : Miner::Database = Miner.default_database) #

Create the table object

At it's simplest, a table can be initialized with just a table name

table = Miner::Table.new "countries"

You can specify an alias to refer to the table when it is used within a query

table = Miner::table.new "countries", "the_countries_table"

You can specify a database other than the default by passing it as the third argument

table = Miner::Table.new "countries", nil, Miner::Database.new(config)

[View source]

Instance Method Detail

def alias : String #

[View source]
def alias=(alias __arg0 : String) #

[View source]
def field(name : String) : Field | Nil #

[View source]
def fields : Hash(String, Miner::Field)? #

[View source]
def has_field?(name : String) : Bool #

[View source]
def has_relationship?(name : String) : Bool #

[View source]
def name : String #

[View source]
def primary_key : String? #

[View source]
def relationship(name : String) : Relationship | Nil #

[View source]
def relationships : Hash(String, Miner::Relationship)? #

[View source]