@noy-db/to-supabase 0.1.0-pre.10

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 vLannaAi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @noy-db/to-supabase
2
+
3
+ [![npm](https://img.shields.io/npm/v/%40noy-db/to-supabase.svg)](https://www.npmjs.com/package/@noy-db/to-supabase)
4
+
5
+ > Supabase adapter for noy-db
6
+
7
+ Part of [**`@noy-db/hub`**](https://www.npmjs.com/package/@noy-db/hub) — the zero-knowledge, offline-first, encrypted document store.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add @noy-db/hub @noy-db/to-supabase
13
+ ```
14
+
15
+ ## What it is
16
+
17
+ Supabase adapter for noy-db — Postgres + Storage combo. Routes records to @noy-db/to-postgres via the Supabase Postgres pool and optional blob routing via Supabase Storage.
18
+
19
+ ## Status
20
+
21
+ **Pre-release** (`0.1.0-pre.1`). API may change before `1.0`.
22
+
23
+ ## Documentation
24
+
25
+ See the [main repository](https://github.com/vLannaAi/noy-db#readme) for setup, examples, and the full subsystem catalog.
26
+
27
+ - Source — [`packages/to-supabase`](https://github.com/vLannaAi/noy-db/tree/main/packages/to-supabase)
28
+ - Issues — [github.com/vLannaAi/noy-db/issues](https://github.com/vLannaAi/noy-db/issues)
29
+ - Spec — [`SPEC.md`](https://github.com/vLannaAi/noy-db/blob/main/SPEC.md)
30
+
31
+ ## License
32
+
33
+ [MIT](./LICENSE) © vLannaAi
package/dist/index.cjs ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ supabase: () => supabase
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ var import_to_postgres = require("@noy-db/to-postgres");
27
+ function supabase(options) {
28
+ const base = (0, import_to_postgres.postgres)(options);
29
+ return { ...base, name: "supabase" };
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ supabase
34
+ });
35
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * **@noy-db/to-supabase** — Supabase adapter for noy-db.\n *\n * Supabase projects ship both a Postgres database and an S3-compatible\n * object store. This package is a thin factory that configures\n * `@noy-db/to-postgres` for the Postgres pool that the consumer has\n * already wired (via `@supabase/supabase-js`, node-postgres, or the\n * Supabase serverless driver) and re-exports the result.\n *\n * ## Why not embed `@supabase/supabase-js`?\n *\n * The Supabase client is a large dependency that also bundles\n * `node-fetch`, a realtime websocket, and a storage client. Embedding\n * it would duplicate transport code that the consumer has already\n * installed for their app logic. The noy-db adapter only needs the\n * Postgres query path, so we accept whatever SQL-capable client the\n * consumer passes in — same contract as `@noy-db/to-postgres`.\n *\n * ## Typical wiring\n *\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n * import { supabase } from '@noy-db/to-supabase'\n * import pg from 'pg'\n *\n * const pool = new pg.Pool({ connectionString: process.env.SUPABASE_DB_URL })\n * const store = supabase({ client: pool })\n *\n * // Optionally, the Supabase JS client for Storage-based blob routing:\n * const s = createClient(url, key)\n * // … blob-routing helpers can be added in a follow-up\n * ```\n *\n * ## Capabilities\n *\n * Inherits everything from `@noy-db/to-postgres`: `casAtomic: true`,\n * `txAtomic: true`, `listPage`, `ping`.\n *\n * @packageDocumentation\n */\n\nimport type { NoydbStore } from '@noy-db/hub'\nimport type { PostgresClient, PostgresStoreOptions } from '@noy-db/to-postgres'\nimport { postgres } from '@noy-db/to-postgres'\n\nexport type { PostgresClient }\n\nexport interface SupabaseStoreOptions extends Omit<PostgresStoreOptions, 'client'> {\n /**\n * Any Postgres-compatible client — `pg.Pool`, `pg.Client`, or a\n * Supabase serverless driver. The noy-db store never talks to the\n * Supabase REST / Realtime APIs.\n */\n readonly client: PostgresClient\n}\n\n/**\n * Create a noy-db store backed by a Supabase Postgres connection.\n * Inherits the entire `@noy-db/to-postgres` feature set.\n */\nexport function supabase(options: SupabaseStoreOptions): NoydbStore {\n const base = postgres(options)\n return { ...base, name: 'supabase' }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2CA,yBAAyB;AAiBlB,SAAS,SAAS,SAA2C;AAClE,QAAM,WAAO,6BAAS,OAAO;AAC7B,SAAO,EAAE,GAAG,MAAM,MAAM,WAAW;AACrC;","names":[]}
@@ -0,0 +1,60 @@
1
+ import { NoydbStore } from '@noy-db/hub';
2
+ import { PostgresStoreOptions, PostgresClient } from '@noy-db/to-postgres';
3
+ export { PostgresClient } from '@noy-db/to-postgres';
4
+
5
+ /**
6
+ * **@noy-db/to-supabase** — Supabase adapter for noy-db.
7
+ *
8
+ * Supabase projects ship both a Postgres database and an S3-compatible
9
+ * object store. This package is a thin factory that configures
10
+ * `@noy-db/to-postgres` for the Postgres pool that the consumer has
11
+ * already wired (via `@supabase/supabase-js`, node-postgres, or the
12
+ * Supabase serverless driver) and re-exports the result.
13
+ *
14
+ * ## Why not embed `@supabase/supabase-js`?
15
+ *
16
+ * The Supabase client is a large dependency that also bundles
17
+ * `node-fetch`, a realtime websocket, and a storage client. Embedding
18
+ * it would duplicate transport code that the consumer has already
19
+ * installed for their app logic. The noy-db adapter only needs the
20
+ * Postgres query path, so we accept whatever SQL-capable client the
21
+ * consumer passes in — same contract as `@noy-db/to-postgres`.
22
+ *
23
+ * ## Typical wiring
24
+ *
25
+ * ```ts
26
+ * import { createClient } from '@supabase/supabase-js'
27
+ * import { supabase } from '@noy-db/to-supabase'
28
+ * import pg from 'pg'
29
+ *
30
+ * const pool = new pg.Pool({ connectionString: process.env.SUPABASE_DB_URL })
31
+ * const store = supabase({ client: pool })
32
+ *
33
+ * // Optionally, the Supabase JS client for Storage-based blob routing:
34
+ * const s = createClient(url, key)
35
+ * // … blob-routing helpers can be added in a follow-up
36
+ * ```
37
+ *
38
+ * ## Capabilities
39
+ *
40
+ * Inherits everything from `@noy-db/to-postgres`: `casAtomic: true`,
41
+ * `txAtomic: true`, `listPage`, `ping`.
42
+ *
43
+ * @packageDocumentation
44
+ */
45
+
46
+ interface SupabaseStoreOptions extends Omit<PostgresStoreOptions, 'client'> {
47
+ /**
48
+ * Any Postgres-compatible client — `pg.Pool`, `pg.Client`, or a
49
+ * Supabase serverless driver. The noy-db store never talks to the
50
+ * Supabase REST / Realtime APIs.
51
+ */
52
+ readonly client: PostgresClient;
53
+ }
54
+ /**
55
+ * Create a noy-db store backed by a Supabase Postgres connection.
56
+ * Inherits the entire `@noy-db/to-postgres` feature set.
57
+ */
58
+ declare function supabase(options: SupabaseStoreOptions): NoydbStore;
59
+
60
+ export { type SupabaseStoreOptions, supabase };
@@ -0,0 +1,60 @@
1
+ import { NoydbStore } from '@noy-db/hub';
2
+ import { PostgresStoreOptions, PostgresClient } from '@noy-db/to-postgres';
3
+ export { PostgresClient } from '@noy-db/to-postgres';
4
+
5
+ /**
6
+ * **@noy-db/to-supabase** — Supabase adapter for noy-db.
7
+ *
8
+ * Supabase projects ship both a Postgres database and an S3-compatible
9
+ * object store. This package is a thin factory that configures
10
+ * `@noy-db/to-postgres` for the Postgres pool that the consumer has
11
+ * already wired (via `@supabase/supabase-js`, node-postgres, or the
12
+ * Supabase serverless driver) and re-exports the result.
13
+ *
14
+ * ## Why not embed `@supabase/supabase-js`?
15
+ *
16
+ * The Supabase client is a large dependency that also bundles
17
+ * `node-fetch`, a realtime websocket, and a storage client. Embedding
18
+ * it would duplicate transport code that the consumer has already
19
+ * installed for their app logic. The noy-db adapter only needs the
20
+ * Postgres query path, so we accept whatever SQL-capable client the
21
+ * consumer passes in — same contract as `@noy-db/to-postgres`.
22
+ *
23
+ * ## Typical wiring
24
+ *
25
+ * ```ts
26
+ * import { createClient } from '@supabase/supabase-js'
27
+ * import { supabase } from '@noy-db/to-supabase'
28
+ * import pg from 'pg'
29
+ *
30
+ * const pool = new pg.Pool({ connectionString: process.env.SUPABASE_DB_URL })
31
+ * const store = supabase({ client: pool })
32
+ *
33
+ * // Optionally, the Supabase JS client for Storage-based blob routing:
34
+ * const s = createClient(url, key)
35
+ * // … blob-routing helpers can be added in a follow-up
36
+ * ```
37
+ *
38
+ * ## Capabilities
39
+ *
40
+ * Inherits everything from `@noy-db/to-postgres`: `casAtomic: true`,
41
+ * `txAtomic: true`, `listPage`, `ping`.
42
+ *
43
+ * @packageDocumentation
44
+ */
45
+
46
+ interface SupabaseStoreOptions extends Omit<PostgresStoreOptions, 'client'> {
47
+ /**
48
+ * Any Postgres-compatible client — `pg.Pool`, `pg.Client`, or a
49
+ * Supabase serverless driver. The noy-db store never talks to the
50
+ * Supabase REST / Realtime APIs.
51
+ */
52
+ readonly client: PostgresClient;
53
+ }
54
+ /**
55
+ * Create a noy-db store backed by a Supabase Postgres connection.
56
+ * Inherits the entire `@noy-db/to-postgres` feature set.
57
+ */
58
+ declare function supabase(options: SupabaseStoreOptions): NoydbStore;
59
+
60
+ export { type SupabaseStoreOptions, supabase };
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // src/index.ts
2
+ import { postgres } from "@noy-db/to-postgres";
3
+ function supabase(options) {
4
+ const base = postgres(options);
5
+ return { ...base, name: "supabase" };
6
+ }
7
+ export {
8
+ supabase
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * **@noy-db/to-supabase** — Supabase adapter for noy-db.\n *\n * Supabase projects ship both a Postgres database and an S3-compatible\n * object store. This package is a thin factory that configures\n * `@noy-db/to-postgres` for the Postgres pool that the consumer has\n * already wired (via `@supabase/supabase-js`, node-postgres, or the\n * Supabase serverless driver) and re-exports the result.\n *\n * ## Why not embed `@supabase/supabase-js`?\n *\n * The Supabase client is a large dependency that also bundles\n * `node-fetch`, a realtime websocket, and a storage client. Embedding\n * it would duplicate transport code that the consumer has already\n * installed for their app logic. The noy-db adapter only needs the\n * Postgres query path, so we accept whatever SQL-capable client the\n * consumer passes in — same contract as `@noy-db/to-postgres`.\n *\n * ## Typical wiring\n *\n * ```ts\n * import { createClient } from '@supabase/supabase-js'\n * import { supabase } from '@noy-db/to-supabase'\n * import pg from 'pg'\n *\n * const pool = new pg.Pool({ connectionString: process.env.SUPABASE_DB_URL })\n * const store = supabase({ client: pool })\n *\n * // Optionally, the Supabase JS client for Storage-based blob routing:\n * const s = createClient(url, key)\n * // … blob-routing helpers can be added in a follow-up\n * ```\n *\n * ## Capabilities\n *\n * Inherits everything from `@noy-db/to-postgres`: `casAtomic: true`,\n * `txAtomic: true`, `listPage`, `ping`.\n *\n * @packageDocumentation\n */\n\nimport type { NoydbStore } from '@noy-db/hub'\nimport type { PostgresClient, PostgresStoreOptions } from '@noy-db/to-postgres'\nimport { postgres } from '@noy-db/to-postgres'\n\nexport type { PostgresClient }\n\nexport interface SupabaseStoreOptions extends Omit<PostgresStoreOptions, 'client'> {\n /**\n * Any Postgres-compatible client — `pg.Pool`, `pg.Client`, or a\n * Supabase serverless driver. The noy-db store never talks to the\n * Supabase REST / Realtime APIs.\n */\n readonly client: PostgresClient\n}\n\n/**\n * Create a noy-db store backed by a Supabase Postgres connection.\n * Inherits the entire `@noy-db/to-postgres` feature set.\n */\nexport function supabase(options: SupabaseStoreOptions): NoydbStore {\n const base = postgres(options)\n return { ...base, name: 'supabase' }\n}\n"],"mappings":";AA2CA,SAAS,gBAAgB;AAiBlB,SAAS,SAAS,SAA2C;AAClE,QAAM,OAAO,SAAS,OAAO;AAC7B,SAAO,EAAE,GAAG,MAAM,MAAM,WAAW;AACrC;","names":[]}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@noy-db/to-supabase",
3
+ "version": "0.1.0-pre.10",
4
+ "description": "Supabase adapter for noy-db — Postgres + Storage combo. Routes records to @noy-db/to-postgres via the Supabase Postgres pool and optional blob routing via Supabase Storage.",
5
+ "license": "MIT",
6
+ "author": "vLannaAi <vicio@lanna.ai>",
7
+ "homepage": "https://github.com/vLannaAi/noy-db/tree/main/packages/to-supabase#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/vLannaAi/noy-db.git",
11
+ "directory": "packages/to-supabase"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/vLannaAi/noy-db/issues"
15
+ },
16
+ "type": "module",
17
+ "sideEffects": false,
18
+ "exports": {
19
+ ".": {
20
+ "import": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "require": {
25
+ "types": "./dist/index.d.cts",
26
+ "default": "./dist/index.cjs"
27
+ }
28
+ }
29
+ },
30
+ "main": "./dist/index.cjs",
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "files": [
34
+ "dist",
35
+ "README.md",
36
+ "LICENSE"
37
+ ],
38
+ "engines": {
39
+ "node": ">=18.0.0"
40
+ },
41
+ "peerDependencies": {
42
+ "@noy-db/hub": "0.1.0-pre.10",
43
+ "@noy-db/to-postgres": "0.1.0-pre.10"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^22.0.0",
47
+ "@noy-db/to-postgres": "0.1.0-pre.10",
48
+ "@noy-db/hub": "0.1.0-pre.10"
49
+ },
50
+ "keywords": [
51
+ "noy-db",
52
+ "to-supabase",
53
+ "supabase",
54
+ "postgres",
55
+ "storage"
56
+ ],
57
+ "publishConfig": {
58
+ "access": "public",
59
+ "tag": "latest"
60
+ },
61
+ "scripts": {
62
+ "build": "tsup",
63
+ "test": "vitest run",
64
+ "lint": "eslint src/",
65
+ "typecheck": "tsc --noEmit"
66
+ }
67
+ }