Collection commands: export, query
The Collection Verbs export, query as CLI commands, with inputs, result, refusals and an example.
Reference for Collection, one group of Collection commands.
Collection.export
Export writes a Collection’s records to a file or the Startup’s warehouse, once or on a schedule. Verb page.
npx startup-builder do Collection.export --json '<input>' [--try | --send | --do]Emits Collection.exported.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
collection | Collection | required | The Collection to export. |
to | string | required | A file format, or the warehouse Integration that receives it. |
cadence | string | How often it repeats; omitted, it runs once. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
file | File | The exported File, for a one-time export. | |
collection | Collection | required | The Collection exported. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
npx startup-builder do Collection.export --json '{"collection": "collection_txTK8QorKn", "to": "Example to"}'Collection.query
Query reads any Nouns the caller’s Permissions allow, by SQL or a Relationship path, across every System in one call. Verb page.
npx startup-builder do Collection.query --json '<input>' [--try | --send | --do]Emits Collection.queried.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
query | text | required | SQL, or a Relationship path such as customer.subscriptions.invoices. |
save | boolean | True saves it as a Collection defined by the query. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
rows | json | required | The matching records. |
collection | Collection | required | The Collection the query read. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
npx startup-builder do Collection.query --json '{"query": "Example query"}'