generate

Generates a TypeScript snippet for a data object or procedure using the Data API.

Usage:

af resources generate <resource> [options]

Common options:

  • -i, --id <id>: ID/name to use for the generated object (default dsDataObject).

  • -g, --global: Use af.data globals.

  • -t, --types: Include TypeScript types.

  • -f, --fields [a,b]: Comma-separated list of fields to include. If used without value, prompts interactively.

  • -p, --permissions <IUD>: Permissions on the data object (Insert/Update/Delete; any combination, e.g. IUD).

  • -m, --max-records <n>: Max records (default 50 for data objects).

  • -s, --sort-order <field:Asc|Desc|AscNullsLast|DescNullsFirst,...>: Sort order(s).

  • -b, --master <Name[:path]>: Master data object name (and optional import path).

  • -l, --link-fields <this:master,...>: Field links to the master.

  • -e, --expose [id]: Expose on af.article.dataObjects. Optional custom id.

  • -d, --dynamic: Enable dynamic loading.

  • -u, --unique <table>: Unique table name for updates/deletes.

  • -o, --overrides "Field:Type,Param:Type": Field/param type overrides.

  • --group-by <a,b>: Grouping fields.

  • --aggregates <Field:SUM,...>: Aggregates for non-grouped fields.

  • --distinct: Distinct rows.

  • --where <clause>: Initial where clause.

Last updated

Was this helpful?