@supabase/lite 0.2.1-next.2 → 0.3.0
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 +1 -2
- package/STATUS.md +7 -6
- package/dist/cli/index.js +144 -117
- package/dist/cli/lib.js +38 -32
- package/dist/db/postgres/{BasePostgresConnection-B7zHDAib.d.ts → BasePostgresConnection-Clykq58D.d.ts} +1 -1
- package/dist/db/postgres/PostgresConnection.d.ts +1 -1
- package/dist/db/postgres/PostgresConnection.js +21 -25
- package/dist/db/postgres/pglite/PgliteConnection.d.ts +1 -1
- package/dist/db/postgres/pglite/PgliteConnection.js +25 -27
- package/dist/index.js +33 -33
- package/package.json +3 -7
package/README.md
CHANGED
|
@@ -174,7 +174,6 @@ supabase/
|
|
|
174
174
|
```toml
|
|
175
175
|
[api]
|
|
176
176
|
port = 54321
|
|
177
|
-
max_rows = 1000
|
|
178
177
|
|
|
179
178
|
[db]
|
|
180
179
|
driver = "sqlite-postgres" # or "sqlite" | "pglite" | "postgres"
|
|
@@ -204,7 +203,7 @@ enable_confirmations = false
|
|
|
204
203
|
|
|
205
204
|
Write **Postgres DDL** in `supabase/schemas/*.sql`. When the DB driver is SQLite, DDL is translated on the fly (`SERIAL` → `INTEGER PRIMARY KEY AUTOINCREMENT`, `NOW()` → `datetime('now')`, `JSONB` → `TEXT` with a `json_valid()` check, and so on). Postgres-only features that don't translate (ranges, `LATERAL`, table inheritance) throw a descriptive error.
|
|
206
205
|
|
|
207
|
-
RLS works across all backends: on SQLite, policies are extracted from DDL and enforced at the application layer by rewriting the query AST; on PGlite/Postgres, native RLS is used. `auth.uid()`, `auth.jwt()`, and roles (`anon`, `authenticated`) resolve from the JWT.
|
|
206
|
+
RLS works across all backends: on SQLite, policies are extracted from DDL and enforced at the application layer by rewriting the query AST; on PGlite/Postgres, native RLS is used. `auth.uid()`, `auth.jwt()`, and roles (`anon`, `authenticated`, `service_role`) resolve from the JWT.
|
|
208
207
|
|
|
209
208
|
Full translation reference: [STATUS.md#postgres-to-sqlite-translation](https://github.com/supabase-community/lite/blob/HEAD/STATUS.md#postgres-to-sqlite-translation) and [`app/POSTGRES-SQLITE-COMPAT.md`](https://github.com/supabase-community/lite/blob/HEAD/app/POSTGRES-SQLITE-COMPAT.md).
|
|
210
209
|
|
package/STATUS.md
CHANGED
|
@@ -34,9 +34,9 @@ Feature and API compatibility tracking for @supabase/lite. For usage docs, see [
|
|
|
34
34
|
|
|
35
35
|
## Postgres-to-SQLite Translation
|
|
36
36
|
|
|
37
|
-
When using SQLite databases, SQL schemas written in Postgres dialect are translated on the fly. The translator extends the Postgres deparser. It passes through 1:1 compatible syntax unchanged, rewrites constructs that have SQLite equivalents (for example `SERIAL` → `INTEGER PRIMARY KEY AUTOINCREMENT`, `NOW()` → `datetime('now')`), silently drops Postgres-only decorators (storage parameters, locking clauses), and errors on features that have no SQLite counterpart (`LATERAL` joins, table inheritance).
|
|
37
|
+
When using SQLite databases, SQL schemas written in Postgres dialect are translated on the fly. The translator extends the Postgres deparser. It passes through 1:1 compatible syntax unchanged, rewrites constructs that have SQLite equivalents (for example `SERIAL` → `INTEGER PRIMARY KEY AUTOINCREMENT`, `NOW()` → `datetime('now')`), silently drops Postgres-only decorators and relation/schema privilege metadata (storage parameters, locking clauses, table/schema/sequence grants), and errors on features that have no SQLite counterpart (`LATERAL` joins, table inheritance, function grants).
|
|
38
38
|
|
|
39
|
-
📋 See [`app/POSTGRES-SQLITE-COMPAT.md`](https://github.com/supabase-community/lite/blob/HEAD/app/POSTGRES-SQLITE-COMPAT.md) for the full auto-generated compatibility reference (
|
|
39
|
+
📋 See [`app/POSTGRES-SQLITE-COMPAT.md`](https://github.com/supabase-community/lite/blob/HEAD/app/POSTGRES-SQLITE-COMPAT.md) for the full auto-generated compatibility reference (71 entries).
|
|
40
40
|
|
|
41
41
|
Here is an example of a Postgres schema that is translated to SQLite:
|
|
42
42
|
|
|
@@ -190,7 +190,7 @@ RLS is supported on all database backends. The enforcement strategy differs by d
|
|
|
190
190
|
|
|
191
191
|
📖 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.
|
|
192
192
|
|
|
193
|
-
**PGlite / PostgreSQL auto-setup:** When any table has `ENABLE ROW LEVEL SECURITY`, supalite creates `anon` and `
|
|
193
|
+
**PGlite / PostgreSQL auto-setup:** When any table has `ENABLE ROW LEVEL SECURITY`, supalite creates `anon`, `authenticated`, and `service_role` roles (if missing; `service_role` uses `BYPASSRLS`) and grants default privileges on all tables and sequences in the relevant schemas. No manual `CREATE ROLE` or `GRANT` statements needed for these built-in roles.
|
|
194
194
|
|
|
195
195
|
### PL/pgSQL Trigger Functions
|
|
196
196
|
|
|
@@ -644,7 +644,7 @@ Help groups match upstream: **Local Development** (commands you run from a proje
|
|
|
644
644
|
|
|
645
645
|
| Command | Status | Notes |
|
|
646
646
|
|-----------|--------|--------------------------------------------------------------------|
|
|
647
|
-
| `init` | ✅ |
|
|
647
|
+
| `init` | ✅ | Scaffolds API, migration/seed paths, and auth defaults; flags differ upstream |
|
|
648
648
|
| `start` | ✅ | In-process; no Docker stack flags (`-x`, `--ignore-health-check`) |
|
|
649
649
|
| `status` | 🧪 | `[experimental]` `[lite]`: shows linked project metadata |
|
|
650
650
|
| `login` | 🧪 | `[experimental]` Email/password against supalite cloud |
|
|
@@ -667,11 +667,12 @@ Help groups match upstream: **Local Development** (commands you run from a proje
|
|
|
667
667
|
|
|
668
668
|
| Command | Status | Notes |
|
|
669
669
|
|---------------|--------|----------------------------------------------------------------------|
|
|
670
|
-
| `db diff` | ✅ |
|
|
670
|
+
| `db diff` | ✅ | `--local` semantics; `-f` emits pg-DDL migrations from declarative schemas |
|
|
671
671
|
| `db query` | ✅ | Renamed from top-level `exec`; supports `--remote` and `--config` |
|
|
672
672
|
| `db schema` | ✅ | `[lite]`: moved from top-level; `--diff` and `--sql` modes |
|
|
673
673
|
| `db push` | 🔄 | Not registered; use `lite cloud deploy` |
|
|
674
|
-
| `db
|
|
674
|
+
| `db reset` | ✅ | Replays migrations + seed; does not apply declarative schema_paths |
|
|
675
|
+
| `db pull`, `db dump`, `db lint`, `db advisors` | 🔄 | Not registered |
|
|
675
676
|
| `db start` | 🚫 | Not applicable; in-process, no separate DB start |
|
|
676
677
|
|
|
677
678
|
### `migration` group
|