@supabase/lite 0.6.1-next.5 → 0.6.2-next.1
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/LIMITATIONS.md +1 -1
- package/README.md +15 -6
- package/STATUS.md +5 -3
- package/dist/cli/index.js +105 -105
- package/dist/cli/lib.js +35 -35
- package/dist/db/postgres/pglite/PgliteConnection.js +23 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +36 -36
- package/package.json +1 -1
package/LIMITATIONS.md
CHANGED
|
@@ -10,7 +10,7 @@ Anchors below point to the corresponding STATUS.md section. If a limitation here
|
|
|
10
10
|
- Subquery `WITH CHECK` on `INSERT` (`user_id IN (SELECT …)`, `EXISTS (…)`) → throws. Denormalise the owning column. See [RLS known limitations](https://github.com/supabase-community/lite/blob/HEAD/STATUS.md#row-level-security-rls).
|
|
11
11
|
- Scalar functions outside the allow-list in `DEFAULT` or `CHECK` (`trim`, `btrim`, `length`, `lower`, `upper`, …) → `Function call "<name>" not supported`. Use literals or move the check to the app layer. See [Column Defaults](https://github.com/supabase-community/lite/blob/HEAD/STATUS.md#column-defaults) and [CHECK constraint functions](https://github.com/supabase-community/lite/blob/HEAD/STATUS.md#check-constraint-functions).
|
|
12
12
|
- `nextval` / `currval`, `clock_timestamp`, `txid_current`, user-defined functions → not supported. See [Column Defaults](https://github.com/supabase-community/lite/blob/HEAD/STATUS.md#column-defaults).
|
|
13
|
-
- `
|
|
13
|
+
- `FORCE ROW LEVEL SECURITY` → not differentiated from `ENABLE ROW LEVEL SECURITY`. See [RLS known limitations](https://github.com/supabase-community/lite/blob/HEAD/STATUS.md#row-level-security-rls).
|
|
14
14
|
- PL/pgSQL `DECLARE`, `IF`, `LOOP`, `RAISE`, variables → not supported in trigger bodies. See [PL/pgSQL Trigger Functions](https://github.com/supabase-community/lite/blob/HEAD/STATUS.md#plpgsql-trigger-functions).
|
|
15
15
|
|
|
16
16
|
## supabase-js (SQLite path)
|
package/README.md
CHANGED
|
@@ -108,6 +108,10 @@ Known limitations across all paths: see [LIMITATIONS.md](https://github.com/supa
|
|
|
108
108
|
lite <command> [options]
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
+
By default, command output stays pipe-friendly: SQL, JSON, and query results are
|
|
112
|
+
not prefixed with banners or config diagnostics. Use `lite --verbose <command>`
|
|
113
|
+
to show details like the config file and database location on stderr.
|
|
114
|
+
|
|
111
115
|
### Local commands
|
|
112
116
|
|
|
113
117
|
| Command | Description |
|
|
@@ -117,12 +121,12 @@ lite <command> [options]
|
|
|
117
121
|
| `start` | Start server (no watch, no auto-migrate) |
|
|
118
122
|
| `db schema` | Print current DB schema; `--diff` compares vs `schemas/*.sql` |
|
|
119
123
|
| `db diff` | Emit a new pg-DDL migration from the declarative schema diff |
|
|
120
|
-
| `db
|
|
121
|
-
| `db
|
|
124
|
+
| `db translate` | Translate Postgres SQL to this project's backend dialect (arg or stdin) |
|
|
125
|
+
| `db query` | Run a SQL statement against the local DB (arg or stdin) |
|
|
126
|
+
| `db reset` | Drop everything, replay migrations, run seed (`--hard` = fresh DB file) |
|
|
122
127
|
| `migration new` | Create an empty migration file in `supabase/migrations/` |
|
|
123
128
|
| `migration up` | Apply pending migrations (`--dry-run` to preview) |
|
|
124
129
|
| `migration list` | Show applied vs pending migrations |
|
|
125
|
-
| `migration diff` | Diff DB state against `schemas/*.sql` |
|
|
126
130
|
| `repl` | Interactive REPL with `app`, `client`, `conn` in scope |
|
|
127
131
|
| `upgrade` | Migrate the project to hosted or local Supabase (see [UPGRADE.md](https://github.com/supabase-community/lite/blob/HEAD/UPGRADE.md)) |
|
|
128
132
|
| `debug` | Show runtime/config info |
|
|
@@ -131,12 +135,17 @@ Common flags:
|
|
|
131
135
|
|
|
132
136
|
```bash
|
|
133
137
|
lite init --pglite # use PGlite instead of SQLite
|
|
134
|
-
lite
|
|
138
|
+
lite db reset --hard # delete the DB file, replay migrations + seed
|
|
135
139
|
lite db schema --diff # diff current DB vs schemas/*.sql
|
|
136
140
|
lite db schema --sql # print raw CREATE statements
|
|
137
|
-
lite
|
|
138
|
-
lite migration diff --execute --force # apply, overriding data-loss warnings
|
|
141
|
+
lite db diff -f add_col # write a new pg-DDL migration file
|
|
139
142
|
lite db query "select count(*) from todos"
|
|
143
|
+
|
|
144
|
+
# db translate and db query take SQL as an argument or via stdin, so they compose:
|
|
145
|
+
cat supabase/migrations/*.sql | lite db translate # inspect the sqlite SQL for a migration
|
|
146
|
+
cat supabase/seed.sql | lite db translate | lite db query # translate + apply ad-hoc SQL
|
|
147
|
+
lite db translate "alter table public.todos add column done boolean" | lite db query
|
|
148
|
+
echo "select * from todos" | lite db query # pipe a one-off statement in
|
|
140
149
|
lite upgrade --dry-run # rehearsal plus SQLite shim audit
|
|
141
150
|
lite upgrade --dry-run --json # machine-readable shim audit output
|
|
142
151
|
```
|
package/STATUS.md
CHANGED
|
@@ -229,6 +229,7 @@ RLS is supported on all database backends. The enforcement strategy differs by d
|
|
|
229
229
|
| `FOR SELECT / INSERT / UPDATE / DELETE / ALL` | ✅ | ✅ | Per-command policy targeting |
|
|
230
230
|
| `TO role` (`anon`, `authenticated`, `PUBLIC`) | ✅ | ✅ | Role-based policy filtering; omitting `TO` = PUBLIC (warns) |
|
|
231
231
|
| Auth placeholders (`auth.uid()`, `auth.jwt()`) | ✅ | ✅ | Resolved at runtime from JWT context |
|
|
232
|
+
| `DROP POLICY` / `ALTER POLICY` (incl. rename) | ✅ | ✅ | SQLite: applied to the collected RLS registry, not emitted as DDL |
|
|
232
233
|
|
|
233
234
|
Each supported behavior is regression-covered against both backends in [`app/test/db/rls/pglite-comparison.test.ts`](https://github.com/supabase-community/lite/blob/HEAD/app/test/db/rls/pglite-comparison.test.ts) (LITE-271), so a silent SQLite bypass fails the suite.
|
|
234
235
|
|
|
@@ -240,7 +241,6 @@ Each supported behavior is regression-covered against both backends in [`app/tes
|
|
|
240
241
|
| `UPSERT` applies `INSERT` policies only | Postgres applies `UPDATE` policies on conflict; supalite applies `INSERT WITH CHECK` to all upsert rows since conflict resolution is unknown pre-execution. |
|
|
241
242
|
| `FORCE ROW LEVEL SECURITY` | Not differentiated from `ENABLE ROW LEVEL SECURITY`; table owner is not exempt. |
|
|
242
243
|
| `RETURNING` + `SELECT` policy | Postgres errors if `RETURNING` references rows not visible to `SELECT` policy. Not checked. |
|
|
243
|
-
| `DROP POLICY` / `ALTER POLICY` | Not yet supported in the DDL translator. |
|
|
244
244
|
|
|
245
245
|
📖 See [`internal/docs/postgres/rls.md`](https://github.com/supabase-community/lite/blob/HEAD/internal/docs/postgres/rls.md) for the full RLS reference and behavior matrix.
|
|
246
246
|
|
|
@@ -700,6 +700,8 @@ Backend implementation in `app/src/cli/`. Aligned to upstream `supabase` CLI com
|
|
|
700
700
|
|
|
701
701
|
Help groups match upstream: **Local Development** (commands you run from a project) and **Management APIs** (commands that manage remote resources).
|
|
702
702
|
|
|
703
|
+
Default command output is pipe-friendly: no global banner, and config/database-location diagnostics are hidden unless `--verbose` is passed.
|
|
704
|
+
|
|
703
705
|
### Top-Level
|
|
704
706
|
|
|
705
707
|
| Command | Status | Notes |
|
|
@@ -728,7 +730,8 @@ Help groups match upstream: **Local Development** (commands you run from a proje
|
|
|
728
730
|
| Command | Status | Notes |
|
|
729
731
|
|---------------|--------|----------------------------------------------------------------------|
|
|
730
732
|
| `db diff` | ✅ | `--local` semantics; `-f` emits pg-DDL migrations from declarative schemas |
|
|
731
|
-
| `db
|
|
733
|
+
| `db translate`| ✅ | `[lite]`: translates Postgres SQL to the project's backend dialect (arg or stdin) |
|
|
734
|
+
| `db query` | ✅ | Renamed from top-level `exec`; supports `--remote`, `--config`, and stdin |
|
|
732
735
|
| `db schema` | ✅ | `[lite]`: moved from top-level; `--diff` and `--sql` modes |
|
|
733
736
|
| `db push` | 🔄 | Not registered; use `lite cloud deploy` |
|
|
734
737
|
| `db reset` | ✅ | Replays migrations + seed; does not apply declarative schema_paths |
|
|
@@ -739,7 +742,6 @@ Help groups match upstream: **Local Development** (commands you run from a proje
|
|
|
739
742
|
|
|
740
743
|
| Command | Status | Notes |
|
|
741
744
|
|---------------------|--------|--------------------------------------------------------|
|
|
742
|
-
| `migration diff` | ✅ | `[lite]`: diff DB state against `schemas/*.sql` |
|
|
743
745
|
| `migration new` | ✅ | Create an empty migration file in `supabase/migrations/` |
|
|
744
746
|
| `migration up` | ✅ | Apply pending migrations; `--dry-run` lists without applying |
|
|
745
747
|
| `migration list` | ✅ | Show applied vs pending migrations |
|