March Docs

Forge.GenContext

Forge.GenContext — forge bastion.gen.context <Context> <Schema> <table> [field:type ...]

Generates a context module, schema module, and migration from a field spec.

Usage: forge bastion.gen.context Accounts User users name:string email:string forge bastion.gen.context Blog Post posts title:string body:text published_at:datetime

Supported field types (map to Depot column types): string → String (varchar 255) text → Text integer → Int float → Float boolean → Bool datetime → UtcDatetime date → Date uuid → UUID

Files created: lib/<app>/<context_snake>/<schema_snake>.march — schema + gate lib/<app>/<context_snake>.march — context CRUD API priv/depot/migrations/<ts>_create_<table>.march — migration

Functions

fnchange_"""change_""" ++ String.to_lowercase(schema) ++ """(attrs)#

Build an empty gate for displaying a new

fncreate_"""create_""" ++ String.to_lowercase(schema) ++ """(params)#

Create a new

fncreate_gatecreate_gate(params)#
fndelete_"""delete_""" ++ String.to_lowercase(schema) ++ """(id)#

Delete a

fndowndown()#
fnget_"""get_""" ++ String.to_lowercase(schema) ++ """(id)#

Fetch a single

fnlist_"""list_""" ++ String.to_lowercase(schema) ++ """s()#

Fetch all

fnmainmain()#
fnrunrun(args)#
fnschemaschema()#
fnupup()#
fnupdate_"""update_""" ++ String.to_lowercase(schema) ++ """(record, params)#

Update an existing

fnupdate_gateupdate_gate(record, params)#
fnversionversion()#