Skip to content
v2.7

Database and Storage with the CLI

Tables, columns, indexes, and buckets described in owbase.json: pull to bring them from the project and push to apply them.

The owbase.json file describes the structure of the project: databases, tables with columns and indexes, buckets, teams, and topics. Versioned in Git, it carries the same structure from one project to another (development, staging, production).

Terminal window
owbase pull table # databases and tables, with columns and indexes
owbase pull bucket # buckets
owbase pull all # everything: tables, buckets, teams, topics, functions, and sites

Pull writes to owbase.json (databases in tablesDB, tables in tables, buckets in buckets). The data (rows and files) does not come along: only the structure.

{
"projectId": "<PROJECT_ID>",
"tablesDB": [{ "$id": "store", "name": "Store", "enabled": true }],
"tables": [
{
"$id": "orders",
"databaseId": "store",
"name": "Orders",
"rowSecurity": false,
"columns": [{ "key": "total", "type": "integer", "required": true }],
"indexes": [{ "key": "by_total", "type": "key", "columns": ["total"], "orders": ["asc"] }]
}
],
"buckets": [{ "$id": "invoices", "name": "Invoices", "maximumFileSize": 10485760, "encryption": true }]
}
Terminal window
owbase push table
owbase push bucket

Push compares the file with the project, shows what will change (create, alter, delete), and asks for confirmation.

New columns start out processing and become available within seconds; the push waits for them (--attempts changes how many times it checks).

owbase tables-db --help and owbase storage --help list the commands of each service (create rows, upload files, list), with the same operations as the API reference.

Was this page helpful?