View Source EctoTemp.Macros (ecto_temp v0.1.3)
Link to this section Summary
Functions
Add a column to a table definition.
Runs through previously defined @ecto_temporary_tables
to insert temporary tables.
This should be called in a setup block, which needs to be defined after all
deftemptable
definitions.
Creates a temporary table that will be rolled back at the end of the
current test transaction. If the table name is given as :thing
, then
the actual temporary table will be created as thing_temp
.
Adds inserted_at
and updated_at
to a table definition.
Link to this section Functions
Add a column to a table definition.
This must be called within a deftemptable
block, or a CompileError will be raised.
Runs through previously defined @ecto_temporary_tables
to insert temporary tables.
This should be called in a setup block, which needs to be defined after all
deftemptable
definitions.
Creates a temporary table that will be rolled back at the end of the
current test transaction. If the table name is given as :thing
, then
the actual temporary table will be created as thing_temp
.
examples
Examples
deftemptable :cycles do
column :athlete_plan_id, :integer, null: false
deftimestamps()
end
deftemptable :scan, primary_key: false do
column :scan_sha, :string, null: false
column :comment, :string
end
opts
Opts
name | type | default | description |
primary_key | boolean | true | When true, adds an :id field of type :bigserial |
Adds inserted_at
and updated_at
to a table definition.
This must be called within a deftemptable
block, or a CompileError will be raised.