postgresai 0.14.0-dev.69 → 0.14.0-dev.70
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 +32 -0
- package/bin/postgres-ai.ts +486 -72
- package/dist/bin/postgres-ai.js +828 -75
- package/lib/metrics-embedded.ts +1 -1
- package/lib/supabase.ts +769 -0
- package/package.json +1 -1
- package/test/supabase.test.ts +568 -0
package/README.md
CHANGED
|
@@ -93,6 +93,38 @@ To see what SQL would be executed (passwords redacted by default):
|
|
|
93
93
|
npx postgresai prepare-db postgresql://admin@host:5432/dbname --print-sql
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
### Supabase mode
|
|
97
|
+
|
|
98
|
+
For Supabase projects, you can use the Management API instead of direct PostgreSQL connections. This is useful when direct database access is restricted.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Using environment variables
|
|
102
|
+
export SUPABASE_ACCESS_TOKEN='your_management_api_token'
|
|
103
|
+
export SUPABASE_PROJECT_REF='your_project_ref'
|
|
104
|
+
npx postgresai prepare-db --supabase
|
|
105
|
+
|
|
106
|
+
# Using command-line options
|
|
107
|
+
npx postgresai prepare-db --supabase \
|
|
108
|
+
--supabase-access-token 'your_token' \
|
|
109
|
+
--supabase-project-ref 'your_project_ref'
|
|
110
|
+
|
|
111
|
+
# Auto-detect project ref from a Supabase database URL
|
|
112
|
+
npx postgresai prepare-db postgresql://postgres:password@db.abc123.supabase.co:5432/postgres \
|
|
113
|
+
--supabase --supabase-access-token 'your_token'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The Supabase access token can be created at https://supabase.com/dashboard/account/tokens.
|
|
117
|
+
|
|
118
|
+
Options:
|
|
119
|
+
- `--supabase` - Enable Supabase Management API mode
|
|
120
|
+
- `--supabase-access-token <token>` - Supabase Management API access token (or use `SUPABASE_ACCESS_TOKEN` env var)
|
|
121
|
+
- `--supabase-project-ref <ref>` - Supabase project reference (or use `SUPABASE_PROJECT_REF` env var)
|
|
122
|
+
|
|
123
|
+
Notes:
|
|
124
|
+
- The project reference can be auto-detected from Supabase database URLs
|
|
125
|
+
- All standard options work with Supabase mode (`--verify`, `--print-sql`, `--skip-optional-permissions`, etc.)
|
|
126
|
+
- When using `--verify`, the tool checks if all required setup is in place
|
|
127
|
+
|
|
96
128
|
### Verify and password reset
|
|
97
129
|
|
|
98
130
|
Verify that everything is configured as expected (no changes):
|