clivly 0.23.1 → 0.24.0-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/README.md +42 -2
- package/{adapter-B4v4dwgD.d.mts → adapter--YV7du3i.d.cts} +1 -1
- package/{adapter-BK3gsby5.d.cts → adapter-DD3K3dCW.d.mts} +1 -1
- package/app-id-5cB6yioz.mjs +53 -0
- package/app-id-DcQ4u1c8.cjs +70 -0
- package/{auth-adapter-BIa-ZyVV.d.mts → auth-adapter-C17dzlzF.d.cts} +1 -1
- package/{auth-adapter-DwtMJb7D.d.cts → auth-adapter-CizFv7oU.d.mts} +1 -1
- package/auth-better-auth.d.cts +1 -1
- package/auth-better-auth.d.mts +1 -1
- package/auth-clerk.d.cts +1 -1
- package/auth-clerk.d.mts +1 -1
- package/auth-supabase.cjs +121 -0
- package/auth-supabase.d.cts +23 -0
- package/auth-supabase.d.mts +23 -0
- package/auth-supabase.mjs +119 -0
- package/auth-workos.d.cts +1 -1
- package/auth-workos.d.mts +1 -1
- package/core-adapter.d.cts +1 -1
- package/core-adapter.d.mts +1 -1
- package/core-auth-adapter.d.cts +1 -1
- package/core-auth-adapter.d.mts +1 -1
- package/core-mapping-score.d.cts +1 -0
- package/core-sync-engine.cjs +1 -1
- package/core-sync-engine.mjs +1 -1
- package/core-types.cjs +5 -1
- package/core-types.d.cts +2 -2
- package/core-types.d.mts +2 -2
- package/core-types.mjs +1 -1
- package/core-view-compiler.cjs +1 -1
- package/core-view-compiler.mjs +1 -1
- package/core.cjs +9 -5
- package/core.d.cts +6 -6
- package/core.d.mts +6 -6
- package/core.mjs +6 -6
- package/drizzle.cjs +121 -14
- package/drizzle.d.cts +8 -2
- package/drizzle.d.mts +8 -2
- package/drizzle.mjs +126 -19
- package/executor-CJEWurjZ.mjs +23 -0
- package/executor-CU-jRgpC.cjs +40 -0
- package/from-sql-BD7gR4bC.mjs +282 -0
- package/from-sql-CFgXkCe2.cjs +347 -0
- package/from-sql-CpGP7K3J.d.mts +70 -0
- package/from-sql-S8dSvU-e.d.cts +70 -0
- package/index-BoemTWH4.d.mts +134 -0
- package/index-CIupXz_w.d.cts +134 -0
- package/{index-Bh7o2J7K.d.mts → index-DOoX2GgI.d.mts} +3 -3
- package/{index-DRRTE5IJ.d.cts → index-uFDiQEjj.d.cts} +231 -5
- package/index.cjs +1079 -36
- package/index.d.cts +36 -0
- package/index.d.mts +35 -0
- package/index.mjs +1077 -34
- package/{internal-CdfVkh4O.d.mts → internal-D_2q2BOB.d.mts} +1 -1
- package/internal-adapter.d.cts +1 -1
- package/internal-adapter.d.mts +1 -1
- package/internal-auth-adapter.d.cts +1 -1
- package/internal-auth-adapter.d.mts +1 -1
- package/internal-sync-engine.cjs +1 -1
- package/internal-sync-engine.mjs +1 -1
- package/internal-types.cjs +5 -1
- package/internal-types.d.cts +2 -2
- package/internal-types.d.mts +2 -2
- package/internal-types.mjs +1 -1
- package/internal-view-compiler.cjs +1 -1
- package/internal-view-compiler.mjs +1 -1
- package/internal.cjs +9 -5
- package/internal.d.cts +5 -6
- package/internal.d.mts +6 -6
- package/internal.mjs +6 -6
- package/introspector-5w2x89RD.mjs +55 -0
- package/introspector-DT_Ma59k.cjs +60 -0
- package/kysely.cjs +56 -0
- package/kysely.d.cts +45 -0
- package/kysely.d.mts +45 -0
- package/kysely.mjs +54 -0
- package/{namespace-probe-JuHriruA.d.mts → namespace-probe-CUR2zG2l.d.mts} +41 -4
- package/package.json +45 -1
- package/projection-guard-C70l5U24.cjs +170 -0
- package/projection-guard-DOt_nbGn.mjs +147 -0
- package/{projection-sql-DQQdjw9I.mjs → projection-sql-2joBkLz2.mjs} +13 -3
- package/{projection-sql-BkrHR2ea.cjs → projection-sql-DS5sVTY-.cjs} +18 -2
- package/sdk-Bzkr24NW.cjs +207 -0
- package/sdk-D2WwGBzk.mjs +178 -0
- package/sdk.cjs +8 -6
- package/sdk.d.cts +7 -1
- package/sdk.d.mts +7 -1
- package/sdk.mjs +3 -2
- package/sql.cjs +20 -0
- package/sql.d.cts +3 -0
- package/sql.d.mts +3 -0
- package/sql.mjs +7 -0
- package/{sdk-BOarpe5I.cjs → src-CZIdwwI2.cjs} +203 -583
- package/{sdk-BkMDOfCk.mjs → src-tFhC1Ru2.mjs} +175 -531
- package/supabase-contact-3ke1KKUs.mjs +595 -0
- package/supabase-contact-BXQ0nnLq.cjs +624 -0
- package/supabase.cjs +165 -0
- package/supabase.d.cts +20 -0
- package/supabase.d.mts +20 -0
- package/supabase.mjs +164 -0
- package/sync-CdA9dgZz.cjs +519 -0
- package/sync-Q0O-2kFI.mjs +382 -0
- package/{sync-engine-yFLEyId3.mjs → sync-engine-D0mJUeqP.mjs} +1 -1
- package/{sync-engine-DNSoZeo0.cjs → sync-engine-hU041kXO.cjs} +1 -1
- package/{namespace-probe-CcL6Wj8E.d.cts → types-CzL7lUH9.d.cts} +84 -47
- package/types-KMH5D5Lg.mjs +32 -0
- package/{types-BBfwsDxe.d.cts → types-f-Vcv-pl.d.cts} +18 -2
- package/{types-BBfwsDxe.d.mts → types-f-Vcv-pl.d.mts} +18 -2
- package/types-kR1kUlmz.cjs +67 -0
- package/{view-compiler-CSHSqZl7.mjs → view-compiler-BhKiezRH.mjs} +1 -1
- package/{view-compiler-NqiortOA.cjs → view-compiler-DgZadq1F.cjs} +1 -1
- package/vite.d.cts +1 -1
- package/vite.d.mts +1 -1
- package/drizzle-meta-BPnRLpsB.cjs +0 -8
- package/drizzle-meta-D00lFvAk.mjs +0 -3
- package/internal-D7qVRIFb.d.cts +0 -228
- package/types-8KSw2AWg.mjs +0 -8
- package/types-B8m39L1s.cjs +0 -19
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
const require_sync = require("./sync-CdA9dgZz.cjs");
|
|
2
|
+
const require_projection_sql = require("./projection-sql-DS5sVTY-.cjs");
|
|
3
|
+
// ../sdk/src/sql/dialect.ts
|
|
4
|
+
const postgresDialect = {
|
|
5
|
+
name: "postgres",
|
|
6
|
+
quoteIdent: require_projection_sql.quoteIdent,
|
|
7
|
+
quoteTableRef: require_projection_sql.quoteTableRef,
|
|
8
|
+
param: (index) => `$${index}`,
|
|
9
|
+
timestampParam: (index) => `$${index}::timestamptz`
|
|
10
|
+
};
|
|
11
|
+
// ../sdk/src/sql/keyset.ts
|
|
12
|
+
/**
|
|
13
|
+
* Keyset paging shared by every cursored source (`fromDrizzle`,
|
|
14
|
+
* `fromDrizzleProjection`, `fromSql`, `fromSqlProjection`).
|
|
15
|
+
*
|
|
16
|
+
* Rows are ordered on the RAW `(cursor, id)` columns, so an index on them is
|
|
17
|
+
* walked in order. The position is carried at the database's precision: each
|
|
18
|
+
* row also reads its cursor as text with microseconds (`exactCursorRead`), and
|
|
19
|
+
* the next page compares `(cursor, id) > ('<that text>', id)` in Postgres. A
|
|
20
|
+
* JS Date keeps only milliseconds, and a cursor truncated to one re-read every
|
|
21
|
+
* row inside that millisecond, forever when a whole page shared it.
|
|
22
|
+
*
|
|
23
|
+
* Rows with no position come first, as if at the epoch (the `fromSql`
|
|
24
|
+
* semantics), read by id in a query of their own so neither query orders on
|
|
25
|
+
* an expression: a NULL cursor, and an `infinity` / `-infinity` timestamp,
|
|
26
|
+
* which `to_char` reads as NULL and no Date can hold. Every row is synced; an
|
|
27
|
+
* infinite stamp simply never moves the position.
|
|
28
|
+
*/
|
|
29
|
+
/** Internal alias a page query reads the exact cursor under; never pushed. */
|
|
30
|
+
const CURSOR_ALIAS = "__clivly_cursor__";
|
|
31
|
+
/** `to_char` format of an exact cursor time. */
|
|
32
|
+
const EXACT_FORMAT = `'YYYY-MM-DD"T"HH24:MI:SS.US"Z"'`;
|
|
33
|
+
const CURSOR_LITERAL = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,6})?Z$/;
|
|
34
|
+
const UNSUPPORTED = "unsupported:";
|
|
35
|
+
/**
|
|
36
|
+
* SQL reading a timestamp cursor column as `YYYY-MM-DDTHH:MM:SS.ffffffZ`: the
|
|
37
|
+
* UTC instant of a `timestamptz`, the wall time of a `timestamp` (read as UTC,
|
|
38
|
+
* the convention Drizzle's own column mapping uses), for a caller that does
|
|
39
|
+
* not know which it has. Every branch type-checks for a text or date column
|
|
40
|
+
* too, which reads as `unsupported:<type>` and fails the page with a clear
|
|
41
|
+
* error (`hideCursorAlias`); keyset order on those would be wrong.
|
|
42
|
+
*/
|
|
43
|
+
function exactCursorRead(column) {
|
|
44
|
+
return `case pg_typeof(${column}) when 'timestamp with time zone'::regtype then to_char(CAST(${column} AS timestamptz) at time zone 'UTC', ${EXACT_FORMAT}) when 'timestamp without time zone'::regtype then to_char(CAST(${column} AS timestamp), ${EXACT_FORMAT}) else '${UNSUPPORTED}' || pg_typeof(${column})::text end`;
|
|
45
|
+
}
|
|
46
|
+
const TIMESTAMP_TYPE = /^timestamp/i;
|
|
47
|
+
/** True for a timestamp type, or an undiscovered one (`undefined`). */
|
|
48
|
+
const isTimestampType = (type) => type === void 0 || TIMESTAMP_TYPE.test(type);
|
|
49
|
+
/**
|
|
50
|
+
* Throw at construction when a column's known type cannot be a cursor. Only
|
|
51
|
+
* `timestamp` and `timestamptz` order and compare as times; `undefined` (type
|
|
52
|
+
* not discovered) is left to the read-time check.
|
|
53
|
+
*/
|
|
54
|
+
function assertTimestampCursor(label, column, type) {
|
|
55
|
+
if (!isTimestampType(type)) throw new Error(`${label}: cursorField "${column}" is ${type}; a cursor must be a timestamp or timestamptz column.`);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The rows with no position (see above), or null when the column can hold
|
|
59
|
+
* none: not nullable and not a timestamp. `timestamp` false is a Drizzle
|
|
60
|
+
* column of another type, which cannot hold `infinity`.
|
|
61
|
+
*/
|
|
62
|
+
function unpositionedPredicate(column, opts) {
|
|
63
|
+
const parts = [];
|
|
64
|
+
if (opts.nullable) parts.push(`${column} IS NULL`);
|
|
65
|
+
if (opts.timestamp) parts.push(`${column} = '-infinity'`, `${column} = 'infinity'`);
|
|
66
|
+
return parts.length === 0 ? null : `(${parts.join(" OR ")})`;
|
|
67
|
+
}
|
|
68
|
+
/** The rows with a position: what `unpositionedPredicate` leaves out. */
|
|
69
|
+
function positionedPredicate(column, opts) {
|
|
70
|
+
return opts.timestamp ? `${column} > '-infinity' AND ${column} < 'infinity'` : `${column} IS NOT NULL`;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* `since` as an untyped SQL literal. Untyped, it takes the cursor column's own
|
|
74
|
+
* type, so the comparison runs in Postgres at that type's precision, and no
|
|
75
|
+
* driver serialises a Date for it (node-postgres would send local time).
|
|
76
|
+
* Validated to plain ISO 8601 that names a real instant, so it can never
|
|
77
|
+
* carry a quote, and a value like month 99 fails here rather than in SQL.
|
|
78
|
+
*/
|
|
79
|
+
function cursorLiteral(since) {
|
|
80
|
+
const value = since.exact ?? since.time.toISOString();
|
|
81
|
+
if (!(CURSOR_LITERAL.test(value) && require_sync.isValidIsoTime(value))) throw new Error(`clivly: cursor time "${value}" is not ISO 8601 UTC.`);
|
|
82
|
+
return `'${value}'`;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Whether `since` stands among the NULL-cursor rows: the epoch with no exact
|
|
86
|
+
* value. A real row exactly at the epoch carries an exact value.
|
|
87
|
+
*/
|
|
88
|
+
function isNullGroup(since) {
|
|
89
|
+
return since.exact === void 0 && since.time.getTime() === 0;
|
|
90
|
+
}
|
|
91
|
+
/** One page in `(unpositioned rows first, then (cursor, id))` order. */
|
|
92
|
+
async function keysetPage(since, limit, reads) {
|
|
93
|
+
if (since && !isNullGroup(since)) return await reads.values({
|
|
94
|
+
id: since.id,
|
|
95
|
+
literal: cursorLiteral(since)
|
|
96
|
+
}, limit);
|
|
97
|
+
const nulls = reads.nulls ? await reads.nulls(since?.id ?? null, limit) : [];
|
|
98
|
+
if (nulls.length >= limit) return nulls;
|
|
99
|
+
return [...nulls, ...await reads.values(null, limit - nulls.length)];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Move the exact-cursor alias off each row's visible keys, so the pushed row
|
|
103
|
+
* keeps its own (possibly NULL) cursor value. The position stays on the row,
|
|
104
|
+
* non-enumerable: the exact text, or the epoch for a row with no position.
|
|
105
|
+
*/
|
|
106
|
+
function hideCursorAlias(rows) {
|
|
107
|
+
return rows.map((row) => {
|
|
108
|
+
if (!("__clivly_cursor__" in row)) return row;
|
|
109
|
+
const { [CURSOR_ALIAS]: exact, ...visible } = row;
|
|
110
|
+
if (typeof exact === "string" && exact.startsWith(UNSUPPORTED)) throw new Error(`clivly: the cursor column is ${exact.slice(12)}; a cursor must be a timestamp or timestamptz column.`);
|
|
111
|
+
if (exact === null || exact === void 0) Object.defineProperty(visible, require_sync.ROW_CURSOR_KEY, {
|
|
112
|
+
value: /* @__PURE__ */ new Date(0),
|
|
113
|
+
enumerable: false
|
|
114
|
+
});
|
|
115
|
+
else if (typeof exact === "string" && require_sync.isExactCursorTime(exact)) Object.defineProperty(visible, require_sync.ROW_EXACT_CURSOR_KEY, {
|
|
116
|
+
value: exact,
|
|
117
|
+
enumerable: false
|
|
118
|
+
});
|
|
119
|
+
return visible;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The `KeysetReads` of a raw-SQL source (`fromSql`, `fromSqlProjection`) over
|
|
124
|
+
* a timestamp cursor: the same predicates and order for both.
|
|
125
|
+
*/
|
|
126
|
+
function sqlKeysetReads(cursor, id, nullable, page) {
|
|
127
|
+
const unpositioned = unpositionedPredicate(cursor, {
|
|
128
|
+
nullable,
|
|
129
|
+
timestamp: true
|
|
130
|
+
});
|
|
131
|
+
const order = `${cursor}, ${id}`;
|
|
132
|
+
return {
|
|
133
|
+
...unpositioned === null ? {} : { nulls: (afterId, n) => afterId === null ? page(unpositioned, id, [], n) : page(`${unpositioned} AND ${id} > $1`, id, [afterId], n) },
|
|
134
|
+
values: (after, n) => after ? page(`(${cursor}, ${id}) > (${after.literal}, $1) AND ${cursor} >= ${after.literal} AND ${cursor} < 'infinity'`, order, [after.id], n) : page(positionedPredicate(cursor, { timestamp: true }), order, [], n)
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
// ../sdk/src/sql/from-sql.ts
|
|
138
|
+
const DEFAULT_CURSOR_COLUMN = "updated_at";
|
|
139
|
+
/**
|
|
140
|
+
* Whether `table` is Supabase's `auth.users`; throws for any other `auth.*`
|
|
141
|
+
* table, which holds sessions, tokens or identities and is never read.
|
|
142
|
+
*/
|
|
143
|
+
function authUsersOrRefuse(label, table) {
|
|
144
|
+
const kind = require_sync.authTableKind(table);
|
|
145
|
+
if (kind === "other") throw new Error(`${label}: "${table}" is in the auth schema and cannot be read — only ${require_sync.AUTH_USERS_TABLE} is exposed.`);
|
|
146
|
+
return kind === "users";
|
|
147
|
+
}
|
|
148
|
+
const META_COLUMN = "raw_user_meta_data";
|
|
149
|
+
const dialect = postgresDialect;
|
|
150
|
+
function inferIdField(meta, table) {
|
|
151
|
+
const primaryKeys = (meta.columnsMeta ?? []).filter((c) => c.isPrimaryKey);
|
|
152
|
+
const only = primaryKeys[0];
|
|
153
|
+
if (primaryKeys.length === 1 && only) return only.name;
|
|
154
|
+
const kind = primaryKeys.length === 0 ? "no" : "a composite";
|
|
155
|
+
throw new Error(`fromSql: table "${table}" has ${kind} single-column primary key — pass { idField } explicitly.`);
|
|
156
|
+
}
|
|
157
|
+
const quoteLiteral = (value) => `'${value.replaceAll("'", "''")}'`;
|
|
158
|
+
function narrowedMetaValue(columnSql) {
|
|
159
|
+
return `case when ${columnSql} is null then null else jsonb_strip_nulls(jsonb_build_object(${require_sync.AUTH_USERS_META_KEYS.map((key) => `${quoteLiteral(key)}, ${columnSql}->${quoteLiteral(key)}`).join(", ")})) end`;
|
|
160
|
+
}
|
|
161
|
+
function narrowedMetaExpression() {
|
|
162
|
+
const col = dialect.quoteIdent(META_COLUMN);
|
|
163
|
+
return `${narrowedMetaValue(col)} as ${col}`;
|
|
164
|
+
}
|
|
165
|
+
function selectItem(column, isAuthUsers) {
|
|
166
|
+
if (isAuthUsers && column === META_COLUMN) return narrowedMetaExpression();
|
|
167
|
+
return dialect.quoteIdent(column);
|
|
168
|
+
}
|
|
169
|
+
function normaliseValue(value) {
|
|
170
|
+
if (typeof value !== "bigint") return value;
|
|
171
|
+
const asNumber = Number(value);
|
|
172
|
+
return Number.isSafeInteger(asNumber) ? asNumber : value.toString();
|
|
173
|
+
}
|
|
174
|
+
function normaliseRows(rows) {
|
|
175
|
+
return rows.map((row) => {
|
|
176
|
+
const out = {};
|
|
177
|
+
for (const [key, value] of Object.entries(row)) out[key] = normaliseValue(value);
|
|
178
|
+
return out;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function resolveColumns(opts, isAuthUsers, required) {
|
|
182
|
+
if (isAuthUsers) return [...require_sync.AUTH_USERS_COLUMNS];
|
|
183
|
+
const base = opts.columns ?? opts.meta.columns;
|
|
184
|
+
return [.../* @__PURE__ */ new Set([...base, ...required])];
|
|
185
|
+
}
|
|
186
|
+
function assertColumn(meta, table, label, column) {
|
|
187
|
+
if (!meta.columns.includes(column)) throw new Error(`fromSql: ${label} "${column}" is not a column on "${table}".`);
|
|
188
|
+
}
|
|
189
|
+
function buildPredicate(opts, excludeAnonymous, keyset) {
|
|
190
|
+
const parts = [];
|
|
191
|
+
if (keyset) parts.push(keyset);
|
|
192
|
+
if (opts.where) parts.push(`(${opts.where})`);
|
|
193
|
+
if (excludeAnonymous) parts.push(`(${require_sync.isAnonymousFilter})`);
|
|
194
|
+
return parts.length === 0 ? "" : ` where ${parts.join(" and ")}`;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The id and cursor of every auth.users row leave the host, so each must be
|
|
198
|
+
* an allowlisted column, and never `raw_user_meta_data` (which is narrowed
|
|
199
|
+
* only when read as a field). `resolveColumns` ignores `required` for
|
|
200
|
+
* auth.users, so without this the cursor read would still reach the column.
|
|
201
|
+
*/
|
|
202
|
+
function assertAuthUsersKey(option, column) {
|
|
203
|
+
if (column === void 0 || column !== META_COLUMN && require_sync.AUTH_USERS_COLUMNS.includes(column)) return;
|
|
204
|
+
throw new Error(`fromSql: ${option} "${column}" is not allowed; auth.users only allows ${require_sync.AUTH_USERS_COLUMNS.filter((c) => c !== META_COLUMN).join(", ")} as ${option}.`);
|
|
205
|
+
}
|
|
206
|
+
function fromSql(executor, opts) {
|
|
207
|
+
const { meta, table } = opts;
|
|
208
|
+
const isAuthUsers = authUsersOrRefuse("fromSql", table);
|
|
209
|
+
const excludeAnonymous = isAuthUsers && require_sync.filtersAnonymous(meta);
|
|
210
|
+
const idField = opts.idField ?? inferIdField(meta, table);
|
|
211
|
+
assertColumn(meta, table, "idField", idField);
|
|
212
|
+
const defaultMeta = meta.columnsMeta?.find((c) => c.name === DEFAULT_CURSOR_COLUMN);
|
|
213
|
+
const cursorField = opts.cursorField ?? (meta.columns.includes(DEFAULT_CURSOR_COLUMN) && isTimestampType(defaultMeta?.type) ? DEFAULT_CURSOR_COLUMN : void 0);
|
|
214
|
+
const cursorMeta = meta.columnsMeta?.find((c) => c.name === cursorField);
|
|
215
|
+
if (cursorField !== void 0) {
|
|
216
|
+
assertColumn(meta, table, "cursorField", cursorField);
|
|
217
|
+
assertTimestampCursor("fromSql", cursorField, cursorMeta?.type);
|
|
218
|
+
}
|
|
219
|
+
if (isAuthUsers) {
|
|
220
|
+
assertAuthUsersKey("idField", idField);
|
|
221
|
+
assertAuthUsersKey("cursorField", cursorField);
|
|
222
|
+
}
|
|
223
|
+
const cursorNullable = cursorMeta?.nullable !== false;
|
|
224
|
+
const columns = resolveColumns(opts, isAuthUsers, cursorField === void 0 ? [idField] : [cursorField, idField]);
|
|
225
|
+
const items = columns.map((c) => selectItem(c, isAuthUsers));
|
|
226
|
+
if (cursorField !== void 0) items.push(`${exactCursorRead(dialect.quoteIdent(cursorField))} as ${dialect.quoteIdent(CURSOR_ALIAS)}`);
|
|
227
|
+
const head = `select ${items.join(", ")} from ${dialect.quoteTableRef(table)}`;
|
|
228
|
+
const idSql = dialect.quoteIdent(idField);
|
|
229
|
+
const page = async (keyset, order, params, limit) => {
|
|
230
|
+
const all = [...params, limit];
|
|
231
|
+
const text = `${head}${buildPredicate(opts, excludeAnonymous, keyset)} order by ${order} limit ${dialect.param(all.length)}`;
|
|
232
|
+
return normaliseRows(await executor.query(text, all));
|
|
233
|
+
};
|
|
234
|
+
const fetchIdPage = async ({ afterId, limit }) => await page(afterId === null ? null : `${idSql} > ${dialect.param(1)}`, idSql, afterId === null ? [] : [afterId], limit);
|
|
235
|
+
const fetchPage = async ({ since, limit }) => {
|
|
236
|
+
if (cursorField === void 0) return await fetchIdPage({
|
|
237
|
+
afterId: since?.id ?? null,
|
|
238
|
+
limit
|
|
239
|
+
});
|
|
240
|
+
return hideCursorAlias(await keysetPage(since, limit, sqlKeysetReads(dialect.quoteIdent(cursorField), idSql, cursorNullable, page)));
|
|
241
|
+
};
|
|
242
|
+
const source = {
|
|
243
|
+
entity: opts.entity,
|
|
244
|
+
...opts.pushSource === void 0 ? {} : { pushSource: opts.pushSource },
|
|
245
|
+
cursorField: cursorField ?? idField,
|
|
246
|
+
idField,
|
|
247
|
+
...cursorField === void 0 ? { mode: "full" } : {},
|
|
248
|
+
fetchPage,
|
|
249
|
+
fetchIdPage,
|
|
250
|
+
...opts.objectType === void 0 ? {} : { objectType: opts.objectType }
|
|
251
|
+
};
|
|
252
|
+
const sourceMeta = {
|
|
253
|
+
kind: "sql",
|
|
254
|
+
columnKeys: columns,
|
|
255
|
+
columnsMeta: meta.columnsMeta,
|
|
256
|
+
cursorField: cursorField ?? idField,
|
|
257
|
+
idField,
|
|
258
|
+
tableName: table,
|
|
259
|
+
...meta.uniqueConstraints === void 0 ? {} : { uniqueConstraints: meta.uniqueConstraints }
|
|
260
|
+
};
|
|
261
|
+
Object.defineProperty(source, require_sync.DRIZZLE_META, {
|
|
262
|
+
value: sourceMeta,
|
|
263
|
+
enumerable: false
|
|
264
|
+
});
|
|
265
|
+
return source;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Whether `fromSql` would sync at least one row for `table`: one
|
|
269
|
+
* `exists(... limit 1)` under `buildPredicate`, the predicate every page query
|
|
270
|
+
* uses, so the `auth.users` anonymous exclusion cannot drift. The projection
|
|
271
|
+
* path (`baseGuard` in projection.ts) applies the same `isAnonymousFilter`;
|
|
272
|
+
* keep the two in step. A boolean on purpose: `/clivly/connect` is a public GET,
|
|
273
|
+
* so it must not reveal how many users exist or run a full count.
|
|
274
|
+
*/
|
|
275
|
+
async function existsFromSql(executor, opts) {
|
|
276
|
+
const isAuthUsers = authUsersOrRefuse("existsFromSql", opts.table);
|
|
277
|
+
const predicate = buildPredicate({ where: opts.where }, isAuthUsers && opts.filterAnonymous !== false, null);
|
|
278
|
+
const text = `select exists(select 1 from ${dialect.quoteTableRef(opts.table)}${predicate} limit 1) as present`;
|
|
279
|
+
const [row] = await executor.query(text, []);
|
|
280
|
+
return row?.present === true;
|
|
281
|
+
}
|
|
282
|
+
Object.defineProperty(exports, "CURSOR_ALIAS", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function() {
|
|
285
|
+
return CURSOR_ALIAS;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
Object.defineProperty(exports, "EXACT_FORMAT", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function() {
|
|
291
|
+
return EXACT_FORMAT;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
Object.defineProperty(exports, "exactCursorRead", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function() {
|
|
297
|
+
return exactCursorRead;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(exports, "existsFromSql", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function() {
|
|
303
|
+
return existsFromSql;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
Object.defineProperty(exports, "fromSql", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function() {
|
|
309
|
+
return fromSql;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, "hideCursorAlias", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function() {
|
|
315
|
+
return hideCursorAlias;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
Object.defineProperty(exports, "keysetPage", {
|
|
319
|
+
enumerable: true,
|
|
320
|
+
get: function() {
|
|
321
|
+
return keysetPage;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(exports, "narrowedMetaValue", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function() {
|
|
327
|
+
return narrowedMetaValue;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
Object.defineProperty(exports, "normaliseRows", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
get: function() {
|
|
333
|
+
return normaliseRows;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
Object.defineProperty(exports, "postgresDialect", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function() {
|
|
339
|
+
return postgresDialect;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(exports, "sqlKeysetReads", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function() {
|
|
345
|
+
return sqlKeysetReads;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { m as DiscoveredSchemaTable } from "./entity-config-CXpGowQa.mjs";
|
|
2
|
+
import { x as SyncSource } from "./namespace-probe-CUR2zG2l.mjs";
|
|
3
|
+
/** The one raw-SQL seam: every host driver is adapted to this. */
|
|
4
|
+
interface SqlExecutor {
|
|
5
|
+
query(text: string, params?: readonly unknown[]): Promise<Record<string, unknown>[]>;
|
|
6
|
+
}
|
|
7
|
+
interface PgLikeClient {
|
|
8
|
+
query(text: string, params?: unknown[]): Promise<{
|
|
9
|
+
rows: Record<string, unknown>[];
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
interface PostgresJsLike {
|
|
13
|
+
unsafe(text: string, params?: unknown[]): Promise<unknown[]>;
|
|
14
|
+
}
|
|
15
|
+
/** Covers pg.Pool, pg.Client and PGlite. */
|
|
16
|
+
declare function pgExecutor(client: PgLikeClient): SqlExecutor;
|
|
17
|
+
declare function postgresJsExecutor(sql: PostgresJsLike): SqlExecutor;
|
|
18
|
+
/**
|
|
19
|
+
* The postgres.js factory is injected so the SDK takes no dependency on it.
|
|
20
|
+
* `prepare: false` keeps it working behind transaction-mode poolers.
|
|
21
|
+
*/
|
|
22
|
+
declare function connectPostgresJs(url: string, postgres: (url: string, opts: {
|
|
23
|
+
prepare: false;
|
|
24
|
+
max: number;
|
|
25
|
+
}) => unknown): SqlExecutor;
|
|
26
|
+
interface FromSqlOptions {
|
|
27
|
+
/** Columns to read; defaults to every column. Ignored for `auth.users`. */
|
|
28
|
+
columns?: string[];
|
|
29
|
+
/** Column holding when a row changed; defaults to `updated_at` when present. */
|
|
30
|
+
cursorField?: string;
|
|
31
|
+
entity: string;
|
|
32
|
+
/** Unique tie-breaker column; defaults to the table's single-column PK. */
|
|
33
|
+
idField?: string;
|
|
34
|
+
/** This table's entry from `discoverFromSql`. */
|
|
35
|
+
meta: DiscoveredSchemaTable;
|
|
36
|
+
objectType?: string;
|
|
37
|
+
pushSource?: string;
|
|
38
|
+
table: string;
|
|
39
|
+
/** A trusted SQL predicate ANDed into every page query. */
|
|
40
|
+
where?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The raw-SQL twin of `fromDrizzle`: a keyset-paginated `SyncSource` over one
|
|
44
|
+
* table, for apps with no ORM. Read-only. With no cursor column the source
|
|
45
|
+
* pages by id alone and reports `mode: "full"`.
|
|
46
|
+
*/
|
|
47
|
+
declare function fromSql(executor: SqlExecutor, opts: FromSqlOptions & {
|
|
48
|
+
objectType: string;
|
|
49
|
+
}): SyncSource & {
|
|
50
|
+
objectType: string;
|
|
51
|
+
};
|
|
52
|
+
declare function fromSql(executor: SqlExecutor, opts: FromSqlOptions): SyncSource;
|
|
53
|
+
/**
|
|
54
|
+
* Whether `fromSql` would sync at least one row for `table`: one
|
|
55
|
+
* `exists(... limit 1)` under `buildPredicate`, the predicate every page query
|
|
56
|
+
* uses, so the `auth.users` anonymous exclusion cannot drift. The projection
|
|
57
|
+
* path (`baseGuard` in projection.ts) applies the same `isAnonymousFilter`;
|
|
58
|
+
* keep the two in step. A boolean on purpose: `/clivly/connect` is a public GET,
|
|
59
|
+
* so it must not reveal how many users exist or run a full count.
|
|
60
|
+
*/
|
|
61
|
+
declare function existsFromSql(executor: SqlExecutor, opts: {
|
|
62
|
+
/**
|
|
63
|
+
* False when `auth.users` has no `is_anonymous` column: pass
|
|
64
|
+
* `filtersAnonymous(meta)` for discovery's entry. Defaults to true.
|
|
65
|
+
*/
|
|
66
|
+
filterAnonymous?: boolean;
|
|
67
|
+
table: string;
|
|
68
|
+
where?: string;
|
|
69
|
+
}): Promise<boolean>;
|
|
70
|
+
export { connectPostgresJs as a, SqlExecutor as i, existsFromSql as n, pgExecutor as o, fromSql as r, postgresJsExecutor as s, FromSqlOptions as t };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { m as DiscoveredSchemaTable } from "./entity-config-CXpGowQa.cjs";
|
|
2
|
+
import { b as SyncSource } from "./types-CzL7lUH9.cjs";
|
|
3
|
+
/** The one raw-SQL seam: every host driver is adapted to this. */
|
|
4
|
+
interface SqlExecutor {
|
|
5
|
+
query(text: string, params?: readonly unknown[]): Promise<Record<string, unknown>[]>;
|
|
6
|
+
}
|
|
7
|
+
interface PgLikeClient {
|
|
8
|
+
query(text: string, params?: unknown[]): Promise<{
|
|
9
|
+
rows: Record<string, unknown>[];
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
interface PostgresJsLike {
|
|
13
|
+
unsafe(text: string, params?: unknown[]): Promise<unknown[]>;
|
|
14
|
+
}
|
|
15
|
+
/** Covers pg.Pool, pg.Client and PGlite. */
|
|
16
|
+
declare function pgExecutor(client: PgLikeClient): SqlExecutor;
|
|
17
|
+
declare function postgresJsExecutor(sql: PostgresJsLike): SqlExecutor;
|
|
18
|
+
/**
|
|
19
|
+
* The postgres.js factory is injected so the SDK takes no dependency on it.
|
|
20
|
+
* `prepare: false` keeps it working behind transaction-mode poolers.
|
|
21
|
+
*/
|
|
22
|
+
declare function connectPostgresJs(url: string, postgres: (url: string, opts: {
|
|
23
|
+
prepare: false;
|
|
24
|
+
max: number;
|
|
25
|
+
}) => unknown): SqlExecutor;
|
|
26
|
+
interface FromSqlOptions {
|
|
27
|
+
/** Columns to read; defaults to every column. Ignored for `auth.users`. */
|
|
28
|
+
columns?: string[];
|
|
29
|
+
/** Column holding when a row changed; defaults to `updated_at` when present. */
|
|
30
|
+
cursorField?: string;
|
|
31
|
+
entity: string;
|
|
32
|
+
/** Unique tie-breaker column; defaults to the table's single-column PK. */
|
|
33
|
+
idField?: string;
|
|
34
|
+
/** This table's entry from `discoverFromSql`. */
|
|
35
|
+
meta: DiscoveredSchemaTable;
|
|
36
|
+
objectType?: string;
|
|
37
|
+
pushSource?: string;
|
|
38
|
+
table: string;
|
|
39
|
+
/** A trusted SQL predicate ANDed into every page query. */
|
|
40
|
+
where?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The raw-SQL twin of `fromDrizzle`: a keyset-paginated `SyncSource` over one
|
|
44
|
+
* table, for apps with no ORM. Read-only. With no cursor column the source
|
|
45
|
+
* pages by id alone and reports `mode: "full"`.
|
|
46
|
+
*/
|
|
47
|
+
declare function fromSql(executor: SqlExecutor, opts: FromSqlOptions & {
|
|
48
|
+
objectType: string;
|
|
49
|
+
}): SyncSource & {
|
|
50
|
+
objectType: string;
|
|
51
|
+
};
|
|
52
|
+
declare function fromSql(executor: SqlExecutor, opts: FromSqlOptions): SyncSource;
|
|
53
|
+
/**
|
|
54
|
+
* Whether `fromSql` would sync at least one row for `table`: one
|
|
55
|
+
* `exists(... limit 1)` under `buildPredicate`, the predicate every page query
|
|
56
|
+
* uses, so the `auth.users` anonymous exclusion cannot drift. The projection
|
|
57
|
+
* path (`baseGuard` in projection.ts) applies the same `isAnonymousFilter`;
|
|
58
|
+
* keep the two in step. A boolean on purpose: `/clivly/connect` is a public GET,
|
|
59
|
+
* so it must not reveal how many users exist or run a full count.
|
|
60
|
+
*/
|
|
61
|
+
declare function existsFromSql(executor: SqlExecutor, opts: {
|
|
62
|
+
/**
|
|
63
|
+
* False when `auth.users` has no `is_anonymous` column: pass
|
|
64
|
+
* `filtersAnonymous(meta)` for discovery's entry. Defaults to true.
|
|
65
|
+
*/
|
|
66
|
+
filterAnonymous?: boolean;
|
|
67
|
+
table: string;
|
|
68
|
+
where?: string;
|
|
69
|
+
}): Promise<boolean>;
|
|
70
|
+
export { connectPostgresJs as a, SqlExecutor as i, existsFromSql as n, pgExecutor as o, fromSql as r, postgresJsExecutor as s, FromSqlOptions as t };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { n as AppIdStore, t as NamespaceIntrospector, x as SyncSource } from "./namespace-probe-CUR2zG2l.mjs";
|
|
2
|
+
import { i as SqlExecutor } from "./from-sql-CpGP7K3J.mjs";
|
|
3
|
+
import { R as ProjectionMapping, m as DiscoveredSchemaTable, z as ProjectionRef } from "./entity-config-CXpGowQa.mjs";
|
|
4
|
+
import "./index-DOoX2GgI.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* The raw-SQL twin of `drizzleAppIdStore`: an `AppIdStore` backed by a
|
|
7
|
+
* one-row `crm_clivly_app` table, created on first use. The only write Clivly
|
|
8
|
+
* ever makes to a host database.
|
|
9
|
+
*/
|
|
10
|
+
declare function sqlAppIdStore(executor: SqlExecutor): AppIdStore;
|
|
11
|
+
interface DiscoverFromSqlOptions {
|
|
12
|
+
/** Defaults to `[current_schema()]`. */
|
|
13
|
+
includeAuthUsers?: boolean;
|
|
14
|
+
schemas?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The raw-SQL twin of `discoverFromDrizzle`: reads Postgres catalogs and
|
|
18
|
+
* returns the same `DiscoveredSchemaTable[]` shape. Names are unqualified in
|
|
19
|
+
* the default schema and `schema.table` elsewhere. `auth.users` is reported
|
|
20
|
+
* with only its allowlisted columns; every other `auth.*` table is omitted.
|
|
21
|
+
*/
|
|
22
|
+
declare function discoverFromSql(executor: SqlExecutor, opts?: DiscoverFromSqlOptions): Promise<DiscoveredSchemaTable[]>;
|
|
23
|
+
/**
|
|
24
|
+
* The raw-SQL twin of `drizzleIntrospector`, for apps with no ORM.
|
|
25
|
+
* Read-only: every statement here is a SELECT.
|
|
26
|
+
*/
|
|
27
|
+
declare function sqlIntrospector(executor: SqlExecutor): NamespaceIntrospector;
|
|
28
|
+
interface FromSqlProjectionOptions {
|
|
29
|
+
/** The base table's primary key, for a `base_pk` identity with no column. */
|
|
30
|
+
basePkColumn?: string;
|
|
31
|
+
/**
|
|
32
|
+
* A cursor computed from several columns, in place of `cursorField`. For
|
|
33
|
+
* the SDK's own sources only (the Supabase contact source pages on the
|
|
34
|
+
* later of two stamps): the SQL is trusted and inlined, never built from a
|
|
35
|
+
* cloud-authored projection. Every ref it reads must be listed in `refs`,
|
|
36
|
+
* which are checked like any other ref.
|
|
37
|
+
*/
|
|
38
|
+
cursorExpression?: CursorExpression;
|
|
39
|
+
/**
|
|
40
|
+
* The column to keyset-paginate on, as a ref token (`"base.updated_at"`) or
|
|
41
|
+
* a `ProjectionRef`. Omit it to page by identity alone (full snapshot).
|
|
42
|
+
*/
|
|
43
|
+
cursorField?: string | ProjectionRef;
|
|
44
|
+
/**
|
|
45
|
+
* False when the cursor column is NOT NULL (and on the base table, or an
|
|
46
|
+
* inner join), which skips the read of NULL-cursor rows. A projection
|
|
47
|
+
* carries no column metadata, so it defaults to true.
|
|
48
|
+
*/
|
|
49
|
+
cursorNullable?: boolean;
|
|
50
|
+
entity: string;
|
|
51
|
+
/**
|
|
52
|
+
* False when `auth.users` has no `is_anonymous` column (Supabase Auth
|
|
53
|
+
* before 2024): pass `filtersAnonymous(meta)` for discovery's entry.
|
|
54
|
+
* Defaults to true, which excludes anonymous sign-ins.
|
|
55
|
+
*/
|
|
56
|
+
excludeAnonymous?: boolean;
|
|
57
|
+
objectType: string;
|
|
58
|
+
}
|
|
59
|
+
interface CursorExpression {
|
|
60
|
+
/**
|
|
61
|
+
* The value pushed under `field`; may be NULL. Defaults to `order`. Cast
|
|
62
|
+
* to timestamptz and read back as UTC, as a column cursor's is.
|
|
63
|
+
*/
|
|
64
|
+
display?: string;
|
|
65
|
+
/** The key the pushed value is written under: the source's `cursorField`. */
|
|
66
|
+
field: string;
|
|
67
|
+
/** False when `order` can never be NULL, which skips the NULL-cursor read. */
|
|
68
|
+
nullable: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* What rows are ordered, compared and positioned on. Must evaluate to one
|
|
71
|
+
* type (cast a `timestamp` to `timestamptz`, which reads it in the
|
|
72
|
+
* session's TimeZone, before mixing the two). Inlined, parenthesised,
|
|
73
|
+
* everywhere.
|
|
74
|
+
*/
|
|
75
|
+
order: string;
|
|
76
|
+
/** Every column the expressions read. */
|
|
77
|
+
refs: ProjectionRef[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The raw-SQL twin of `fromDrizzleProjection`: a `SyncSource` that executes a
|
|
81
|
+
* projection's joins. Rows are keyed by ref token. Read-only. Without a
|
|
82
|
+
* `cursorField` it pages by identity and reports `mode: "full"`.
|
|
83
|
+
*/
|
|
84
|
+
declare function fromSqlProjection(executor: SqlExecutor, projection: ProjectionMapping, opts: FromSqlProjectionOptions): SyncSource & {
|
|
85
|
+
objectType: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Whether reads of `auth.users` should exclude anonymous sign-ins. False only
|
|
89
|
+
* when discovery saw no `is_anonymous` column (Supabase Auth before 2024, so
|
|
90
|
+
* no anonymous sign-ins exist to exclude): filtering on it there would fail
|
|
91
|
+
* every page with "column does not exist". A table entry discovery did not
|
|
92
|
+
* build (no mark) still filters, the safe default.
|
|
93
|
+
*/
|
|
94
|
+
declare function filtersAnonymous(table: DiscoveredSchemaTable | undefined): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The flat column every Supabase contact row carries for the person's name:
|
|
97
|
+
* the profile's `full_name` (or `name`) when `public.profiles` joins, else
|
|
98
|
+
* `raw_user_meta_data.full_name` (or `.name`). Map a contact's `name` to it.
|
|
99
|
+
*/
|
|
100
|
+
declare const SUPABASE_CONTACT_NAME_COLUMN = "full_name";
|
|
101
|
+
interface SupabaseContactOptions {
|
|
102
|
+
/**
|
|
103
|
+
* The cursor-store key and push label. Defaults to the table name, which is
|
|
104
|
+
* what a declared entity's `source:` and a preview's draft name match.
|
|
105
|
+
*/
|
|
106
|
+
entity?: string;
|
|
107
|
+
/** False skips the `public.profiles` join even when it qualifies. */
|
|
108
|
+
joinProfiles?: boolean;
|
|
109
|
+
/** The contact table. Defaults to `auth.users`. */
|
|
110
|
+
table?: string;
|
|
111
|
+
}
|
|
112
|
+
interface SupabaseContactSource {
|
|
113
|
+
/**
|
|
114
|
+
* The schema to hand the SDK: the input, with the contact table advertising
|
|
115
|
+
* the flat shape its rows are pushed in (profile columns, `full_name`).
|
|
116
|
+
*/
|
|
117
|
+
schema: DiscoveredSchemaTable[];
|
|
118
|
+
source: SyncSource;
|
|
119
|
+
/** The contact table every push and the heartbeat name. */
|
|
120
|
+
table: string;
|
|
121
|
+
}
|
|
122
|
+
/** The contact table named in options is not in the discovered schema. */
|
|
123
|
+
declare class ContactTableMissing extends Error {
|
|
124
|
+
constructor(table: string);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The contact source for a Supabase app, from `discoverFromSql`'s tables.
|
|
128
|
+
* `auth.users` (the default) joins `public.profiles` on `id` when that table
|
|
129
|
+
* qualifies, and every row carries a flat `full_name` (see
|
|
130
|
+
* `SUPABASE_CONTACT_NAME_COLUMN`). Any other table is read as-is by `fromSql`.
|
|
131
|
+
* Throws `ContactTableMissing` when the table is not in `tables`.
|
|
132
|
+
*/
|
|
133
|
+
declare function supabaseContactSource(executor: SqlExecutor, tables: DiscoveredSchemaTable[], opts?: SupabaseContactOptions): SupabaseContactSource;
|
|
134
|
+
export { supabaseContactSource as a, sqlIntrospector as c, SupabaseContactSource as i, discoverFromSql as l, SUPABASE_CONTACT_NAME_COLUMN as n, filtersAnonymous as o, SupabaseContactOptions as r, fromSqlProjection as s, ContactTableMissing as t, sqlAppIdStore as u };
|