Skip to content

Commit 5059545

Browse files
committed
Document prod scripts
1 parent f1f9d7f commit 5059545

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

docs/development.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,19 @@ Logs are in `debug/console/` (`db.log`, `studio.log`, `sdk.log`, `web.log`).
4242
## Database Migrations
4343

4444
Edit schema using Drizzle's TS DSL (don't hand-write migration SQL), then run the internal DB scripts to generate/apply migrations.
45+
46+
## Running Scripts Against Prod
47+
48+
Scripts in `scripts/` connect to whatever environment Infisical injects. To run a script against the production database and services, prefix it with `infisical run --env=prod`:
49+
50+
```bash
51+
infisical run --env=prod -- bun scripts/<name>.ts
52+
```
53+
54+
You can also inline a one-off query:
55+
56+
```bash
57+
infisical run --env=prod -- bun -e "import db from '@codebuff/internal/db'; /* ... */"
58+
```
59+
60+
Add `--silent` to suppress the Infisical banner. Default env is `dev` — always pass `--env=prod` explicitly when you want prod. Prefer read-only queries; coordinate before running anything that writes.

0 commit comments

Comments
 (0)