class Marten::DB::Management::Statement

Overview

Represents an SQL statement holding the detail of the tables and associated columns.

This abstraction is mainly used in the context of the schema editor, where deferred statements need to be temporarily stored in order to be executed later on. In those situations, statements need to provide the ability to be mutated to apply possible schema changes to them.

Defined in:

marten/db/management/statement.cr
marten/db/management/statement/columns.cr
marten/db/management/statement/foreign_key_name.cr
marten/db/management/statement/index_name.cr
marten/db/management/statement/reference.cr
marten/db/management/statement/table.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(template : String, **kwargs) #

[View source]

Instance Method Detail


[View source]
def references_column?(table : String, column : String) : Bool #

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

[View source]
def rename_column(table : String, old_name : String, new_name : String) #

[View source]
def rename_table(old_name : String, new_name : String) #

[View source]
def template : String #

[View source]
def to_s #
Description copied from class Object

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.


[View source]