schematic-pg 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
- [Database client](docs/database-client.md)
|
|
15
15
|
- [REST API](docs/rest-api.md)
|
|
16
16
|
- [Access control](docs/access-control.md)
|
|
17
|
+
- [Migrations tutorial](docs/migrations.md) — schema diffs, `db:migrate`, and GitHub Actions for staging/production
|
|
17
18
|
- [Project structure](docs/project-structure.md)
|
|
18
19
|
- [Contributing (this repo)](docs/contributing.md)
|
|
19
20
|
- [Why schematic-pg?](docs/why.md)
|
|
@@ -37,6 +38,7 @@ make dev
|
|
|
37
38
|
# → starts PostgreSQL, generates code, bootstraps the DB, runs the dev server,
|
|
38
39
|
# and watches app.schema for changes (regenerate + bootstrap + restart)
|
|
39
40
|
# → http://localhost:3000
|
|
41
|
+
# → API docs at http://localhost:3000/docs
|
|
40
42
|
```
|
|
41
43
|
|
|
42
44
|
Or run each step individually:
|
|
@@ -361,10 +363,10 @@ schematic-pg init [dir] [--skip-install] # Scaffold a new project (runs npm ins
|
|
|
361
363
|
schematic-pg generate [schema] # schema.sql + db client + API (all three)
|
|
362
364
|
schematic-pg generate:sql [schema] # SQL DDL to stdout
|
|
363
365
|
schematic-pg generate:client [schema] # generated/db*.ts only
|
|
364
|
-
schematic-pg generate:api [schema] # generated/app.ts, routes/, policies, schemas
|
|
366
|
+
schematic-pg generate:api [schema] # generated/app.ts, routes/, policies, schemas, openapi
|
|
365
367
|
```
|
|
366
368
|
|
|
367
|
-
Run `generate:client` before `generate:api` when using the split commands — routes depend on `generated/db.ts`.
|
|
369
|
+
Run `generate:client` before `generate:api` when using the split commands — routes depend on `generated/db.ts`. After the server starts, open [http://localhost:3000/docs](http://localhost:3000/docs) for Scalar docs (OpenAPI at `/openapi.json`).
|
|
368
370
|
|
|
369
371
|
### Lifecycle hooks scaffolding
|
|
370
372
|
|
|
@@ -456,6 +458,8 @@ schematic-pg db:migrate:status [schema] # Show snapshot + migration file stat
|
|
|
456
458
|
|
|
457
459
|
`db:bootstrap` is the recommended first-time setup. Use `db:diff` / `db:migrate` when evolving an existing database.
|
|
458
460
|
|
|
461
|
+
For a full walkthrough (mental model, local loop, and automating staging/production with GitHub Actions), see [Migrations tutorial](docs/migrations.md).
|
|
462
|
+
|
|
459
463
|
Alternatively, apply SQL manually:
|
|
460
464
|
|
|
461
465
|
```bash
|