March Docs

Forge.GenSchema

Forge.GenSchema — forge bastion gen schema/json/context

Generates Depot schema modules, migration files, context modules, and JSON API handlers from CLI arguments.

Subcommands: forge bastion gen schema <Module> <table> field:type ... forge bastion gen json <Context> <Module> field:type ... forge bastion gen context <Context> <Module>

Ported from cmd_bastion_gen.ml.

Functions

fncreatecreate(conn)#
fncreate_"""create_""" ++ lmod ++ """(params)#
fndeletedelete(conn, id)#
fndelete_"""delete_""" ++ lmod ++ "(" ++ lmod ++ """)#
fndowndown()#
fngategate(params)#
fnget_"""get_""" ++ lmod ++ """!(id)#
fnget_"""get_""" ++ lmod ++ """(id)#
fnindexindex(conn)#
fnlist_"""list_""" ++ lmod ++ """s()#
fnmainmain()#
fnnot_foundnot_found(conn)#
fnrun_contextrun_context(context_name, module_name)#

Generate a context module only.

forge bastion gen context <Context> <Module>
fnrun_jsonrun_json(context_name, module_name, field_specs)#

Generate a JSON API scaffold: schema, migration, context, handler, and test.

forge bastion gen json <Context> <Module> field:type ...
fnrun_schemarun_schema(module_name, table_name, field_specs)#

Generate a Depot schema module and migration from a list of field:type specs.

forge bastion gen schema <Module> <table> field:type ...
fnschemaschema()#
fnshowshow(conn, id)#
fnupup()#
fnupdateupdate(conn, id)#
fnupdate_"""update_""" ++ lmod ++ "(" ++ lmod ++ """, params)#
fnupdate_gateupdate_gate(base, params)#
fnversionversion()#