Holds the table definitions made with ActiveRecord.define_model before ActiveRecord is ready. The column type calls of each definition are recorded instead of run, and run creates the tables once the stored schema has been restored from the database.

Summary

Methods

Records a table definition, so that the table can be created later by #run.
Registers a column type, so that it can be used in queued table definitions.
run()shared
Creates every table that was recorded with #add and clears the queue.

Methods

ActiveRecord.Queue:add(table_name, callback)

shared packages/active_record/lib/database/queue.lua:14

Records a table definition, so that the table can be created later by #run.

Parameters

  • table_name String
  • callback Function receives an object with a method for every column type (t:string, t:integer, ...) that records the call instead of running it

ActiveRecord.Queue:add_type(type)

shared packages/active_record/lib/database/queue.lua:34

Registers a column type, so that it can be used in queued table definitions.

Parameters

  • type String abstract column type, e.g. 'string'

ActiveRecord.Queue:run()

shared packages/active_record/lib/database/queue.lua:20

Creates every table that was recorded with #add and clears the queue.

Defined in