module Marten::DB::Management::SchemaEditor

Defined in:

marten/db/management/schema_editor.cr
marten/db/management/schema_editor/base.cr
marten/db/management/schema_editor/concerns/core.cr
marten/db/management/schema_editor/mysql.cr
marten/db/management/schema_editor/postgresql.cr
marten/db/management/schema_editor/sqlite.cr

Constant Summary

IMPLEMENTATIONS = {Connection::MYSQL_ID => SchemaEditor::MySQL, Connection::POSTGRESQL_ID => SchemaEditor::PostgreSQL, Connection::SQLITE_ID => SchemaEditor::SQLite}

Class Method Summary

Class Method Detail

def self.for(connection : Connection::Base) : SchemaEditor::Base #

Returns a schema editor for the passed connection.


[View source]
def self.run_for(connection : Connection::Base, atomic = true, &) #

Returns a schema editor instance whose SQL operations can be enclosed in a single transaction.

By default all operations performed with the yielded schema editor object will be done inside a single transaction, unless atomic is set to false. Note that some database backends (such as MySQL) may not support transactions for DDL statements ; in those case the use of atomic will be ignored.


[View source]