@vrplatform/kysely 1.3.45-40447400929 → 1.3.45-40455989838

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.
@@ -1,3 +1,4 @@
1
1
  export * from './billing-partner';
2
2
  export * from './status';
3
3
  export * from './feature-enabled';
4
+ export * from './where-uuid-in';
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./billing-partner"), exports);
18
18
  __exportStar(require("./status"), exports);
19
19
  __exportStar(require("./feature-enabled"), exports);
20
+ __exportStar(require("./where-uuid-in"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["query/tenant/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,2CAAyB;AACzB,oDAAkC","sourcesContent":["export * from './billing-partner';\nexport * from './status';\nexport * from './feature-enabled';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["query/tenant/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,2CAAyB;AACzB,oDAAkC;AAClC,kDAAgC","sourcesContent":["export * from './billing-partner';\nexport * from './status';\nexport * from './feature-enabled';\nexport * from './where-uuid-in';\n"]}
@@ -0,0 +1,2 @@
1
+ import { type SqlBool } from '../../isomorphic';
2
+ export declare function whereUuidIn(column: string, ids: readonly string[]): import("kysely").RawBuilder<SqlBool>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.whereUuidIn = whereUuidIn;
4
+ const utils_1 = require("@vrplatform/utils");
5
+ const isomorphic_1 = require("../../isomorphic");
6
+ // One `= any(uuid[])` per chunk keeps every bound array small, however many
7
+ // ids a feature flag covers, and the filter stays part of one query so
8
+ // pagination and totals stay exact.
9
+ function whereUuidIn(column, ids) {
10
+ if (!ids.length)
11
+ return (0, isomorphic_1.sql) `false`;
12
+ return (0, isomorphic_1.sql) `(${isomorphic_1.sql.join((0, utils_1.chunkArray)([...ids], 5000).map((chunk) => (0, isomorphic_1.sql) `${isomorphic_1.sql.ref(column)} = any(${chunk}::uuid[])`), (0, isomorphic_1.sql) ` or `)})`;
13
+ }
14
+ //# sourceMappingURL=where-uuid-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"where-uuid-in.js","sourceRoot":"src/","sources":["query/tenant/where-uuid-in.ts"],"names":[],"mappings":";;AAMA,kCASC;AAfD,6CAA+C;AAC/C,iDAAqD;AAErD,4EAA4E;AAC5E,uEAAuE;AACvE,oCAAoC;AACpC,SAAgB,WAAW,CAAC,MAAc,EAAE,GAAsB;IAChE,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,IAAA,gBAAG,EAAS,OAAO,CAAC;IAE5C,OAAO,IAAA,gBAAG,EAAS,IAAI,gBAAG,CAAC,IAAI,CAC7B,IAAA,kBAAU,EAAC,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAC5B,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,gBAAG,EAAA,GAAG,gBAAG,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,WAAW,CAC3D,EACD,IAAA,gBAAG,EAAA,MAAM,CACV,GAAG,CAAC;AACP,CAAC","sourcesContent":["import { chunkArray } from '@vrplatform/utils';\nimport { type SqlBool, sql } from '../../isomorphic';\n\n// One `= any(uuid[])` per chunk keeps every bound array small, however many\n// ids a feature flag covers, and the filter stays part of one query so\n// pagination and totals stay exact.\nexport function whereUuidIn(column: string, ids: readonly string[]) {\n if (!ids.length) return sql<SqlBool>`false`;\n\n return sql<SqlBool>`(${sql.join(\n chunkArray([...ids], 5000).map(\n (chunk) => sql`${sql.ref(column)} = any(${chunk}::uuid[])`\n ),\n sql` or `\n )})`;\n}\n"]}
@@ -1,3 +1,4 @@
1
1
  export * from './billing-partner';
2
2
  export * from './status';
3
3
  export * from './feature-enabled';
4
+ export * from './where-uuid-in';
@@ -1,4 +1,5 @@
1
1
  export * from './billing-partner';
2
2
  export * from './status';
3
3
  export * from './feature-enabled';
4
+ export * from './where-uuid-in';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["query/tenant/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './billing-partner';\nexport * from './status';\nexport * from './feature-enabled';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["query/tenant/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './billing-partner';\nexport * from './status';\nexport * from './feature-enabled';\nexport * from './where-uuid-in';\n"]}
@@ -0,0 +1,2 @@
1
+ import { type SqlBool } from '../../isomorphic';
2
+ export declare function whereUuidIn(column: string, ids: readonly string[]): import("kysely").RawBuilder<SqlBool>;
@@ -0,0 +1,11 @@
1
+ import { chunkArray } from '@vrplatform/utils';
2
+ import { sql } from '../../isomorphic';
3
+ // One `= any(uuid[])` per chunk keeps every bound array small, however many
4
+ // ids a feature flag covers, and the filter stays part of one query so
5
+ // pagination and totals stay exact.
6
+ export function whereUuidIn(column, ids) {
7
+ if (!ids.length)
8
+ return sql `false`;
9
+ return sql `(${sql.join(chunkArray([...ids], 5000).map((chunk) => sql `${sql.ref(column)} = any(${chunk}::uuid[])`), sql ` or `)})`;
10
+ }
11
+ //# sourceMappingURL=where-uuid-in.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"where-uuid-in.js","sourceRoot":"src/","sources":["query/tenant/where-uuid-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAgB,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAErD,4EAA4E;AAC5E,uEAAuE;AACvE,oCAAoC;AACpC,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,GAAsB;IAChE,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,GAAG,CAAS,OAAO,CAAC;IAE5C,OAAO,GAAG,CAAS,IAAI,GAAG,CAAC,IAAI,CAC7B,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAC5B,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAA,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,WAAW,CAC3D,EACD,GAAG,CAAA,MAAM,CACV,GAAG,CAAC;AACP,CAAC","sourcesContent":["import { chunkArray } from '@vrplatform/utils';\nimport { type SqlBool, sql } from '../../isomorphic';\n\n// One `= any(uuid[])` per chunk keeps every bound array small, however many\n// ids a feature flag covers, and the filter stays part of one query so\n// pagination and totals stay exact.\nexport function whereUuidIn(column: string, ids: readonly string[]) {\n if (!ids.length) return sql<SqlBool>`false`;\n\n return sql<SqlBool>`(${sql.join(\n chunkArray([...ids], 5000).map(\n (chunk) => sql`${sql.ref(column)} = any(${chunk}::uuid[])`\n ),\n sql` or `\n )})`;\n}\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.45-40447400929",
6
+ "version": "1.3.45-40455989838",
7
7
  "description": "",
8
8
  "main": "build/main/index.js",
9
9
  "module": "build/module/index.js",