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).
Pull from the project
Section titled “Pull from the project”owbase pull table # databases and tables, with columns and indexesowbase pull bucket # bucketsowbase pull all # everything: tables, buckets, teams, topics, functions, and sitesPull 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 }]}Apply to the project
Section titled “Apply to the project”owbase push tableowbase push bucketPush 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.