orm
Object-relational mapper, migrations, query builder.
Load with: use orm
Quick example
use orm
result = ormne(\(x) x)
prn(result)
Functions
ORM configuration
ormne(cfg)
Creates a new instance. Takes cfg.
ormco(o)
Connects. Takes o.
Model definition
ormmo(nm, sch)
Performs the operation. Takes nm, sch.
ormfl(ty, opts)
Performs the operation. Takes ty, opts.
ormst(mx)
Sets a value or starts a process. Takes mx.
ormte()
Performs the operation.
ormin()
Initialises.
ormfl()
Performs the operation.
ormbl()
Performs the operation.
ormdt()
Performs the operation.
ormda()
Performs the operation.
ormjs()
Performs the operation.
ormui()
Performs the operation.
ormbe(nm, opts)
Performs the operation. Takes nm, opts.
ormhm(nm, opts)
Performs the operation. Takes nm, opts.
ormho(nm, opts)
Performs the operation. Takes nm, opts.
Register model
ormre(o, m)
Performs the operation. Takes o, m.
Query builder
ormq(m)
Performs the operation. Takes m.
ormqs(query, fields)
Performs the operation. Takes query, fields.
ormqw(q, cond)
Performs the operation. Takes q, cond.
ormqw(query, field, values)
Performs the operation. Takes query, field, values.
ormqw(query, field, pattern)
Performs the operation. Takes query, field, pattern.
ormqo(q, f, d)
Performs the operation. Takes q, f, d.
ormql(q, n)
Performs the operation. Takes q, n.
ormqo(q, n)
Performs the operation. Takes q, n.
ormqj(query, model_name, on_condition, join_type)
Performs the operation. Takes query, model_name, on_condition, join_type.
ormqi(query, associations)
Performs the operation. Takes query, associations.
Execute query
ormqg(q, o)
Performs the operation. Takes q, o.
ormqf(q, o)
Performs the operation. Takes q, o.
ormqc(q, o)
Performs the operation. Takes q, o.
ormqe(q, o)
Performs the operation. Takes q, o.
SQL generation
ormqu(query)
Performs the operation. Takes query.
ormwh(where)
Performs the operation. Takes where.
CRUD operations
ormcr(o, mn, d)
Creates a new instance. Takes o, mn, d.
ormup(o, mn, id, d)
Updates. Takes o, mn, id, d.
ormde(o, mn, id)
Decodes. Takes o, mn, id.
ormfn(o, mn, id)
Finalises. Takes o, mn, id.
ormal(o, mn)
Performs the operation. Takes o, mn.
Helpers
ormqu(val)
Performs the operation. Takes val.
ormro(model, row, includes, orm)
Performs the operation. Takes model, row, includes, orm.
Migrations
ormmi(name, up_fn, down_fn)
Performs the operation. Takes name, up_fn, down_fn.
ormmi(orm)
Performs the operation. Takes orm.
ormro(orm, steps)
Performs the operation. Takes orm, steps.
Schema operations
ormcr(orm, table_name, columns)
Creates a new instance. Takes orm, table_name, columns.
ormdr(orm, table_name)
Performs the operation. Takes orm, table_name.
ormad(orm, table_name, col_name, col_def)
Adds an item. Takes orm, table_name, col_name, col_def.
ormdr(orm, table_name, col_name)
Performs the operation. Takes orm, table_name, col_name.
ormcr(orm, table_name, col_name, unique)
Creates a new instance. Takes orm, table_name, col_name, unique.
ormty(type)
Performs the operation. Takes type.
Transactions
ormtx(orm)
Performs the operation. Takes orm.
ormtx(orm)
Performs the operation. Takes orm.
ormtx(orm)
Performs the operation. Takes orm.
ormtx(orm, fn)
Performs the operation. Takes orm, fn.
Raw SQL
ormra(orm, sql_str, params)
Performs the operation. Takes orm, sql_str, params.
Notes
- Object-relational mapper - define models, query, migrate.