Skip to content

Commit db7f3e4

Browse files
claude[bot]claude
andauthored
docs(deployment): give postgres/mysql the same optional-driver note Turso has (#14579)
`content/docs/deployment/self-hosting.mdx`'s `OS_DATABASE_URL` row warned that Turso's driver is an optional package that must be installed by hand or the boot fails loudly, but said nothing about `pg` / `mysql2` even though they are optional peer dependencies of `@objectstack/driver-sql` the same way (`packages/drivers/driver-sql/package.json`). Give postgres:// and mysql:// the same note, and add the install step to the bare-Node systemd recipe on the same page. `content/docs/data-modeling/drivers.mdx`'s URL -> Driver Inference Table named the peer package for Postgres/MySQL without saying it's not installed by default — the same gap in a milder form. Extend those two rows to match the Turso row's wording. No packaging change: no dependency moves, no Dockerfile/scaffolder edits — those stay on #14510, which this card was split from and does not close here. Part of #14551 Co-authored-by: Claude <noreply@anthropic.com>
1 parent d754829 commit db7f3e4

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

content/docs/data-modeling/drivers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Drivers can be selected in two ways:
4343
| URL pattern | Inferred driver | npm package |
4444
| :--- | :--- | :--- |
4545
| `mongodb://…`, `mongodb+srv://…` | MongoDB | `@objectstack/driver-mongodb` |
46-
| `postgres://…`, `postgresql://…` | PostgreSQL (Knex `pg`) | `@objectstack/driver-sql` + `pg` |
47-
| `mysql://…`, `mysql2://…` | MySQL (Knex `mysql2`) | `@objectstack/driver-sql` + `mysql2` |
46+
| `postgres://…`, `postgresql://…` | PostgreSQL (Knex `pg`) | `@objectstack/driver-sql` + `pg` (**optional** peer — install it yourself, or boot fails loudly) |
47+
| `mysql://…`, `mysql2://…` | MySQL (Knex `mysql2`) | `@objectstack/driver-sql` + `mysql2` (**optional** peer — install it yourself, or boot fails loudly) |
4848
| `libsql://…`, `http(s)://*.turso.…` | Turso / libSQL | `@objectstack/driver-turso` (**optional** — install it yourself) |
4949
| `wasm-sqlite://…`, `*.wasm.db` | SQLite (pure-JS WASM) | `@objectstack/driver-sqlite-wasm` |
5050
| `file:…`, `sqlite:…`, `:memory:`, `*.db` / `*.sqlite` | SQLite (Knex `better-sqlite3`) | `@objectstack/driver-sql` + `better-sqlite3` |

content/docs/deployment/self-hosting.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ workable default:
3232

3333
| Variable | Why it must be set |
3434
|:---|:---|
35-
| `OS_DATABASE_URL` | Without it, data lands in a SQLite file under the ObjectStack home directory (`~/.objectstack`, or `<cwd>/.objectstack` next to a project config) — fine for one box, wrong for containers. Use `postgres://…`, `mysql://…`, `mongodb://…`, `libsql://…`, or a mounted `file:…` path (`libsql://` / Turso is inferred, but its driver is an **optional** package — `npm install @objectstack/driver-turso`, or the boot fails loudly rather than degrading to SQLite; see [Drivers](/docs/data-modeling/drivers)). `mysql://…` is a supported deployment target that carries three dialect caveats — two of them integrity guarantees MySQL cannot enforce at the database — see [Drivers → MySQL dialect caveats](/docs/data-modeling/drivers#mysql-dialect-caveats) before choosing it. `mongodb://…` is **single-tenant only**: the MongoDB driver has no row-level tenant isolation and refuses to boot unless the tenancy posture is `single` — see [Drivers → Multi-tenancy](/docs/data-modeling/drivers#multi-tenancy-not-supported). |
35+
| `OS_DATABASE_URL` | Without it, data lands in a SQLite file under the ObjectStack home directory (`~/.objectstack`, or `<cwd>/.objectstack` next to a project config) — fine for one box, wrong for containers. Use `postgres://…`, `mysql://…`, `mongodb://…`, `libsql://…`, or a mounted `file:…` path (`postgres://…`'s driver is an **optional** package too — `npm install pg`, or the boot fails loudly rather than degrading to SQLite; `libsql://` / Turso is inferred, but its driver is an **optional** package — `npm install @objectstack/driver-turso`, or the boot fails loudly rather than degrading to SQLite; see [Drivers](/docs/data-modeling/drivers)). `mysql://…` is a supported deployment target that carries three dialect caveats — two of them integrity guarantees MySQL cannot enforce at the database — see [Drivers → MySQL dialect caveats](/docs/data-modeling/drivers#mysql-dialect-caveats) before choosing it; its driver is likewise an **optional** package — `npm install mysql2`, or the boot fails loudly rather than degrading to SQLite. `mongodb://…` is **single-tenant only**: the MongoDB driver has no row-level tenant isolation and refuses to boot unless the tenancy posture is `single` — see [Drivers → Multi-tenancy](/docs/data-modeling/drivers#multi-tenancy-not-supported). |
3636
| `OS_AUTH_SECRET` | Session secret for the auth plugin (`AUTH_SECRET` is the legacy alias). Without it, `/api/v1/auth/*` is **silently skipped** — the server runs unauthenticated. |
3737
| `OS_SECRET_KEY` | 32-byte master key encrypting every stored secret (`openssl rand -hex 32`). On a container's ephemeral filesystem the auto-minted key is **lost on restart**, making previously-encrypted secrets undecryptable. |
3838
| `OS_PORT` | `os start` **fails loudly** if the port is busy (it never auto-shifts like `os dev`). Pin it and keep your reverse-proxy upstream in sync. |
@@ -337,6 +337,8 @@ host, and nothing else.
337337
```bash
338338
# On the host — no repo clone, just the CLI and your artifact
339339
npm install -g @objectstack/cli
340+
npm install -g pg # Postgres driver is an optional peer of @objectstack/driver-sql —
341+
# install it next to the CLI, or the boot fails loudly (use mysql2 for OS_DATABASE_URL=mysql://…)
340342
scp dist/objectstack.json server:/opt/my-app/objectstack.json
341343
```
342344

0 commit comments

Comments
 (0)