@rebasepro/server-postgres 0.12.1-canary.gdfba2a1 → 0.12.1-canary.gf5f1d39
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/dist/auth/services.d.ts +0 -16
- package/dist/chunk-DSJWtz9O.js +40 -0
- package/dist/{ensure-collection-tables-CIHSH962.js → ensure-collection-tables-CNTcZGvn.js} +5 -5
- package/dist/ensure-collection-tables-CNTcZGvn.js.map +1 -0
- package/dist/index.es.js +9629 -379
- package/dist/index.es.js.map +1 -1
- package/dist/schema/auth-schema.d.ts +144 -83
- package/dist/{src-DihrDFuP.js → src-BbFOPJ1S.js} +150 -160
- package/dist/src-BbFOPJ1S.js.map +1 -0
- package/dist/{src-DoU9yPqq.js → src-Zqwaw3P5.js} +159 -3
- package/dist/src-Zqwaw3P5.js.map +1 -0
- package/package.json +14 -14
- package/src/auth/ensure-tables.ts +9 -164
- package/src/auth/services.ts +2 -21
- package/src/schema/auth-schema.ts +19 -30
- package/src/schema/generate-drizzle-schema-logic.ts +3 -7
- package/src/schema/generate-postgres-ddl-logic.ts +3 -7
- package/dist/backup-service-DH9kPg-E.js +0 -8866
- package/dist/backup-service-DH9kPg-E.js.map +0 -1
- package/dist/connection-B5Wndbr1.js +0 -196
- package/dist/connection-B5Wndbr1.js.map +0 -1
- package/dist/ensure-collection-tables-CIHSH962.js.map +0 -1
- package/dist/src-DihrDFuP.js.map +0 -1
- package/dist/src-DoU9yPqq.js.map +0 -1
- package/dist/websocket-BKcGvILX.js +0 -528
- package/dist/websocket-BKcGvILX.js.map +0 -1
|
@@ -1,135 +1,8 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from "module";
|
|
2
2
|
import "process";
|
|
3
3
|
__createRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
//#region ../types/src/types/entities.ts
|
|
7
|
-
/**
|
|
8
|
-
* Class used to create a reference to a entity in a different path
|
|
9
|
-
*/
|
|
10
|
-
var EntityRelation = class {
|
|
11
|
-
__type = "relation";
|
|
12
|
-
/**
|
|
13
|
-
* ID of the entity
|
|
14
|
-
*/
|
|
15
|
-
id;
|
|
16
|
-
/**
|
|
17
|
-
* A string representing the path of the referenced document (relative
|
|
18
|
-
* to the root of the database).
|
|
19
|
-
*/
|
|
20
|
-
path;
|
|
21
|
-
/**
|
|
22
|
-
* Pre-fetched data payload to eliminate N+1 queries.
|
|
23
|
-
* When present, clients can use this directly instead of fetching.
|
|
24
|
-
*/
|
|
25
|
-
data;
|
|
26
|
-
constructor(id, path, data) {
|
|
27
|
-
this.id = id;
|
|
28
|
-
this.path = path;
|
|
29
|
-
this.data = data;
|
|
30
|
-
}
|
|
31
|
-
get pathWithId() {
|
|
32
|
-
return `${this.path}/${this.id}`;
|
|
33
|
-
}
|
|
34
|
-
isEntityReference() {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
isEntityRelation() {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var Vector = class {
|
|
42
|
-
value;
|
|
43
|
-
constructor(value) {
|
|
44
|
-
this.value = value;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region ../types/src/types/relations.ts
|
|
49
|
-
/** @group Models */
|
|
50
|
-
function hasForeignKeyOnTarget(relation) {
|
|
51
|
-
return relation.kind === "hasOne" || relation.kind === "hasMany";
|
|
52
|
-
}
|
|
53
|
-
/** @group Models */
|
|
54
|
-
function isManyToMany(relation) {
|
|
55
|
-
return relation.kind === "manyToMany";
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region ../types/src/types/policy.ts
|
|
59
|
-
/**
|
|
60
|
-
* The id a request without a logged-in user reports as `auth.uid()`.
|
|
61
|
-
*
|
|
62
|
-
* A user-context request always sets `app.uid`: blank would read back as
|
|
63
|
-
* `NULL`, and `NULL` is how the trusted server context is recognised, so an
|
|
64
|
-
* anonymous visitor would be promoted to server privileges. The driver
|
|
65
|
-
* therefore substitutes this sentinel at the single chokepoint where the GUC
|
|
66
|
-
* is set.
|
|
67
|
-
*
|
|
68
|
-
* The consequence for policy authors is that **`auth.uid() IS NOT NULL` is a
|
|
69
|
-
* tautology on the user path** — it is true for anonymous visitors too. Use
|
|
70
|
-
* {@link policy.authenticated} (or `auth.uid() <> 'anonymous'`) to mean "signed
|
|
71
|
-
* in", and {@link policy.serverContext} to mean "the trusted server context".
|
|
72
|
-
*
|
|
73
|
-
* @group Models
|
|
74
|
-
*/
|
|
75
|
-
var ANONYMOUS_USER_ID = "anonymous";
|
|
76
|
-
/** @group Models */
|
|
77
|
-
var policy = {
|
|
78
|
-
true: () => ({ kind: "true" }),
|
|
79
|
-
false: () => ({ kind: "false" }),
|
|
80
|
-
and: (...operands) => ({
|
|
81
|
-
kind: "and",
|
|
82
|
-
operands
|
|
83
|
-
}),
|
|
84
|
-
or: (...operands) => ({
|
|
85
|
-
kind: "or",
|
|
86
|
-
operands
|
|
87
|
-
}),
|
|
88
|
-
not: (operand) => ({
|
|
89
|
-
kind: "not",
|
|
90
|
-
operand
|
|
91
|
-
}),
|
|
92
|
-
compare: (left, op, right) => ({
|
|
93
|
-
kind: "compare",
|
|
94
|
-
op,
|
|
95
|
-
left,
|
|
96
|
-
right
|
|
97
|
-
}),
|
|
98
|
-
rolesOverlap: (roles) => ({
|
|
99
|
-
kind: "rolesOverlap",
|
|
100
|
-
roles
|
|
101
|
-
}),
|
|
102
|
-
rolesContain: (roles) => ({
|
|
103
|
-
kind: "rolesContain",
|
|
104
|
-
roles
|
|
105
|
-
}),
|
|
106
|
-
authenticated: () => ({ kind: "authenticated" }),
|
|
107
|
-
serverContext: () => ({ kind: "serverContext" }),
|
|
108
|
-
existsIn: (args) => ({
|
|
109
|
-
kind: "existsIn",
|
|
110
|
-
collection: args.collection,
|
|
111
|
-
where: args.where
|
|
112
|
-
}),
|
|
113
|
-
raw: (sql) => ({
|
|
114
|
-
kind: "raw",
|
|
115
|
-
sql
|
|
116
|
-
}),
|
|
117
|
-
field: (name) => ({
|
|
118
|
-
kind: "field",
|
|
119
|
-
name
|
|
120
|
-
}),
|
|
121
|
-
outerField: (name) => ({
|
|
122
|
-
kind: "outerField",
|
|
123
|
-
name
|
|
124
|
-
}),
|
|
125
|
-
literal: (value) => ({
|
|
126
|
-
kind: "literal",
|
|
127
|
-
value
|
|
128
|
-
}),
|
|
129
|
-
authUid: () => ({ kind: "authUid" }),
|
|
130
|
-
authRoles: () => ({ kind: "authRoles" })
|
|
131
|
-
};
|
|
132
|
-
//#endregion
|
|
4
|
+
import { r as __require, t as __commonJSMin } from "./chunk-DSJWtz9O.js";
|
|
5
|
+
import { a as policy, c as getDeclaredSubcollections, f as getDataSourceCapabilities, g as EntityRelation, h as toCanonicalOp, i as ANONYMOUS_USER_ID, l as isPostgresCollectionConfig, m as REST_TO_CANONICAL, p as NULL_OPS, s as isManyToMany, u as isRelationalCollectionConfig } from "./src-Zqwaw3P5.js";
|
|
133
6
|
//#region ../common/src/util/common.ts
|
|
134
7
|
var DEFAULT_ONE_OF_TYPE = "type";
|
|
135
8
|
var DEFAULT_ONE_OF_VALUE = "value";
|
|
@@ -2143,6 +2016,75 @@ function rolesArraySql(roles) {
|
|
|
2143
2016
|
return `ARRAY[${[...roles].sort().map((r) => `'${r}'`).join(",")}]`;
|
|
2144
2017
|
}
|
|
2145
2018
|
//#endregion
|
|
2019
|
+
//#region ../common/src/util/callbacks.ts
|
|
2020
|
+
/**
|
|
2021
|
+
* Helper function to recursively check if there are any callbacks in the properties.
|
|
2022
|
+
*/
|
|
2023
|
+
function hasPropertyCallbacks(properties, callbackName) {
|
|
2024
|
+
if (!properties) return false;
|
|
2025
|
+
for (const property of Object.values(properties)) {
|
|
2026
|
+
if (property.callbacks?.[callbackName]) return true;
|
|
2027
|
+
if (property.type === "map" && property.properties) {
|
|
2028
|
+
if (hasPropertyCallbacks(property.properties, callbackName)) return true;
|
|
2029
|
+
} else if (property.type === "array" && property.of) {
|
|
2030
|
+
const ofs = Array.isArray(property.of) ? property.of : [property.of];
|
|
2031
|
+
for (const of of ofs) {
|
|
2032
|
+
if (of.callbacks?.[callbackName]) return true;
|
|
2033
|
+
if (of.type === "map" && of.properties && hasPropertyCallbacks(of.properties, callbackName)) return true;
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
return false;
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Recursively process properties to apply field-level hooks.
|
|
2041
|
+
*/
|
|
2042
|
+
async function processProperties(properties, values, previousValues, propsContext, callbackName) {
|
|
2043
|
+
if (!values || typeof values !== "object") return values;
|
|
2044
|
+
const result = { ...values };
|
|
2045
|
+
for (const [key, property] of Object.entries(properties)) {
|
|
2046
|
+
if (result[key] === void 0) continue;
|
|
2047
|
+
let currentValue = result[key];
|
|
2048
|
+
const previousValue = previousValues?.[key];
|
|
2049
|
+
if (property.type === "array" && Array.isArray(currentValue)) {
|
|
2050
|
+
if (property.of && !Array.isArray(property.of)) currentValue = await Promise.all(currentValue.map(async (item, index) => {
|
|
2051
|
+
const prevItem = Array.isArray(previousValue) ? previousValue[index] : void 0;
|
|
2052
|
+
return (await processProperties({ "_tmp": property.of }, { "_tmp": item }, { "_tmp": prevItem }, propsContext, callbackName))["_tmp"];
|
|
2053
|
+
}));
|
|
2054
|
+
} else if (property.type === "map" && property.properties && typeof currentValue === "object") currentValue = await processProperties(property.properties, currentValue, previousValue ?? {}, propsContext, callbackName);
|
|
2055
|
+
if (property.callbacks?.[callbackName]) {
|
|
2056
|
+
const cbRes = await Promise.resolve(property.callbacks[callbackName]({
|
|
2057
|
+
...propsContext,
|
|
2058
|
+
value: currentValue,
|
|
2059
|
+
previousValue
|
|
2060
|
+
}));
|
|
2061
|
+
if (cbRes !== void 0) currentValue = cbRes;
|
|
2062
|
+
}
|
|
2063
|
+
result[key] = currentValue;
|
|
2064
|
+
}
|
|
2065
|
+
return result;
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Helper function to extract field-level PropertyCallbacks from a properties schema
|
|
2069
|
+
* and wrap them into an CollectionCallbacks object recursively.
|
|
2070
|
+
*/
|
|
2071
|
+
var buildPropertyCallbacks = (properties) => {
|
|
2072
|
+
if (!properties) return void 0;
|
|
2073
|
+
const propertyCallbacks = {};
|
|
2074
|
+
if (hasPropertyCallbacks(properties, "afterRead")) propertyCallbacks.afterRead = async (props) => {
|
|
2075
|
+
const row = props.row;
|
|
2076
|
+
const processedValues = await processProperties(properties, row, row, props, "afterRead");
|
|
2077
|
+
return {
|
|
2078
|
+
...props.row,
|
|
2079
|
+
...processedValues
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
if (hasPropertyCallbacks(properties, "beforeSave")) propertyCallbacks.beforeSave = async (props) => {
|
|
2083
|
+
return await processProperties(properties, props.values, props.previousValues ?? {}, props, "beforeSave");
|
|
2084
|
+
};
|
|
2085
|
+
return Object.keys(propertyCallbacks).length > 0 ? propertyCallbacks : void 0;
|
|
2086
|
+
};
|
|
2087
|
+
//#endregion
|
|
2146
2088
|
//#region ../common/src/util/auth-default-policies.ts
|
|
2147
2089
|
/**
|
|
2148
2090
|
* Default RLS policies injected by the schema generator.
|
|
@@ -2717,27 +2659,10 @@ function getJunctionSecurityRules(spec) {
|
|
|
2717
2659
|
});
|
|
2718
2660
|
})))();
|
|
2719
2661
|
/**
|
|
2720
|
-
*
|
|
2721
|
-
*
|
|
2722
|
-
* One definition, three call sites, because they used to disagree. For the same
|
|
2723
|
-
* `columnType: "varchar"` property the DDL generator emitted `VARCHAR(255)`
|
|
2724
|
-
* while the Drizzle generator emitted a bare `varchar("col")` — which Postgres
|
|
2725
|
-
* reads as *unbounded* — so which of the two you ran decided whether the column
|
|
2726
|
-
* had a limit at all. Introspection then dropped the length entirely, so reading
|
|
2727
|
-
* an existing `character varying(500)` column back and regenerating it produced
|
|
2728
|
-
* a `VARCHAR(255)`: a silent narrowing of a column with data already in it.
|
|
2729
|
-
*
|
|
2730
|
-
* `validation.max` is the property's own statement about how long the value may
|
|
2731
|
-
* be, so it is the only sensible source for the column's width — and it keeps
|
|
2732
|
-
* the constraint the database enforces in step with the one the app enforces,
|
|
2733
|
-
* rather than inventing a second, different limit underneath it.
|
|
2662
|
+
* Apply PropertyConditions to a resolved property, evaluating all JSON Logic rules.
|
|
2734
2663
|
*/
|
|
2735
|
-
function resolveStringColumnLength(prop) {
|
|
2736
|
-
const max = prop.validation?.max;
|
|
2737
|
-
return typeof max === "number" && Number.isInteger(max) && max > 0 ? max : 255;
|
|
2738
|
-
}
|
|
2739
2664
|
//#endregion
|
|
2740
|
-
//#region ../../node_modules/.pnpm/fast-equals@6.0.
|
|
2665
|
+
//#region ../../node_modules/.pnpm/fast-equals@6.0.0/node_modules/fast-equals/dist/es/index.mjs
|
|
2741
2666
|
var { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
2742
2667
|
var { hasOwnProperty } = Object.prototype;
|
|
2743
2668
|
/**
|
|
@@ -2773,8 +2698,7 @@ function createIsCircular(areItemsEqual) {
|
|
|
2773
2698
|
* not enumerable and symbol properties.
|
|
2774
2699
|
*/
|
|
2775
2700
|
function getStrictProperties(object) {
|
|
2776
|
-
|
|
2777
|
-
return symbols.length ? getOwnPropertyNames(object).concat(symbols) : getOwnPropertyNames(object);
|
|
2701
|
+
return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
|
|
2778
2702
|
}
|
|
2779
2703
|
/**
|
|
2780
2704
|
* Whether the object contains the property passed as an own property.
|
|
@@ -2847,7 +2771,7 @@ function areMapsEqual(a, b, state) {
|
|
|
2847
2771
|
const size = a.size;
|
|
2848
2772
|
if (size !== b.size) return false;
|
|
2849
2773
|
if (!size) return true;
|
|
2850
|
-
const matchedIndices = new
|
|
2774
|
+
const matchedIndices = new Array(size);
|
|
2851
2775
|
const aIterable = a.entries();
|
|
2852
2776
|
let aResult;
|
|
2853
2777
|
let bResult;
|
|
@@ -2855,7 +2779,7 @@ function areMapsEqual(a, b, state) {
|
|
|
2855
2779
|
while (aResult = aIterable.next()) {
|
|
2856
2780
|
if (aResult.done) break;
|
|
2857
2781
|
const bIterable = b.entries();
|
|
2858
|
-
let hasMatch =
|
|
2782
|
+
let hasMatch = false;
|
|
2859
2783
|
let matchIndex = 0;
|
|
2860
2784
|
while (bResult = bIterable.next()) {
|
|
2861
2785
|
if (bResult.done) break;
|
|
@@ -2866,7 +2790,7 @@ function areMapsEqual(a, b, state) {
|
|
|
2866
2790
|
const aEntry = aResult.value;
|
|
2867
2791
|
const bEntry = bResult.value;
|
|
2868
2792
|
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
|
|
2869
|
-
hasMatch = matchedIndices[matchIndex] =
|
|
2793
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
2870
2794
|
break;
|
|
2871
2795
|
}
|
|
2872
2796
|
matchIndex++;
|
|
@@ -2924,19 +2848,19 @@ function areSetsEqual(a, b, state) {
|
|
|
2924
2848
|
const size = a.size;
|
|
2925
2849
|
if (size !== b.size) return false;
|
|
2926
2850
|
if (!size) return true;
|
|
2927
|
-
const matchedIndices = new
|
|
2851
|
+
const matchedIndices = new Array(size);
|
|
2928
2852
|
const aIterable = a.values();
|
|
2929
2853
|
let aResult;
|
|
2930
2854
|
let bResult;
|
|
2931
2855
|
while (aResult = aIterable.next()) {
|
|
2932
2856
|
if (aResult.done) break;
|
|
2933
2857
|
const bIterable = b.values();
|
|
2934
|
-
let hasMatch =
|
|
2858
|
+
let hasMatch = false;
|
|
2935
2859
|
let matchIndex = 0;
|
|
2936
2860
|
while (bResult = bIterable.next()) {
|
|
2937
2861
|
if (bResult.done) break;
|
|
2938
2862
|
if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
|
|
2939
|
-
hasMatch = matchedIndices[matchIndex] =
|
|
2863
|
+
hasMatch = matchedIndices[matchIndex] = true;
|
|
2940
2864
|
break;
|
|
2941
2865
|
}
|
|
2942
2866
|
matchIndex++;
|
|
@@ -2949,8 +2873,8 @@ function areSetsEqual(a, b, state) {
|
|
|
2949
2873
|
* Whether the TypedArray instances are equal in value.
|
|
2950
2874
|
*/
|
|
2951
2875
|
function areTypedArraysEqual(a, b) {
|
|
2952
|
-
let index = a.
|
|
2953
|
-
if (b.
|
|
2876
|
+
let index = a.byteLength;
|
|
2877
|
+
if (b.byteLength !== index || a.byteOffset !== b.byteOffset) return false;
|
|
2954
2878
|
while (index-- > 0) if (a[index] !== b[index]) return false;
|
|
2955
2879
|
return true;
|
|
2956
2880
|
}
|
|
@@ -4178,6 +4102,72 @@ function buildSdkData(driver) {
|
|
|
4178
4102
|
return wrapAsSdkData(buildRebaseData(driver));
|
|
4179
4103
|
}
|
|
4180
4104
|
//#endregion
|
|
4181
|
-
|
|
4105
|
+
//#region ../common/src/table-classification.ts
|
|
4106
|
+
/** Schemas that are always considered Rebase-internal. */
|
|
4107
|
+
var REBASE_INTERNAL_SCHEMAS = ["rebase", "auth"];
|
|
4108
|
+
/** Table-name prefixes that mark a table as Rebase-internal regardless of schema. */
|
|
4109
|
+
var REBASE_INTERNAL_PREFIXES = [
|
|
4110
|
+
"_rebase_",
|
|
4111
|
+
"_auth_",
|
|
4112
|
+
"drizzle_"
|
|
4113
|
+
];
|
|
4114
|
+
/**
|
|
4115
|
+
* Synchronously classify a table based on naming conventions.
|
|
4116
|
+
*
|
|
4117
|
+
* @param tableName - The unqualified name of the table.
|
|
4118
|
+
* @param schemaName - The schema the table belongs to (e.g. `"public"`, `"rebase"`).
|
|
4119
|
+
* @returns `"rebase-internal"` when the table belongs to a reserved schema or
|
|
4120
|
+
* carries a reserved prefix; `"user"` otherwise.
|
|
4121
|
+
*
|
|
4122
|
+
* @remarks
|
|
4123
|
+
* Junction-table detection requires an async database query and is therefore
|
|
4124
|
+
* **not** handled by this function. Use {@link detectJunctionTables} to obtain
|
|
4125
|
+
* the set of junction tables, then reclassify as needed.
|
|
4126
|
+
*/
|
|
4127
|
+
function classifyTable(tableName, schemaName) {
|
|
4128
|
+
if (REBASE_INTERNAL_SCHEMAS.includes(schemaName) || REBASE_INTERNAL_PREFIXES.some((prefix) => tableName.startsWith(prefix))) return "rebase-internal";
|
|
4129
|
+
return "user";
|
|
4130
|
+
}
|
|
4131
|
+
/** SQL query that detects junction tables in the `public` schema. */
|
|
4132
|
+
var JUNCTION_TABLES_SQL = `
|
|
4133
|
+
SELECT t.table_name
|
|
4134
|
+
FROM information_schema.tables t
|
|
4135
|
+
WHERE t.table_schema = 'public'
|
|
4136
|
+
AND t.table_type = 'BASE TABLE'
|
|
4137
|
+
AND NOT EXISTS (
|
|
4138
|
+
SELECT 1
|
|
4139
|
+
FROM information_schema.columns c
|
|
4140
|
+
WHERE c.table_schema = t.table_schema
|
|
4141
|
+
AND c.table_name = t.table_name
|
|
4142
|
+
AND c.column_name NOT IN (
|
|
4143
|
+
SELECT kcu.column_name
|
|
4144
|
+
FROM information_schema.key_column_usage kcu
|
|
4145
|
+
JOIN information_schema.table_constraints tc
|
|
4146
|
+
ON tc.constraint_name = kcu.constraint_name
|
|
4147
|
+
AND tc.table_schema = kcu.table_schema
|
|
4148
|
+
WHERE tc.constraint_type = 'FOREIGN KEY'
|
|
4149
|
+
AND kcu.table_schema = t.table_schema
|
|
4150
|
+
AND kcu.table_name = t.table_name
|
|
4151
|
+
)
|
|
4152
|
+
)
|
|
4153
|
+
`;
|
|
4154
|
+
/**
|
|
4155
|
+
* Asynchronously detect junction (link) tables in the `public` schema.
|
|
4156
|
+
*
|
|
4157
|
+
* A junction table is defined as a table where **every** column participates in
|
|
4158
|
+
* at least one foreign-key constraint.
|
|
4159
|
+
*
|
|
4160
|
+
* @param executeSql - A callback that executes a raw SQL string and returns the
|
|
4161
|
+
* resulting rows.
|
|
4162
|
+
* @returns A `Set` containing the names of all detected junction tables.
|
|
4163
|
+
*/
|
|
4164
|
+
async function detectJunctionTables(executeSql) {
|
|
4165
|
+
const rows = await executeSql(JUNCTION_TABLES_SQL);
|
|
4166
|
+
const junctionTables = /* @__PURE__ */ new Set();
|
|
4167
|
+
for (const row of rows) if (typeof row.table_name === "string") junctionTables.add(row.table_name);
|
|
4168
|
+
return junctionTables;
|
|
4169
|
+
}
|
|
4170
|
+
//#endregion
|
|
4171
|
+
export { toSnakeCase as A, createRelationRefWithData as C, getPolicyNamesForRule as D, generateForeignKeyName as E, DEFAULT_ONE_OF_VALUE as M, mergeDeep as O, createRelationRef as S, updateDateAutoValues as T, getTableVarName as _, getJunctionCollectionConfig as a, getDeclaredPrimaryKeys as b, getEffectiveSecurityRules as c, securityRuleToConditions as d, findAnonymousGrants as f, getTableName as g, getEnumVarName as h, CollectionRegistry as i, DEFAULT_ONE_OF_TYPE as j, camelCase as k, buildPropertyCallbacks as l, getColumnName as m, detectJunctionTables as n, getJunctionSecurityRules as o, findRelation as p, buildSdkData as r, resolveJunctionSpecs as s, classifyTable as t, policyToPostgres as u, resolveCollectionRelations as v, normalizeToEntityRelation as w, parseIdValues as x, buildCompositeId as y };
|
|
4182
4172
|
|
|
4183
|
-
//# sourceMappingURL=src-
|
|
4173
|
+
//# sourceMappingURL=src-BbFOPJ1S.js.map
|