joist-core 2.3.0-next.99 → 2.4.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.
Files changed (131) hide show
  1. package/build/EntityManager.cjs +1 -1
  2. package/build/EntityManager.cjs.map +1 -1
  3. package/build/EntityManager.d.cts +9 -8
  4. package/build/EntityManager.d.cts.map +1 -1
  5. package/build/EntityManager.d.mts +9 -8
  6. package/build/EntityManager.d.mts.map +1 -1
  7. package/build/EntityManager.js +1 -1
  8. package/build/EntityManager.js.map +1 -1
  9. package/build/dataloaders/findCountDataLoader.cjs +2 -0
  10. package/build/dataloaders/findCountDataLoader.cjs.map +1 -1
  11. package/build/dataloaders/findCountDataLoader.d.cts.map +1 -1
  12. package/build/dataloaders/findCountDataLoader.d.mts.map +1 -1
  13. package/build/dataloaders/findCountDataLoader.js +2 -0
  14. package/build/dataloaders/findCountDataLoader.js.map +1 -1
  15. package/build/dataloaders/findDataLoader.cjs +1 -0
  16. package/build/dataloaders/findDataLoader.cjs.map +1 -1
  17. package/build/dataloaders/findDataLoader.d.cts.map +1 -1
  18. package/build/dataloaders/findDataLoader.d.mts.map +1 -1
  19. package/build/dataloaders/findDataLoader.js +2 -1
  20. package/build/dataloaders/findDataLoader.js.map +1 -1
  21. package/build/dataloaders/findIdsDataLoader.cjs +2 -0
  22. package/build/dataloaders/findIdsDataLoader.cjs.map +1 -1
  23. package/build/dataloaders/findIdsDataLoader.d.cts.map +1 -1
  24. package/build/dataloaders/findIdsDataLoader.d.mts.map +1 -1
  25. package/build/dataloaders/findIdsDataLoader.js +2 -0
  26. package/build/dataloaders/findIdsDataLoader.js.map +1 -1
  27. package/build/dataloaders/findPaginatedDataLoader.cjs +2 -0
  28. package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -1
  29. package/build/dataloaders/findPaginatedDataLoader.d.cts.map +1 -1
  30. package/build/dataloaders/findPaginatedDataLoader.d.mts.map +1 -1
  31. package/build/dataloaders/findPaginatedDataLoader.js +2 -0
  32. package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
  33. package/build/index.cjs +6 -3
  34. package/build/index.cjs.map +1 -1
  35. package/build/index.d.cts +6 -4
  36. package/build/index.d.cts.map +1 -1
  37. package/build/index.d.mts +6 -4
  38. package/build/index.d.mts.map +1 -1
  39. package/build/index.js +6 -5
  40. package/build/index.js.map +1 -1
  41. package/build/keys.cjs +6 -1
  42. package/build/keys.cjs.map +1 -1
  43. package/build/keys.d.cts +3 -1
  44. package/build/keys.d.cts.map +1 -1
  45. package/build/keys.d.mts +3 -1
  46. package/build/keys.d.mts.map +1 -1
  47. package/build/keys.js +6 -2
  48. package/build/keys.js.map +1 -1
  49. package/build/queries/find/QueryParser.cjs +1 -2
  50. package/build/queries/find/QueryParser.cjs.map +1 -1
  51. package/build/queries/find/QueryParser.d.cts.map +1 -1
  52. package/build/queries/find/QueryParser.d.mts.map +1 -1
  53. package/build/queries/find/QueryParser.js +2 -3
  54. package/build/queries/find/QueryParser.js.map +1 -1
  55. package/build/queries/find/QueryVisitor.cjs +17 -0
  56. package/build/queries/find/QueryVisitor.cjs.map +1 -1
  57. package/build/queries/find/QueryVisitor.d.cts +3 -1
  58. package/build/queries/find/QueryVisitor.d.cts.map +1 -1
  59. package/build/queries/find/QueryVisitor.d.mts +3 -1
  60. package/build/queries/find/QueryVisitor.d.mts.map +1 -1
  61. package/build/queries/find/QueryVisitor.js +17 -1
  62. package/build/queries/find/QueryVisitor.js.map +1 -1
  63. package/build/queries/sql/Expr.cjs +18 -1
  64. package/build/queries/sql/Expr.cjs.map +1 -1
  65. package/build/queries/sql/Expr.d.cts +13 -3
  66. package/build/queries/sql/Expr.d.cts.map +1 -1
  67. package/build/queries/sql/Expr.d.mts +13 -3
  68. package/build/queries/sql/Expr.d.mts.map +1 -1
  69. package/build/queries/sql/Expr.js +18 -2
  70. package/build/queries/sql/Expr.js.map +1 -1
  71. package/build/queries/sql/JoinTree.cjs +72 -0
  72. package/build/queries/sql/JoinTree.cjs.map +1 -0
  73. package/build/queries/sql/JoinTree.d.cts +107 -0
  74. package/build/queries/sql/JoinTree.d.cts.map +1 -0
  75. package/build/queries/sql/JoinTree.d.mts +107 -0
  76. package/build/queries/sql/JoinTree.d.mts.map +1 -0
  77. package/build/queries/sql/JoinTree.js +71 -0
  78. package/build/queries/sql/JoinTree.js.map +1 -0
  79. package/build/queries/sql/Tables.cjs +103 -6
  80. package/build/queries/sql/Tables.cjs.map +1 -1
  81. package/build/queries/sql/Tables.d.cts +72 -13
  82. package/build/queries/sql/Tables.d.cts.map +1 -1
  83. package/build/queries/sql/Tables.d.mts +72 -13
  84. package/build/queries/sql/Tables.d.mts.map +1 -1
  85. package/build/queries/sql/Tables.js +101 -10
  86. package/build/queries/sql/Tables.js.map +1 -1
  87. package/build/queries/sql/custom.cjs +52 -0
  88. package/build/queries/sql/custom.cjs.map +1 -0
  89. package/build/queries/sql/custom.d.cts +85 -0
  90. package/build/queries/sql/custom.d.cts.map +1 -0
  91. package/build/queries/sql/custom.d.mts +85 -0
  92. package/build/queries/sql/custom.d.mts.map +1 -0
  93. package/build/queries/sql/custom.js +49 -0
  94. package/build/queries/sql/custom.js.map +1 -0
  95. package/build/queries/sql/execute.cjs +68 -28
  96. package/build/queries/sql/execute.cjs.map +1 -1
  97. package/build/queries/sql/execute.d.cts +110 -11
  98. package/build/queries/sql/execute.d.cts.map +1 -1
  99. package/build/queries/sql/execute.d.mts +110 -11
  100. package/build/queries/sql/execute.d.mts.map +1 -1
  101. package/build/queries/sql/execute.js +69 -29
  102. package/build/queries/sql/execute.js.map +1 -1
  103. package/build/queries/sql/expressions/types.d.cts +5 -5
  104. package/build/queries/sql/expressions/types.d.cts.map +1 -1
  105. package/build/queries/sql/expressions/types.d.mts +5 -5
  106. package/build/queries/sql/expressions/types.d.mts.map +1 -1
  107. package/build/queries/sql/keywords.cjs +1 -1
  108. package/build/queries/sql/keywords.cjs.map +1 -1
  109. package/build/queries/sql/keywords.d.cts +1 -1
  110. package/build/queries/sql/keywords.d.mts +1 -1
  111. package/build/queries/sql/keywords.js +1 -1
  112. package/build/queries/sql/keywords.js.map +1 -1
  113. package/build/queries/sql/query.cjs +100 -38
  114. package/build/queries/sql/query.cjs.map +1 -1
  115. package/build/queries/sql/query.d.cts +96 -46
  116. package/build/queries/sql/query.d.cts.map +1 -1
  117. package/build/queries/sql/query.d.mts +96 -46
  118. package/build/queries/sql/query.d.mts.map +1 -1
  119. package/build/queries/sql/query.js +102 -40
  120. package/build/queries/sql/query.js.map +1 -1
  121. package/build/queries/valueFilters.cjs +28 -36
  122. package/build/queries/valueFilters.cjs.map +1 -1
  123. package/build/queries/valueFilters.d.cts +2 -4
  124. package/build/queries/valueFilters.d.cts.map +1 -1
  125. package/build/queries/valueFilters.d.mts +2 -4
  126. package/build/queries/valueFilters.d.mts.map +1 -1
  127. package/build/queries/valueFilters.js +29 -36
  128. package/build/queries/valueFilters.js.map +1 -1
  129. package/build/serde/serde.cjs.map +1 -1
  130. package/build/serde/serde.js.map +1 -1
  131. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"findIdsDataLoader.js","names":[],"sources":["../../src/dataloaders/findIdsDataLoader.ts"],"sourcesContent":["import {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"src/dataloaders/findDataLoader.ts\";\nimport type { Entity } from \"src/Entity.ts\";\nimport type { EntityManager, MaybeAbstractEntityConstructor } from \"src/EntityManager.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { keyToTaggedId } from \"src/keys.ts\";\nimport type { FilterAndSettings } from \"src/queries/find/EntityFilter.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"src/queries/find/QueryParser.ts\";\nimport { kq } from \"src/queries/sql/keywords.ts\";\nimport { buildUnnestCte } from \"src/queries/unnest.ts\";\nimport { fail } from \"src/utils.ts\";\n\nexport const findIdsOperation = \"find-ids\";\n\nexport function findIdsDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n): Promise<string[]> {\n const { where, ...opts } = filter;\n if (opts.limit || opts.offset) {\n throw new Error(\"Cannot use limit/offset with findIdsDataLoader\");\n }\n\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findIdsOperation, query, { ...opts, limit: undefined });\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = { filter, query, bindings, findSettings };\n const batchKey = getBatchKeyFromGenericStructure(meta, query);\n\n return em\n .getLoader<typeof prepared, string[]>(\n findIdsOperation,\n batchKey,\n async (entries) => {\n // We're guaranteed that these queries all have the same structure\n\n // Don't bother with the CTE if there's only 1 query (or each query has exactly the same filter values)\n if (entries.length === 1) {\n const { query, findSettings } = entries[0];\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query, findSettings, false);\n return [rows.map((row: any) => keyToTaggedId(meta, row.id)!)];\n }\n\n // WITH _find (tag, arg1, arg2) AS (\n // SELECT unnest($0::int[]) unnest($0::varchar[]), unnest($0::varchar[])\n // )\n // SELECT _find.tag, _data.id\n // FROM _find\n // CROSS JOIN LATERAL (\n // SELECT distinct a.id as id\n // FROM author a WHERE a.first_name = _find.arg1 OR a.last_name = _find.arg2\n // ) _data\n\n // Build the list of 'arg1', 'arg2', ... strings\n const { query, findSettings } = entries[0];\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n\n // We're not returning the entities, just selecting their IDs\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.id as id\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n { join: \"lateral\", query, table: meta.tableName, alias: \"_data\", fromAlias: \"_f\" },\n ],\n // For each unique query, capture its filter values in `bindings` to populate the CTE _find table\n ctes: [buildUnnestCte(\"_find\", argsColumns, createColumnValuesFromPrepared(args, entries))],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query2, findSettings, false);\n\n // Make an empty array for each batched query, per the dataloader contract\n const results: string[][] = entries.map(() => []);\n // Then put each row's ID into the tagged query it matched\n for (const row of rows) {\n results[row.tag].push(keyToTaggedId(meta, row.id)!);\n }\n return results;\n },\n // Our filter/order tuple is a complex object, so use a stable cache key to ensure caching works.\n { cacheKeyFn: queryFilterHash },\n )\n .load(prepared);\n}\n"],"mappings":";;;;;;;;AAiBA,MAAa,mBAAmB;AAEhC,SAAgB,kBACd,IACA,MACA,QACmB;CACnB,MAAM,EAAE,OAAO,GAAG,SAAS;CAC3B,IAAI,KAAK,SAAS,KAAK,QACrB,MAAM,IAAI,MAAM,gDAAgD;CAGlE,MAAM,OAAO,YAAY,IAAI;CAC7B,MAAM,QAAQ,eAAe,MAAM,OAAO,IAAI;CAC9C,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,MAAM,kBAAkB,OAAO;EAAE,GAAG;EAAM,OAAO,KAAA;CAAU,CAAC;CACvG,MAAM,WAAkB,CAAC;CACzB,cAAc,UAAU,KAAK;CAC7B,MAAM,WAAW;EAAE;EAAQ;EAAO;EAAU;CAAa;CACzD,MAAM,WAAW,gCAAgC,MAAM,KAAK;CAE5D,OAAO,GACJ,UACC,kBACA,UACA,OAAO,YAAY;EAIjB,IAAI,QAAQ,WAAW,GAAG;GACxB,MAAM,EAAE,OAAO,iBAAiB,QAAQ;GACxC,MAAM,UAAU,MAAM,OAAO,MAAM,MAAM,EAAE,SAAS,SAA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T,GAEA,EAAE,YAAY,gBAAgB,CAChC,CAAC,CACA,KAAK,QAAQ;AAClB"}
1
+ {"version":3,"file":"findIdsDataLoader.js","names":[],"sources":["../../src/dataloaders/findIdsDataLoader.ts"],"sourcesContent":["import {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"src/dataloaders/findDataLoader.ts\";\nimport type { Entity } from \"src/Entity.ts\";\nimport type { EntityManager, MaybeAbstractEntityConstructor } from \"src/EntityManager.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { keyToTaggedId } from \"src/keys.ts\";\nimport type { FilterAndSettings } from \"src/queries/find/EntityFilter.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"src/queries/find/QueryParser.ts\";\nimport { isQueryProvablyEmpty } from \"src/queries/find/QueryVisitor.ts\";\nimport { kq } from \"src/queries/sql/keywords.ts\";\nimport { buildUnnestCte } from \"src/queries/unnest.ts\";\nimport { fail } from \"src/utils.ts\";\n\nexport const findIdsOperation = \"find-ids\";\n\nexport function findIdsDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n): Promise<string[]> {\n const { where, ...opts } = filter;\n if (opts.limit || opts.offset) {\n throw new Error(\"Cannot use limit/offset with findIdsDataLoader\");\n }\n\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findIdsOperation, query, { ...opts, limit: undefined });\n if (isQueryProvablyEmpty(query)) return Promise.resolve([]);\n\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = { filter, query, bindings, findSettings };\n const batchKey = getBatchKeyFromGenericStructure(meta, query);\n\n return em\n .getLoader<typeof prepared, string[]>(\n findIdsOperation,\n batchKey,\n async (entries) => {\n // We're guaranteed that these queries all have the same structure\n\n // Don't bother with the CTE if there's only 1 query (or each query has exactly the same filter values)\n if (entries.length === 1) {\n const { query, findSettings } = entries[0];\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query, findSettings, false);\n return [rows.map((row: any) => keyToTaggedId(meta, row.id)!)];\n }\n\n // WITH _find (tag, arg1, arg2) AS (\n // SELECT unnest($0::int[]) unnest($0::varchar[]), unnest($0::varchar[])\n // )\n // SELECT _find.tag, _data.id\n // FROM _find\n // CROSS JOIN LATERAL (\n // SELECT distinct a.id as id\n // FROM author a WHERE a.first_name = _find.arg1 OR a.last_name = _find.arg2\n // ) _data\n\n // Build the list of 'arg1', 'arg2', ... strings\n const { query, findSettings } = entries[0];\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n\n // We're not returning the entities, just selecting their IDs\n const primary = query.tables.find((t) => t.join === \"primary\") ?? fail(\"No primary\");\n query.selects = [`${kq(primary.alias)}.id as id`];\n query.orderBys = [{ alias: primary.alias, column: \"id\", order: \"ASC\" }];\n\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.id as id\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n { join: \"lateral\", query, table: meta.tableName, alias: \"_data\", fromAlias: \"_f\" },\n ],\n // For each unique query, capture its filter values in `bindings` to populate the CTE _find table\n ctes: [buildUnnestCte(\"_find\", argsColumns, createColumnValuesFromPrepared(args, entries))],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](meta, findIdsOperation, query2, findSettings, false);\n\n // Make an empty array for each batched query, per the dataloader contract\n const results: string[][] = entries.map(() => []);\n // Then put each row's ID into the tagged query it matched\n for (const row of rows) {\n results[row.tag].push(keyToTaggedId(meta, row.id)!);\n }\n return results;\n },\n // Our filter/order tuple is a complex object, so use a stable cache key to ensure ca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AAG,GAAG,KAAK,KAAK,MAAM,EAAE,MAAM,CAAC;EAGvF,MAAM,UAAU,MAAM,OAAO,MAAM,MAAM,EAAE,SAAS,SAAS,KAAK,KAAK,YAAY;EACnF,MAAM,UAAU,CAAC,GAAG,GAAG,QAAQ,KAAK,EAAE,UAAU;EAChD,MAAM,WAAW,CAAC;GAAE,OAAO,QAAQ;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC;EAEtE,MAAM,SAA0B;GAC9B,SAAS,CAAC,oBAAoB,gBAAgB;GAC9C,QAAQ,CACN;IAAE,MAAM;IAAW,OAAO;IAAS,OAAO;GAAQ,GAClD;IAAE,MAAM;IAAW;IAAO,OAAO,KAAK;IAAW,OAAO;IAAS,WAAW;GAAK,CACnF;GAEA,MAAM,CAAC,eAAe,SAAS,aAAa,+BAA+B,MAAM,OAAO,CAAC,CAAC;GAC1F,UAAU,CAAC;EACb;EAEA,MAAM,OAAO,MAAM,GAAG,sBAAsB,CAAC,MAAM,kBAAkB,QAAQ,cAAc,KAAK;EAGhG,MAAM,UAAsB,QAAQ,UAAU,CAAC,CAAC;EAEhD,KAAK,MAAM,OAAO,MAChB,QAAQ,IAAI,IAAI,CAAC,KAAK,cAAc,MAAM,IAAI,EAAE,CAAE;EAEpD,OAAO;CACT,GAEA,EAAE,YAAY,gBAAgB,CAChC,CAAC,CACA,KAAK,QAAQ;AAClB"}
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_normalizeHints = require("../normalizeHints.cjs");
3
+ const require_queries_find_QueryVisitor = require("../queries/find/QueryVisitor.cjs");
3
4
  const require_queries_find_QueryParser = require("../queries/find/QueryParser.cjs");
4
5
  const require_EntityMetadata = require("../EntityMetadata.cjs");
5
6
  const require_loading_HintTree = require("../loading/HintTree.cjs");
@@ -18,6 +19,7 @@ function findPaginatedDataLoader(em, type, filter, hint) {
18
19
  offset,
19
20
  checkLimit: false
20
21
  });
22
+ if (require_queries_find_QueryVisitor.isQueryProvablyEmpty(query)) return Promise.resolve([]);
21
23
  const bindings = [];
22
24
  require_dataloaders_findDataLoader.collectValues(bindings, query);
23
25
  const prepared = {
@@ -1 +1 @@
1
- {"version":3,"file":"findPaginatedDataLoader.cjs","names":["getMetadata","parseFindQuery","findOperation","getBatchKeyFromGenericStructure","hintKey","getEmInternalApi","buildHintTree","filterDeletedEntities","collectAndReplaceArgs","createColumnValuesFromPrepared","buildUnnestCte","queryFilterHash"],"sources":["../../src/dataloaders/findPaginatedDataLoader.ts"],"sourcesContent":["import {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n filterDeletedEntities,\n findOperation,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"src/dataloaders/findDataLoader.ts\";\nimport type { Entity } from \"src/Entity.ts\";\nimport { type EntityManager, type MaybeAbstractEntityConstructor, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { buildHintTree } from \"src/loading/HintTree.ts\";\nimport type { LoadHint } from \"src/loading/loadHints.ts\";\nimport { hintKey } from \"src/normalizeHints.ts\";\nimport type { FilterAndSettings } from \"src/queries/find/EntityFilter.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"src/queries/find/QueryParser.ts\";\nimport { buildUnnestCte } from \"src/queries/unnest.ts\";\n\ninterface PreparedPaginatedFindEntry<T extends Entity> {\n filter: FilterAndSettings<T>;\n query: ParsedFindQuery;\n bindings: any[];\n findSettings: any;\n limit: number | undefined;\n offset: number | undefined;\n}\n\n/** Returns a dataloader that batches paginated finds by applying pagination inside each lateral subquery. */\nexport function findPaginatedDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n hint: LoadHint<T> | undefined,\n): Promise<T[]> {\n const { where, limit, offset, ...opts } = filter;\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findOperation, query, { ...opts, limit, offset, checkLimit: false });\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = {\n filter,\n query,\n bindings,\n findSettings,\n limit: findSettings.limit,\n offset: findSettings.offset,\n };\n const batchKey = [\n getBatchKeyFromGenericStructure(meta, query),\n hintKey(hint),\n findSettings.limit,\n findSettings.offset,\n ].join(\"-\");\n\n return em\n .getLoader<PreparedPaginatedFindEntry<T>, T[]>(\n findOperation,\n batchKey,\n async (entries) => {\n if (entries.length === 1) {\n // Skip batching & just execute the query as-is\n const { query, findSettings } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n const rows = await em[\"executePreparedFind\"](meta, findOperation, query, findSettings, false);\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n return [filterDeletedEntities(em, entities)];\n }\n\n const { query, findSettings, limit, offset } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n\n // Now craft the actual batched query\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n const columnValues = createColumnValuesFromPrepared(args, entries);\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.*\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n {\n join: \"lateral\",\n query,\n table: meta.tableName,\n alias: \"_data\",\n fromAlias: \"_find\",\n settings: { limit, offset },\n },\n ],\n ctes: [buildUnnestCte(\"_find\", argsColumns, columnValues)],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](\n meta,\n findOperation,\n query2,\n { ...findSettings, limit: undefined, offset: undefined },\n false,\n );\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n\n const results = entries.map(() => [] as T[]);\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const entity = entities[i];\n if (!entity.isDeletedEntity) {\n results[row.tag].push(entity);\n }\n delete row.tag;\n }\n return results;\n },\n { cacheKeyFn: queryFilterHash },\n )\n .load(prepared);\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAgB,wBACd,IACA,MACA,QACA,MACc;CACd,MAAM,EAAE,OAAO,OAAO,QAAQ,GAAG,SAAS;CAC1C,MAAM,OAAOA,uBAAAA,YAAY,IAAI;CAC7B,MAAM,QAAQC,iCAAAA,eAAe,MAAM,OAAO,IAAI;CAC9C,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,MAAMC,mCAAAA,eAAe,OAAO;EAAE,GAAG;EAAM;EAAO;EAAQ,YAAY;CAAM,CAAC;CACpH,MAAM,WAAkB,CAAC;CACzB,mCAAA,cAAc,UAAU,KAAK;CAC7B,MAAM,WAAW;EACf;EACA;EACA;EACA;EACA,OAAO,aAAa;EACpB,QAAQ,aAAa;CACvB;CACA,MAAM,WAAW;EACfC,mCAAAA,gCAAgC,MAAM,KAAK;EAC3CC,uBAAAA,QAAQ,IAAI;EACZ,aAAa;EACb,aAAa;CACf,CAAC,CAAC,KAAK,GAAG;CAEV,OAAO,GACJ,UACCF,mCAAAA,eACA,UACA,OAAO,YAAY;EACjB,IAAI,QAAQ,WAAW,GAAG;GAExB,MAAM,EAAE,OAAO,iBAAiB,QAAQ;GACxC,MAAM,EAAE,cAAcG,sBAAAA,iBAAiB,EAAE;GACzC,MAAM,kBAAkB,aAAa,QAAQ,UAAU,cAAc,MAAMC,yBAAAA,cAAc,IAAI,GAAG,KAAK;GACrG,MAAM,OAAO,MAAM,GAAG,sBAAsB,CAAC,MAAMJ,mCAAAA,eAAe,OAAO,cAAc,KAAK;GAC5F,MAAM,WAAW,GAAG,QAAQ,MAAM,IAAI;GACtC,kBAAkB,MAAM,QAAQ;GAChC,OAAO,CAACK,mCAAAA,sBAAsB,IAAI,QAAQ,CAAC;EAC7C;EAEA,MAAM,EAAE,OAAO,cAAc,OAAO,WAAW,QAAQ;EACvD,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Empty","getBatchKeyFromGenericStructure","hintKey","getEmInternalApi","buildHintTree","filterDeletedEntities","collectAndReplaceArgs","createColumnValuesFromPrepared","buildUnnestCte","queryFilterHash"],"sources":["../../src/dataloaders/findPaginatedDataLoader.ts"],"sourcesContent":["import {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n filterDeletedEntities,\n findOperation,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"src/dataloaders/findDataLoader.ts\";\nimport type { Entity } from \"src/Entity.ts\";\nimport { type EntityManager, type MaybeAbstractEntityConstructor, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { buildHintTree } from \"src/loading/HintTree.ts\";\nimport type { LoadHint } from \"src/loading/loadHints.ts\";\nimport { hintKey } from \"src/normalizeHints.ts\";\nimport type { FilterAndSettings } from \"src/queries/find/EntityFilter.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"src/queries/find/QueryParser.ts\";\nimport { isQueryProvablyEmpty } from \"src/queries/find/QueryVisitor.ts\";\nimport { buildUnnestCte } from \"src/queries/unnest.ts\";\n\ninterface PreparedPaginatedFindEntry<T extends Entity> {\n filter: FilterAndSettings<T>;\n query: ParsedFindQuery;\n bindings: any[];\n findSettings: any;\n limit: number | undefined;\n offset: number | undefined;\n}\n\n/** Returns a dataloader that batches paginated finds by applying pagination inside each lateral subquery. */\nexport function findPaginatedDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n hint: LoadHint<T> | undefined,\n): Promise<T[]> {\n const { where, limit, offset, ...opts } = filter;\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findOperation, query, { ...opts, limit, offset, checkLimit: false });\n if (isQueryProvablyEmpty(query)) return Promise.resolve([]);\n\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = {\n filter,\n query,\n bindings,\n findSettings,\n limit: findSettings.limit,\n offset: findSettings.offset,\n };\n const batchKey = [\n getBatchKeyFromGenericStructure(meta, query),\n hintKey(hint),\n findSettings.limit,\n findSettings.offset,\n ].join(\"-\");\n\n return em\n .getLoader<PreparedPaginatedFindEntry<T>, T[]>(\n findOperation,\n batchKey,\n async (entries) => {\n if (entries.length === 1) {\n // Skip batching & just execute the query as-is\n const { query, findSettings } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n const rows = await em[\"executePreparedFind\"](meta, findOperation, query, findSettings, false);\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n return [filterDeletedEntities(em, entities)];\n }\n\n const { query, findSettings, limit, offset } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n\n // Now craft the actual batched query\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n const columnValues = createColumnValuesFromPrepared(args, entries);\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.*\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n {\n join: \"lateral\",\n query,\n table: meta.tableName,\n alias: \"_data\",\n fromAlias: \"_find\",\n settings: { limit, offset },\n },\n ],\n ctes: [buildUnnestCte(\"_find\", argsColumns, columnValues)],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](\n meta,\n findOperation,\n query2,\n { ...findSettings, limit: undefined, offset: undefined },\n false,\n );\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n\n const results = entries.map(() => [] as T[]);\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const entity = entities[i];\n if (!entity.isDeletedEntity) {\n results[row.tag].push(entity);\n }\n delete row.tag;\n }\n return results;\n },\n { cacheKeyFn: queryFilterHash },\n )\n .load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ts"],"mappings":";;;;;;iBA6BgB,wBAAwB,UAAU,QAChD,IAAI,eACJ,MAAM,+BAA+B,IACrC,QAAQ,kBAAkB,IAC1B,MAAM,SAAS,iBACd,QAAQ"}
1
+ {"version":3,"file":"findPaginatedDataLoader.d.cts","names":[],"sources":["../../src/dataloaders/findPaginatedDataLoader.ts"],"mappings":";;;;;;iBA8BgB,wBAAwB,UAAU,QAChD,IAAI,eACJ,MAAM,+BAA+B,IACrC,QAAQ,kBAAkB,IAC1B,MAAM,SAAS,iBACd,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"findPaginatedDataLoader.d.mts","names":[],"sources":["../../src/dataloaders/findPaginatedDataLoader.ts"],"mappings":";;;;;;iBA6BgB,wBAAwB,UAAU,QAChD,IAAI,eACJ,MAAM,+BAA+B,IACrC,QAAQ,kBAAkB,IAC1B,MAAM,SAAS,iBACd,QAAQ"}
1
+ {"version":3,"file":"findPaginatedDataLoader.d.mts","names":[],"sources":["../../src/dataloaders/findPaginatedDataLoader.ts"],"mappings":";;;;;;iBA8BgB,wBAAwB,UAAU,QAChD,IAAI,eACJ,MAAM,+BAA+B,IACrC,QAAQ,kBAAkB,IAC1B,MAAM,SAAS,iBACd,QAAQ"}
@@ -1,4 +1,5 @@
1
1
  import { hintKey } from "../normalizeHints.js";
2
+ import { isQueryProvablyEmpty } from "../queries/find/QueryVisitor.js";
2
3
  import { parseFindQuery } from "../queries/find/QueryParser.js";
3
4
  import { getMetadata } from "../EntityMetadata.js";
4
5
  import { buildHintTree } from "../loading/HintTree.js";
@@ -17,6 +18,7 @@ function findPaginatedDataLoader(em, type, filter, hint) {
17
18
  offset,
18
19
  checkLimit: false
19
20
  });
21
+ if (isQueryProvablyEmpty(query)) return Promise.resolve([]);
20
22
  const bindings = [];
21
23
  collectValues(bindings, query);
22
24
  const prepared = {
@@ -1 +1 @@
1
- {"version":3,"file":"findPaginatedDataLoader.js","names":[],"sources":["../../src/dataloaders/findPaginatedDataLoader.ts"],"sourcesContent":["import {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n filterDeletedEntities,\n findOperation,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"src/dataloaders/findDataLoader.ts\";\nimport type { Entity } from \"src/Entity.ts\";\nimport { type EntityManager, type MaybeAbstractEntityConstructor, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { buildHintTree } from \"src/loading/HintTree.ts\";\nimport type { LoadHint } from \"src/loading/loadHints.ts\";\nimport { hintKey } from \"src/normalizeHints.ts\";\nimport type { FilterAndSettings } from \"src/queries/find/EntityFilter.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"src/queries/find/QueryParser.ts\";\nimport { buildUnnestCte } from \"src/queries/unnest.ts\";\n\ninterface PreparedPaginatedFindEntry<T extends Entity> {\n filter: FilterAndSettings<T>;\n query: ParsedFindQuery;\n bindings: any[];\n findSettings: any;\n limit: number | undefined;\n offset: number | undefined;\n}\n\n/** Returns a dataloader that batches paginated finds by applying pagination inside each lateral subquery. */\nexport function findPaginatedDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n hint: LoadHint<T> | undefined,\n): Promise<T[]> {\n const { where, limit, offset, ...opts } = filter;\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findOperation, query, { ...opts, limit, offset, checkLimit: false });\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = {\n filter,\n query,\n bindings,\n findSettings,\n limit: findSettings.limit,\n offset: findSettings.offset,\n };\n const batchKey = [\n getBatchKeyFromGenericStructure(meta, query),\n hintKey(hint),\n findSettings.limit,\n findSettings.offset,\n ].join(\"-\");\n\n return em\n .getLoader<PreparedPaginatedFindEntry<T>, T[]>(\n findOperation,\n batchKey,\n async (entries) => {\n if (entries.length === 1) {\n // Skip batching & just execute the query as-is\n const { query, findSettings } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n const rows = await em[\"executePreparedFind\"](meta, findOperation, query, findSettings, false);\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n return [filterDeletedEntities(em, entities)];\n }\n\n const { query, findSettings, limit, offset } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n\n // Now craft the actual batched query\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n const columnValues = createColumnValuesFromPrepared(args, entries);\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.*\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n {\n join: \"lateral\",\n query,\n table: meta.tableName,\n alias: \"_data\",\n fromAlias: \"_find\",\n settings: { limit, offset },\n },\n ],\n ctes: [buildUnnestCte(\"_find\", argsColumns, columnValues)],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](\n meta,\n findOperation,\n query2,\n { ...findSettings, limit: undefined, offset: undefined },\n false,\n );\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n\n const results = entries.map(() => [] as T[]);\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const entity = entities[i];\n if (!entity.isDeletedEntity) {\n results[row.tag].push(entity);\n }\n delete row.tag;\n }\n return results;\n },\n { cacheKeyFn: queryFilterHash },\n )\n .load(prepared);\n}\n"],"mappings":";;;;;;;;;AA6BA,SAAgB,wBACd,IACA,MACA,QACA,MACc;CACd,MAAM,EAAE,OAAO,OAAO,QAAQ,GAAG,SAAS;CAC1C,MAAM,OAAO,YAAY,IAAI;CAC7B,MAAM,QAAQ,eAAe,MAAM,OAAO,IAAI;CAC9C,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,MAAM,e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IACZ,OAAO;IACP,WAAW;IACX,UAAU;KAAE;KAAO;IAAO;GAC5B,CACF;GACA,MAAM,CAAC,eAAe,SAAS,aAAa,YAAY,CAAC;GACzD,UAAU,CAAC;EACb;EAEA,MAAM,OAAO,MAAM,GAAG,sBAAsB,CAC1C,MACA,eACA,QACA;GAAE,GAAG;GAAc,OAAO,KAAA;GAAW,QAAQ,KAAA;EAAU,GACvD,KACF;EACA,MAAM,WAAW,GAAG,QAAQ,MAAM,IAAI;EACtC,kBAAkB,MAAM,QAAQ;EAEhC,MAAM,UAAU,QAAQ,UAAU,CAAC,CAAQ;EAC3C,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,MAAM,KAAK;GACjB,MAAM,SAAS,SAAS;GACxB,IAAI,CAAC,OAAO,iBACV,QAAQ,IAAI,IAAI,CAAC,KAAK,MAAM;GAE9B,OAAO,IAAI;EACb;EACA,OAAO;CACT,GACA,EAAE,YAAY,gBAAgB,CAChC,CAAC,CACA,KAAK,QAAQ;AAClB"}
1
+ {"version":3,"file":"findPaginatedDataLoader.js","names":[],"sources":["../../src/dataloaders/findPaginatedDataLoader.ts"],"sourcesContent":["import {\n collectAndReplaceArgs,\n collectValues,\n createColumnValuesFromPrepared,\n filterDeletedEntities,\n findOperation,\n getBatchKeyFromGenericStructure,\n queryFilterHash,\n} from \"src/dataloaders/findDataLoader.ts\";\nimport type { Entity } from \"src/Entity.ts\";\nimport { type EntityManager, type MaybeAbstractEntityConstructor, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { getMetadata } from \"src/EntityMetadata.ts\";\nimport { buildHintTree } from \"src/loading/HintTree.ts\";\nimport type { LoadHint } from \"src/loading/loadHints.ts\";\nimport { hintKey } from \"src/normalizeHints.ts\";\nimport type { FilterAndSettings } from \"src/queries/find/EntityFilter.ts\";\nimport { type ParsedFindQuery, parseFindQuery } from \"src/queries/find/QueryParser.ts\";\nimport { isQueryProvablyEmpty } from \"src/queries/find/QueryVisitor.ts\";\nimport { buildUnnestCte } from \"src/queries/unnest.ts\";\n\ninterface PreparedPaginatedFindEntry<T extends Entity> {\n filter: FilterAndSettings<T>;\n query: ParsedFindQuery;\n bindings: any[];\n findSettings: any;\n limit: number | undefined;\n offset: number | undefined;\n}\n\n/** Returns a dataloader that batches paginated finds by applying pagination inside each lateral subquery. */\nexport function findPaginatedDataLoader<T extends Entity>(\n em: EntityManager,\n type: MaybeAbstractEntityConstructor<T>,\n filter: FilterAndSettings<T>,\n hint: LoadHint<T> | undefined,\n): Promise<T[]> {\n const { where, limit, offset, ...opts } = filter;\n const meta = getMetadata(type);\n const query = parseFindQuery(meta, where, opts);\n const { findSettings } = em[\"prepareFind\"](meta, findOperation, query, { ...opts, limit, offset, checkLimit: false });\n if (isQueryProvablyEmpty(query)) return Promise.resolve([]);\n\n const bindings: any[] = [];\n collectValues(bindings, query);\n const prepared = {\n filter,\n query,\n bindings,\n findSettings,\n limit: findSettings.limit,\n offset: findSettings.offset,\n };\n const batchKey = [\n getBatchKeyFromGenericStructure(meta, query),\n hintKey(hint),\n findSettings.limit,\n findSettings.offset,\n ].join(\"-\");\n\n return em\n .getLoader<PreparedPaginatedFindEntry<T>, T[]>(\n findOperation,\n batchKey,\n async (entries) => {\n if (entries.length === 1) {\n // Skip batching & just execute the query as-is\n const { query, findSettings } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n const rows = await em[\"executePreparedFind\"](meta, findOperation, query, findSettings, false);\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n return [filterDeletedEntities(em, entities)];\n }\n\n const { query, findSettings, limit, offset } = entries[0];\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator = preloader && hint && preloader.addPreloading(meta, buildHintTree(hint), query);\n\n // Now craft the actual batched query\n const args = collectAndReplaceArgs(query, entries);\n const argsColumns = [{ columnName: \"tag\", dbType: \"int\" }, ...args.map((a) => a.column)];\n const columnValues = createColumnValuesFromPrepared(args, entries);\n const query2: ParsedFindQuery = {\n selects: [\"_find.tag as tag\", \"_data.*\"],\n tables: [\n { join: \"primary\", table: \"_find\", alias: \"_find\" },\n {\n join: \"lateral\",\n query,\n table: meta.tableName,\n alias: \"_data\",\n fromAlias: \"_find\",\n settings: { limit, offset },\n },\n ],\n ctes: [buildUnnestCte(\"_find\", argsColumns, columnValues)],\n orderBys: [],\n };\n\n const rows = await em[\"executePreparedFind\"](\n meta,\n findOperation,\n query2,\n { ...findSettings, limit: undefined, offset: undefined },\n false,\n );\n const entities = em.hydrate(type, rows);\n preloadHydrator?.(rows, entities);\n\n const results = entries.map(() => [] as T[]);\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n const entity = entities[i];\n if (!entity.isDeletedEntity) {\n results[row.tag].push(entity);\n }\n delete row.tag;\n }\n return results;\n },\n { cacheKeyFn: queryFilterHash },\n )\n .load(prepared);\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAAgB,wBACd,IACA,MACA,QACA,MACc;CACd,MAAM,EAAE,OAAO,OAAO,QAAQ,GAAG,SAAS;CAC1C,MAAM,OAAO,YAAY,IAAI;CAC7B,MAAM,QAAQ,eAAe,MAAM,OAAO,IAAI;CAC9C,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,MAAM,eAAe,OAAO;EAAE,GAAG;EAAM;EAAO;EAAQ,YAAY;CAAM,CAAC;CACpH,IAAI,qBAAqB,KAAK,GAAG,OAAO,QAAQ,QAAQ,CAAC,CAAC;CAE1D,MAAM,WAAkB,CAAC;CACzB,cAAc,UAAU,KAAK;CAC7B,MAAM,WAAW;EACf;EACA;EACA;EACA;EACA,OAAO,aAAa;EACpB,QAAQ,aAAa;CACvB;CACA,MAAM,WAAW;EACf,gCAAgC,MAAM,KAAK;EAC3C,QAAQ,IAAI;EACZ,aAAa;EACb,aAAa;CACf,CAAC,CAAC,KAAK,GAAG;CAEV,OAAO,GACJ,UACC,eACA,UACA,OAAO,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UAAU,QAAQ,UAAU,CAAC,CAAQ;EAC3C,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;GACpC,MAAM,MAAM,KAAK;GACjB,MAAM,SAAS,SAAS;GACxB,IAAI,CAAC,OAAO,iBACV,QAAQ,IAAI,IAAI,CAAC,KAAK,MAAM;GAE9B,OAAO,IAAI;EACb;EACA,OAAO;CACT,GACA,EAAE,YAAY,gBAAgB,CAChC,CAAC,CACA,KAAK,QAAQ;AAClB"}
package/build/index.cjs CHANGED
@@ -68,6 +68,10 @@ const require_preloading_partitionHint = require("./preloading/partitionHint.cjs
68
68
  const require_queries_find_EntityGraphQLFilter = require("./queries/find/EntityGraphQLFilter.cjs");
69
69
  const require_queries_renderConditions = require("./queries/renderConditions.cjs");
70
70
  const require_queries_sql_AliasAssigner = require("./queries/sql/AliasAssigner.cjs");
71
+ const require_serde_columns = require("./serde/columns.cjs");
72
+ const require_serde_temporalMappers = require("./serde/temporalMappers.cjs");
73
+ const require_serde_serde = require("./serde/serde.cjs");
74
+ const require_queries_sql_custom = require("./queries/sql/custom.cjs");
71
75
  const require_queries_sql_Tables = require("./queries/sql/Tables.cjs");
72
76
  const require_queries_find_EntityFilter = require("./queries/find/EntityFilter.cjs");
73
77
  const require_queries_sql_expressions_expression = require("./queries/sql/expressions/expression.cjs");
@@ -77,7 +81,6 @@ const require_PluginManager = require("./PluginManager.cjs");
77
81
  const require_queries_find_buildFindQuery = require("./queries/find/buildFindQuery.cjs");
78
82
  const require_queries_find_QueryParser_collectionJoins = require("./queries/find/QueryParser.collectionJoins.cjs");
79
83
  const require_flush_Todo = require("./flush/Todo.cjs");
80
- const require_serde_temporalMappers = require("./serde/temporalMappers.cjs");
81
84
  const require_queries_unnest = require("./queries/unnest.cjs");
82
85
  const require_drivers_EntityWriter = require("./drivers/EntityWriter.cjs");
83
86
  const require_drivers_driverApi = require("./drivers/driverApi.cjs");
@@ -90,8 +93,6 @@ const require_plugins_ImmutableEntitiesPlugin = require("./plugins/ImmutableEnti
90
93
  const require_preloading_JsonAggregatePreloader = require("./preloading/JsonAggregatePreloader.cjs");
91
94
  const require_queries_sql_query = require("./queries/sql/query.cjs");
92
95
  const require_nowUTC = require("./nowUTC.cjs");
93
- const require_serde_serde = require("./serde/serde.cjs");
94
- const require_serde_columns = require("./serde/columns.cjs");
95
96
  const require_upsert = require("./upsert.cjs");
96
97
  const require_loading_withLoaded = require("./loading/withLoaded.cjs");
97
98
  const require_EntityManager = require("./EntityManager.cjs");
@@ -280,6 +281,7 @@ exports.convertToLoadHint = require_reactivity_reactiveHints.convertToLoadHint;
280
281
  exports.createRowFromEntityData = require_EntityManager.createRowFromEntityData;
281
282
  exports.deTagId = require_keys.deTagId;
282
283
  exports.deTagIds = require_keys.deTagIds;
284
+ exports.declareTable = require_queries_sql_custom.declareTable;
283
285
  exports.deepNormalizeHint = require_normalizeHints.deepNormalizeHint;
284
286
  exports.defaultValue = require_newTestInstance.defaultValue;
285
287
  exports.driverAfterBegin = require_EntityManager.driverAfterBegin;
@@ -504,6 +506,7 @@ exports.tables = require_queries_sql_Tables.tables;
504
506
  exports.tagFromId = require_keys.tagFromId;
505
507
  exports.tagId = require_keys.tagId;
506
508
  exports.tagIds = require_keys.tagIds;
509
+ exports.taggedIdPrefix = require_keys.taggedIdPrefix;
507
510
  exports.testIndex = require_newTestInstance.testIndex;
508
511
  exports.testing = testing;
509
512
  exports.toIdOf = require_keys.toIdOf;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["getMetadata","getProperties","getBaseMeta","getField","AbstractRelationImpl","isLazyField","isProperty","isAsyncProperty","isReactiveGetter","isReactiveField","isAsyncReactiveField","FactoryInitialValue","ReactiveFieldImpl","AsyncReactiveFieldImpl","getInstanceData"],"sources":["../src/index.ts"],"sourcesContent":["import { getInstanceData } from \"src/BaseEntity.ts\";\nimport { getDefaultDependencies } from \"src/defaults.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityConstructor, type MaybeAbstractEntityConstructor } from \"src/EntityManager.ts\";\nimport { type EntityMetadata, getBaseMeta, getMetadata } from \"src/EntityMetadata.ts\";\nimport { getField, setField } from \"src/fields.ts\";\nimport { getProperties } from \"src/getProperties.ts\";\nimport type { New } from \"src/loading/loadHints.ts\";\nimport { isAllSqlPaths } from \"src/loading/loadLens.ts\";\nimport { FactoryInitialValue } from \"src/newTestInstance.ts\";\nimport { partitionHint } from \"src/preloading/partitionHint.ts\";\nimport { buildWhereClause } from \"src/queries/renderConditions.ts\";\nimport { AbstractRelationImpl } from \"src/relations/AbstractRelationImpl.ts\";\nimport { AsyncReactiveFieldImpl } from \"src/relations/AsyncReactiveField.ts\";\nimport {\n isAsyncProperty,\n isAsyncReactiveField,\n isLazyField,\n isProperty,\n isReactiveField,\n isReactiveGetter,\n} from \"src/relations/index.ts\";\nimport { ReactiveFieldImpl } from \"src/relations/ReactiveField.ts\";\nimport { type OptsOf } from \"src/typeMap.ts\";\nimport { fail } from \"src/utils.ts\";\n\nexport const testing = { isAllSqlPaths, getDefaultDependencies, partitionHint };\nexport const internals = { buildWhereClause };\nexport { newPgConnectionConfig } from \"joist-utils\";\nexport { AliasAssigner } from \"src/queries/sql/AliasAssigner.ts\";\nexport {\n type AndCondition,\n type ConditionGroup,\n type DomainPredicate,\n type OrCondition,\n type PredicateBrand,\n type SqlCondition,\n type SqlPredicate,\n} from \"src/queries/conditions.ts\";\n// Domain aliases belong to em.find; physical table expressions belong to em.query/em.execute.\nexport {\n alias,\n aliases,\n getAliasMetadata,\n getAliasMgmt,\n getMaybeCtiAlias,\n isAlias,\n newAliasProxy,\n type Alias,\n type AliasBrand,\n type AliasMgmt,\n type AliasColumn,\n type EntityAlias,\n type PolyAlias,\n type PrimitiveAlias,\n} from \"src/queries/find/Aliases.ts\";\nexport {\n table,\n tables,\n tableMgmt,\n getTableMetadata,\n getTableMgmt,\n isTable,\n newTableProxy,\n type Table,\n type TableFilter,\n type TableBrand,\n type TableFor,\n type TableMgmt,\n type ReferenceJoin,\n type PrimitiveColumn,\n type EntityColumn,\n type ReferenceColumn,\n type CollectionJoin,\n type PolyReference,\n} from \"src/queries/sql/Tables.ts\";\nexport { BaseEntity, getInstanceData } from \"src/BaseEntity.ts\";\nexport { ConditionBuilder } from \"src/queries/ConditionBuilder.ts\";\nexport { type Entity, type IdType, isEntity } from \"src/Entity.ts\";\nexport type * from \"src/EntityFields.ts\";\nexport * from \"src/queries/find/EntityFilter.ts\";\nexport * from \"src/queries/find/EntityGraphQLFilter.ts\";\nexport * from \"src/EntityManager.ts\";\nexport * from \"src/EntityMetadata.ts\";\nexport type {\n DeleteStatement,\n ExecuteResult,\n InsertStatement,\n InsertValues,\n MutationReturning,\n MutationStatement,\n UpdateStatement,\n UpdateValues,\n} from \"src/queries/sql/execute.ts\";\nexport type { EnumMetadata } from \"src/EnumMetadata.ts\";\n// `em.query`'s expression surface. Only the user-facing types are re-exported: the runtime half\n// (BaseExpr, asNode, deferredCondition, the FnExpr/TemplateExpr node classes) stays internal to\n// joist-core, so `toSql`/`decode`/`encode` never show up as something a user could call.\nexport {\n type ArrayAggOptions,\n type Expr,\n type ExprBrand,\n exprBrand,\n type ExprLike,\n type InnerJoin,\n type LeftJoin,\n} from \"src/queries/sql/Expr.ts\";\nexport {\n expr,\n type CaseElse,\n type CaseWhen,\n type ExprFromInput,\n type ExprInput,\n} from \"src/queries/sql/expressions/expression.ts\";\nexport { skipCondition } from \"src/queries/skipCondition.ts\";\nexport type { EntityOrId, HintNode } from \"src/loading/HintTree.ts\";\nexport { InstanceData } from \"src/InstanceData.ts\";\nexport { type JoinColumnValue, type JoinRow, JoinRowOperation, type ManyToManyLike } from \"src/flush/JoinRows.ts\";\nexport type * from \"src/flush/PendingChanges.ts\";\nexport { Plugin } from \"src/PluginManager.ts\";\nexport * from \"src/queries/find/QueryParser.ts\";\nexport * from \"src/queries/find/buildFindQuery.ts\";\nexport * from \"src/queries/renderConditions.ts\";\nexport type {\n ColumnCondition,\n ExistsCondition,\n ParsedExpressionCondition,\n ParsedExpressionFilter,\n ParsedValueFilter,\n RawCondition,\n} from \"src/queries/parsedConditions.ts\";\nexport {\n type ParsedEntityFilter,\n makeLike,\n mapToDb,\n parseEntityFilter,\n parseValueFilter,\n} from \"src/queries/valueFilters.ts\";\nexport {\n filterSoftDeletes,\n lazyExcludedSelects,\n maybeAddNotSoftDeleted,\n stiSubtypeFilter,\n} from \"src/queries/entityQueryUtils.ts\";\nexport * from \"src/queries/find/QueryParser.collectionJoins.ts\";\nexport { visitConditions } from \"src/queries/find/QueryVisitor.ts\";\nexport * from \"src/RowData.ts\";\nexport { type JoinRowTodo, Todo } from \"src/flush/Todo.ts\";\nexport * from \"src/changes.ts\";\nexport { ConfigApi, type EntityHook, resetBootFlag } from \"src/config.ts\";\nexport {\n configureMetadata,\n getConstructorFromTaggedId,\n getMetadataForTable,\n getMetadataForType,\n maybeGetConstructorFromReference,\n} from \"src/configure.ts\";\nexport { driverApi } from \"src/drivers/driverApi.ts\";\nexport * from \"src/drivers/index.ts\";\nexport { getField, isChangeableField, isFieldSet, setField } from \"src/fields.ts\";\nexport * from \"src/getProperties.ts\";\nexport * from \"src/json.ts\";\nexport * from \"src/keys.ts\";\nexport { kq, kqDot, kqStar } from \"src/queries/sql/keywords.ts\";\nexport {\n assertLoaded,\n type DeepNew,\n ensureLoaded,\n isLoaded,\n isNew,\n type Loadable,\n type Loaded,\n type LoadHint,\n type MarkLoaded,\n maybePopulateThen,\n type NestedLoadHint,\n type New,\n type RelationsIn,\n unsafeLoaded,\n} from \"src/loading/loadHints.ts\";\nexport * from \"src/loading/loadLens.ts\";\nexport { setFactoryWriter } from \"src/logging/FactoryLogger.ts\";\nexport * from \"src/logging/FieldLogger.ts\";\nexport { ReactionLogger, setReactionLogging } from \"src/logging/ReactionLogger.ts\";\nexport { lazyField } from \"src/newEntity.ts\";\nexport {\n defaultValue,\n factories,\n type FactoryEntityOpt,\n type FactoryOpts,\n getTestIndex,\n isFactoryCreation,\n maybeBranchValue,\n maybeNew,\n maybeNewPoly,\n newTestInstance,\n noValue,\n setFactoryLogging,\n testIndex,\n} from \"src/newTestInstance.ts\";\nexport { deepNormalizeHint, normalizeHint } from \"src/normalizeHints.ts\";\nexport { ImmutableEntitiesPlugin } from \"src/plugins/ImmutableEntitiesPlugin.ts\";\nexport type { JoinResult, PreloadHydrator, PreloadPlugin } from \"src/plugins/PreloadPlugin.ts\";\nexport { JsonAggregatePreloader } from \"src/preloading/JsonAggregatePreloader.ts\";\n// `em.query`'s query surface; the parse pipeline (SubqueryHandle, parseUserQuery, Plan) stays internal\nexport {\n type CheckScope,\n type Clauses,\n type EntityQuery,\n type ExpressionOrderBy,\n type ExistsQuery,\n entityQueryBrand,\n type MaybeNull,\n type NameOf,\n type NotWidened,\n type OrderByDirection,\n type OrderByKeys,\n type Query,\n type QueryArg,\n type QueryCondition,\n type QueryJoin,\n type QueryJoins,\n type QueryRow,\n type QuerySelect,\n type QuerySource,\n type QueryValue,\n recursiveQuery,\n type RecursiveOptions,\n type ScalarQuery,\n type SetQuery,\n query,\n queryMaybe,\n sql,\n type Subquery,\n type SubqueryBrand,\n subqueryBrand,\n type WithInput,\n type WithSource,\n} from \"src/queries/sql/query.ts\";\nexport {\n convertToLoadHint,\n isTypeOrSubType,\n type Reactable,\n type Reacted,\n type ReactiveHint,\n type ReactiveTarget,\n reverseReactiveHint,\n} from \"src/reactivity/reactiveHints.ts\";\nexport * from \"src/relations/index.ts\";\nexport {\n cannotBeChanged,\n cannotBeUpdated,\n type GenericError,\n maxValueRule,\n minValueRule,\n mustBeSubType,\n newRequiredLazyFieldRule,\n newRequiredRule,\n rangeValueRule,\n ValidationCode,\n type ValidationError,\n ValidationErrors,\n type ValidationRule,\n type ValidationRuleInternal,\n type ValidationRuleResult,\n} from \"src/rules.ts\";\nexport { getRuntimeConfig, setRuntimeConfig, type RuntimeConfig } from \"src/runtimeConfig.ts\";\nexport { nowUTC } from \"src/nowUTC.ts\";\nexport * from \"src/serde/serde.ts\";\nexport * from \"src/serde/columns.ts\";\nexport * from \"src/serde/fieldSerde.ts\";\nexport * from \"src/queries/find/scopes.ts\";\nexport { maybeRequireTemporal, requireTemporal, Temporal } from \"src/serde/temporal.ts\";\nexport * from \"src/serde/temporalMappers.ts\";\nexport { isInTrustedContext, runInTrustedContext } from \"src/trusted.ts\";\nexport type * from \"src/typeMap.ts\";\nexport { buildUnnestCte, ensureRectangularArraySizes } from \"src/queries/unnest.ts\";\nexport { type DeepPartialOrNull, updatePartial, upsert } from \"src/upsert.ts\";\nexport {\n abbreviation,\n asNew,\n assertNever,\n cleanSql,\n cleanStringValue,\n fail,\n failIfAnyRejected,\n indexBy,\n partition,\n zeroTo,\n} from \"src/utils.ts\";\nexport { ensureWithLoaded, StubbedRelation, type WithLoaded, withLoaded } from \"src/loading/withLoaded.ts\";\n\n// https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/\ninterface Flavoring<FlavorT> {\n _type?: FlavorT;\n}\n\nexport type Flavor<T, FlavorT> = T & Flavoring<FlavorT>;\n\n/**\n * Sets each value in `values` on the current entity.\n *\n * The default behavior is that passing a value as either `null` or `undefined` will set\n * the field as `undefined`, i.e. automatic `null` to `undefined` conversion.\n *\n * However, if you pass `ignoreUndefined: true`, then any opt that is `undefined` will be treated\n * as \"do not set\", and `null` will still mean \"set to `undefined`\". This is useful for implementing\n * APIs were an input of `undefined` means \"do not set / noop\" and `null` means \"unset\".\n *\n * Note that constructors _always_ call this method, but if the call is coming from `em.hydrate`, we\n * use `values` being a primary key to short-circuit and let hydration callers assign the values\n * returned by the serde `fromRow` methods.\n */\nexport function setOpts<T extends Entity>(\n entity: T,\n values: Partial<OptsOf<T>> | undefined,\n opts?: { partial?: boolean; calledFromConstructor?: boolean },\n): void {\n const { calledFromConstructor = false, partial } = opts || {};\n // If `values` is undefined, we're being called by `createPartial` that will do its\n // own opt handling, but we still want the sync defaults applied after this opts handling.\n if (values !== undefined) {\n const meta = getMetadata(entity);\n for (const [key, _value] of Object.entries(values as {})) {\n setOpt(meta, entity, key, _value, partial, calledFromConstructor);\n }\n }\n}\n\n/**\n * Applies some standard behavior & protections to `entity[key] = value`. I.e.\n *\n * - We don't set over AsyncProperties/relations/etc., and instead call current.set(value)\n * - We catch missing/invalid field names\n * - We handle FactoryInitialValues\n */\nexport function setOpt<T extends Entity>(\n meta: EntityMetadata<T>,\n entity: T,\n key: string,\n _value: any,\n partial = false,\n calledFromConstructor = false,\n): void {\n const field = meta.allFields[key];\n if (!field) {\n // Allow setting non-field properties like fullName setters\n const prop = getProperties(meta)[key];\n if (!prop) {\n throw new Error(`Unknown field ${key}`);\n }\n }\n\n // If partial is set, we treat undefined as a noop\n if (partial && _value === undefined) return;\n // Ignore the STI discriminator, em.register will set this accordingly\n if (meta.inheritanceType === \"sti\" && getBaseMeta(meta).stiDiscriminatorField === key) return;\n\n // We let optional opts fields be `| null` for convenience, and convert to undefined.\n const value = _value === null ? undefined : _value;\n\n // Use `getField` to side-step `id` blowing up on new entities that are setting an\n // explicit id; otherwise use `entity[key]` to get back the relation.\n const current = key === \"id\" ? getField(entity, key) : (entity as any)[key];\n\n if (current instanceof AbstractRelationImpl) {\n if (calledFromConstructor) {\n current.setFromOpts(value);\n } else {\n current.set(value);\n }\n } else if (isLazyField(current)) {\n current.set(value);\n } else if (isProperty(current) || isAsyncProperty(current) || isReactiveGetter(current)) {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n } else if (isReactiveField(current) || isAsyncReactiveField(current)) {\n if (value instanceof FactoryInitialValue) {\n if (current instanceof ReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else if (current instanceof AsyncReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else {\n throw new Error(`Unhandled case ${current.constructor.name}`);\n }\n } else {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n }\n } else {\n // If setting an explicit id, go through setField, otherwise use\n // `entity[key]` to set the value directly to that we go through setters.\n if (key === \"id\" && entity.isNewEntity) {\n setField(entity, key, value);\n } else {\n (entity as any)[key] = value;\n }\n }\n}\n\nexport function ensureNotDeleted(entity: Entity, ignore?: \"pending\"): void {\n if (entity.isDeletedEntity && (ignore === undefined || getInstanceData(entity).isDeletedAndFlushed)) {\n fail(`${entity} is marked as deleted`);\n }\n}\n\n/** Adds `null` to every key in `T` to accept partial-update-style input. */\nexport type PartialOrNull<T> = {\n [P in keyof T]?: T[P] | null;\n};\n\nexport function getRequiredKeys<T extends Entity>(entity: T): string[];\nexport function getRequiredKeys<T extends Entity>(type: EntityConstructor<T>): string[];\nexport function getRequiredKeys<T extends Entity>(entityOrType: T | EntityConstructor<T>): string[] {\n return Object.values(getMetadata(entityOrType as any).fields)\n .filter((f) => f.required)\n .map((f) => f.fieldName);\n}\n\nexport function getRelations(entity: Entity): AbstractRelationImpl<any, any>[] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => (entity as any)[name]);\n}\n\nexport function getRelationEntries(entity: Entity): [string, AbstractRelationImpl<any, any>][] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => [name, (entity as any)[name]]);\n}\n\n/** Casts a \"maybe abstract\" cstr to a concrete cstr when the calling code knows it's safe. */\nexport function asConcreteCstr<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): EntityConstructor<T> {\n return cstr as any;\n}\n\n/**\n * Thrown when `.id` is accessed on an entity that does not have an id yet.\n *\n * For Postgres, entities are actually allowed to have ids pre-INSERT, if you call\n * `em.assignNewIds()`. Other databases typically require INSERTs to trigger the auto\n * id assignment.\n */\nexport class NoIdError extends Error {}\n\n/** Throws a `NoIdError` for `entity`, i.e. because `id` was called before being saved. */\nexport function failNoIdYet(entity: string): never {\n throw new NoIdError(`${entity} has no id yet`);\n}\n\n/**\n * Add a static function since getters can't have type guards.\n *\n * See https://github.com/microsoft/TypeScript/issues/43368\n */\nexport function isNewEntity<T ext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AAM,CAAC,CAAC,CAAC,CACtD,QAAQ,GAAG,OAAO,aAAaI,uCAAAA,oBAAoB,CAAC,CACpD,KAAK,CAAC,UAAU,CAAC,MAAO,OAAe,KAAK,CAAC;AAClD;;AAGA,SAAgB,eAAiC,MAA+D;CAC9G,OAAO;AACT;;;;;;;;AASA,IAAa,YAAb,cAA+B,MAAM,CAAC;;AAGtC,SAAgB,YAAY,QAAuB;CACjD,MAAM,IAAI,UAAU,GAAG,OAAO,eAAe;AAC/C;;;;;;AAOA,SAAgB,YAA8B,QAA6B;CACzE,OAAO,OAAO;AAChB"}
1
+ {"version":3,"file":"index.cjs","names":["getMetadata","getProperties","getBaseMeta","getField","AbstractRelationImpl","isLazyField","isProperty","isAsyncProperty","isReactiveGetter","isReactiveField","isAsyncReactiveField","FactoryInitialValue","ReactiveFieldImpl","AsyncReactiveFieldImpl","getInstanceData"],"sources":["../src/index.ts"],"sourcesContent":["import { getInstanceData } from \"src/BaseEntity.ts\";\nimport { getDefaultDependencies } from \"src/defaults.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityConstructor, type MaybeAbstractEntityConstructor } from \"src/EntityManager.ts\";\nimport { type EntityMetadata, getBaseMeta, getMetadata } from \"src/EntityMetadata.ts\";\nimport { getField, setField } from \"src/fields.ts\";\nimport { getProperties } from \"src/getProperties.ts\";\nimport type { New } from \"src/loading/loadHints.ts\";\nimport { isAllSqlPaths } from \"src/loading/loadLens.ts\";\nimport { FactoryInitialValue } from \"src/newTestInstance.ts\";\nimport { partitionHint } from \"src/preloading/partitionHint.ts\";\nimport { buildWhereClause } from \"src/queries/renderConditions.ts\";\nimport { AbstractRelationImpl } from \"src/relations/AbstractRelationImpl.ts\";\nimport { AsyncReactiveFieldImpl } from \"src/relations/AsyncReactiveField.ts\";\nimport {\n isAsyncProperty,\n isAsyncReactiveField,\n isLazyField,\n isProperty,\n isReactiveField,\n isReactiveGetter,\n} from \"src/relations/index.ts\";\nimport { ReactiveFieldImpl } from \"src/relations/ReactiveField.ts\";\nimport { type OptsOf } from \"src/typeMap.ts\";\nimport { fail } from \"src/utils.ts\";\n\nexport const testing = { isAllSqlPaths, getDefaultDependencies, partitionHint };\nexport const internals = { buildWhereClause };\nexport { newPgConnectionConfig } from \"joist-utils\";\nexport { AliasAssigner } from \"src/queries/sql/AliasAssigner.ts\";\nexport type { JoinTree } from \"src/queries/sql/JoinTree.ts\";\nexport {\n type AndCondition,\n type ConditionGroup,\n type DomainPredicate,\n type OrCondition,\n type PredicateBrand,\n type SqlCondition,\n type SqlPredicate,\n} from \"src/queries/conditions.ts\";\n// Domain aliases belong to em.find; physical table expressions belong to em.query/em.execute.\nexport {\n alias,\n aliases,\n getAliasMetadata,\n getAliasMgmt,\n getMaybeCtiAlias,\n isAlias,\n newAliasProxy,\n type Alias,\n type AliasBrand,\n type AliasMgmt,\n type AliasColumn,\n type EntityAlias,\n type PolyAlias,\n type PrimitiveAlias,\n} from \"src/queries/find/Aliases.ts\";\nexport {\n table,\n tables,\n tableMgmt,\n getTableMetadata,\n getTableMgmt,\n isTable,\n newTableProxy,\n type Table,\n type TableFilter,\n type TableBrand,\n type TableSourceBrand,\n type TableFor,\n type TableMgmt,\n type TableSourceMgmt,\n type ReferenceJoin,\n type PrimitiveColumn,\n type EntityColumn,\n type ReferenceColumn,\n type CollectionJoin,\n type PolyReference,\n} from \"src/queries/sql/Tables.ts\";\nexport {\n declareTable,\n type CustomColumnConfig,\n type CustomColumnInput,\n type CustomColumnInputs,\n type CustomColumnType,\n type CustomTable,\n type CustomTableDefinition,\n type CustomTableFor,\n} from \"src/queries/sql/custom.ts\";\nexport { BaseEntity, getInstanceData } from \"src/BaseEntity.ts\";\nexport { ConditionBuilder } from \"src/queries/ConditionBuilder.ts\";\nexport { type Entity, type IdType, isEntity } from \"src/Entity.ts\";\nexport type * from \"src/EntityFields.ts\";\nexport * from \"src/queries/find/EntityFilter.ts\";\nexport * from \"src/queries/find/EntityGraphQLFilter.ts\";\nexport * from \"src/EntityManager.ts\";\nexport * from \"src/EntityMetadata.ts\";\nexport type {\n DeleteStatement,\n ExecuteResult,\n InsertStatement,\n InsertValues,\n MutationReturning,\n MutationStatement,\n UpdateStatement,\n UpdateValues,\n} from \"src/queries/sql/execute.ts\";\nexport type { EnumMetadata } from \"src/EnumMetadata.ts\";\n// `em.query`'s expression surface. Only the user-facing types are re-exported: the runtime half\n// (BaseExpr, asNode, deferredCondition, the FnExpr/TemplateExpr node classes) stays internal to\n// joist-core, so `toSql`/`decode`/`encode` never show up as something a user could call.\nexport {\n type ArrayAggOptions,\n type Expr,\n type ExprBrand,\n exprBrand,\n type ExprLike,\n type InnerJoin,\n type LeftJoin,\n} from \"src/queries/sql/Expr.ts\";\nexport {\n expr,\n type CaseElse,\n type CaseWhen,\n type ExprFromInput,\n type ExprInput,\n} from \"src/queries/sql/expressions/expression.ts\";\nexport { skipCondition } from \"src/queries/skipCondition.ts\";\nexport type { EntityOrId, HintNode } from \"src/loading/HintTree.ts\";\nexport { InstanceData } from \"src/InstanceData.ts\";\nexport { type JoinColumnValue, type JoinRow, JoinRowOperation, type ManyToManyLike } from \"src/flush/JoinRows.ts\";\nexport type * from \"src/flush/PendingChanges.ts\";\nexport { Plugin } from \"src/PluginManager.ts\";\nexport * from \"src/queries/find/QueryParser.ts\";\nexport * from \"src/queries/find/buildFindQuery.ts\";\nexport * from \"src/queries/renderConditions.ts\";\nexport type {\n ColumnCondition,\n ExistsCondition,\n ParsedExpressionCondition,\n ParsedExpressionFilter,\n ParsedValueFilter,\n RawCondition,\n} from \"src/queries/parsedConditions.ts\";\nexport {\n type ParsedEntityFilter,\n makeLike,\n mapToDb,\n parseEntityFilter,\n parseValueFilter,\n} from \"src/queries/valueFilters.ts\";\nexport {\n filterSoftDeletes,\n lazyExcludedSelects,\n maybeAddNotSoftDeleted,\n stiSubtypeFilter,\n} from \"src/queries/entityQueryUtils.ts\";\nexport * from \"src/queries/find/QueryParser.collectionJoins.ts\";\nexport { visitConditions } from \"src/queries/find/QueryVisitor.ts\";\nexport * from \"src/RowData.ts\";\nexport { type JoinRowTodo, Todo } from \"src/flush/Todo.ts\";\nexport * from \"src/changes.ts\";\nexport { ConfigApi, type EntityHook, resetBootFlag } from \"src/config.ts\";\nexport {\n configureMetadata,\n getConstructorFromTaggedId,\n getMetadataForTable,\n getMetadataForType,\n maybeGetConstructorFromReference,\n} from \"src/configure.ts\";\nexport { driverApi } from \"src/drivers/driverApi.ts\";\nexport * from \"src/drivers/index.ts\";\nexport { getField, isChangeableField, isFieldSet, setField } from \"src/fields.ts\";\nexport * from \"src/getProperties.ts\";\nexport * from \"src/json.ts\";\nexport * from \"src/keys.ts\";\nexport { kq, kqDot, kqStar } from \"src/queries/sql/keywords.ts\";\nexport {\n assertLoaded,\n type DeepNew,\n ensureLoaded,\n isLoaded,\n isNew,\n type Loadable,\n type Loaded,\n type LoadHint,\n type MarkLoaded,\n maybePopulateThen,\n type NestedLoadHint,\n type New,\n type RelationsIn,\n unsafeLoaded,\n} from \"src/loading/loadHints.ts\";\nexport * from \"src/loading/loadLens.ts\";\nexport { setFactoryWriter } from \"src/logging/FactoryLogger.ts\";\nexport * from \"src/logging/FieldLogger.ts\";\nexport { ReactionLogger, setReactionLogging } from \"src/logging/ReactionLogger.ts\";\nexport { lazyField } from \"src/newEntity.ts\";\nexport {\n defaultValue,\n factories,\n type FactoryEntityOpt,\n type FactoryOpts,\n getTestIndex,\n isFactoryCreation,\n maybeBranchValue,\n maybeNew,\n maybeNewPoly,\n newTestInstance,\n noValue,\n setFactoryLogging,\n testIndex,\n} from \"src/newTestInstance.ts\";\nexport { deepNormalizeHint, normalizeHint } from \"src/normalizeHints.ts\";\nexport { ImmutableEntitiesPlugin } from \"src/plugins/ImmutableEntitiesPlugin.ts\";\nexport type { JoinResult, PreloadHydrator, PreloadPlugin } from \"src/plugins/PreloadPlugin.ts\";\nexport { JsonAggregatePreloader } from \"src/preloading/JsonAggregatePreloader.ts\";\n// `em.query`'s query surface; the parse pipeline (SubqueryHandle, parseUserQuery, Plan) stays internal\nexport {\n type CheckScope,\n type Clauses,\n type EntityQuery,\n type ExpressionOrderBy,\n type ExistsQuery,\n entityQueryBrand,\n type MaybeNull,\n type NameOf,\n type NotWidened,\n type OrderByDirection,\n type OrderByKeys,\n type Query,\n type QueryArg,\n type QueryCondition,\n type QueryJoin,\n type QueryJoinInput,\n type QueryJoinList,\n type QueryRow,\n type QuerySelect,\n type QuerySource,\n type QueryValue,\n recursiveQuery,\n type RecursiveOptions,\n type ResolvedJoins,\n type ScalarQuery,\n type SetQuery,\n query,\n queryMaybe,\n sql,\n type Subquery,\n type SubqueryBrand,\n subqueryBrand,\n type WithInput,\n type WithSource,\n} from \"src/queries/sql/query.ts\";\nexport {\n convertToLoadHint,\n isTypeOrSubType,\n type Reactable,\n type Reacted,\n type ReactiveHint,\n type ReactiveTarget,\n reverseReactiveHint,\n} from \"src/reactivity/reactiveHints.ts\";\nexport * from \"src/relations/index.ts\";\nexport {\n cannotBeChanged,\n cannotBeUpdated,\n type GenericError,\n maxValueRule,\n minValueRule,\n mustBeSubType,\n newRequiredLazyFieldRule,\n newRequiredRule,\n rangeValueRule,\n ValidationCode,\n type ValidationError,\n ValidationErrors,\n type ValidationRule,\n type ValidationRuleInternal,\n type ValidationRuleResult,\n} from \"src/rules.ts\";\nexport { getRuntimeConfig, setRuntimeConfig, type RuntimeConfig } from \"src/runtimeConfig.ts\";\nexport { nowUTC } from \"src/nowUTC.ts\";\nexport * from \"src/serde/serde.ts\";\nexport * from \"src/serde/columns.ts\";\nexport * from \"src/serde/fieldSerde.ts\";\nexport * from \"src/queries/find/scopes.ts\";\nexport { maybeRequireTemporal, requireTemporal, Temporal } from \"src/serde/temporal.ts\";\nexport * from \"src/serde/temporalMappers.ts\";\nexport { isInTrustedContext, runInTrustedContext } from \"src/trusted.ts\";\nexport type * from \"src/typeMap.ts\";\nexport { buildUnnestCte, ensureRectangularArraySizes } from \"src/queries/unnest.ts\";\nexport { type DeepPartialOrNull, updatePartial, upsert } from \"src/upsert.ts\";\nexport {\n abbreviation,\n asNew,\n assertNever,\n cleanSql,\n cleanStringValue,\n fail,\n failIfAnyRejected,\n indexBy,\n partition,\n zeroTo,\n} from \"src/utils.ts\";\nexport { ensureWithLoaded, StubbedRelation, type WithLoaded, withLoaded } from \"src/loading/withLoaded.ts\";\n\n// https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/\ninterface Flavoring<FlavorT> {\n _type?: FlavorT;\n}\n\nexport type Flavor<T, FlavorT> = T & Flavoring<FlavorT>;\n\n/**\n * Sets each value in `values` on the current entity.\n *\n * The default behavior is that passing a value as either `null` or `undefined` will set\n * the field as `undefined`, i.e. automatic `null` to `undefined` conversion.\n *\n * However, if you pass `ignoreUndefined: true`, then any opt that is `undefined` will be treated\n * as \"do not set\", and `null` will still mean \"set to `undefined`\". This is useful for implementing\n * APIs were an input of `undefined` means \"do not set / noop\" and `null` means \"unset\".\n *\n * Note that constructors _always_ call this method, but if the call is coming from `em.hydrate`, we\n * use `values` being a primary key to short-circuit and let hydration callers assign the values\n * returned by the serde `fromRow` methods.\n */\nexport function setOpts<T extends Entity>(\n entity: T,\n values: Partial<OptsOf<T>> | undefined,\n opts?: { partial?: boolean; calledFromConstructor?: boolean },\n): void {\n const { calledFromConstructor = false, partial } = opts || {};\n // If `values` is undefined, we're being called by `createPartial` that will do its\n // own opt handling, but we still want the sync defaults applied after this opts handling.\n if (values !== undefined) {\n const meta = getMetadata(entity);\n for (const [key, _value] of Object.entries(values as {})) {\n setOpt(meta, entity, key, _value, partial, calledFromConstructor);\n }\n }\n}\n\n/**\n * Applies some standard behavior & protections to `entity[key] = value`. I.e.\n *\n * - We don't set over AsyncProperties/relations/etc., and instead call current.set(value)\n * - We catch missing/invalid field names\n * - We handle FactoryInitialValues\n */\nexport function setOpt<T extends Entity>(\n meta: EntityMetadata<T>,\n entity: T,\n key: string,\n _value: any,\n partial = false,\n calledFromConstructor = false,\n): void {\n const field = meta.allFields[key];\n if (!field) {\n // Allow setting non-field properties like fullName setters\n const prop = getProperties(meta)[key];\n if (!prop) {\n throw new Error(`Unknown field ${key}`);\n }\n }\n\n // If partial is set, we treat undefined as a noop\n if (partial && _value === undefined) return;\n // Ignore the STI discriminator, em.register will set this accordingly\n if (meta.inheritanceType === \"sti\" && getBaseMeta(meta).stiDiscriminatorField === key) return;\n\n // We let optional opts fields be `| null` for convenience, and convert to undefined.\n const value = _value === null ? undefined : _value;\n\n // Use `getField` to side-step `id` blowing up on new entities that are setting an\n // explicit id; otherwise use `entity[key]` to get back the relation.\n const current = key === \"id\" ? getField(entity, key) : (entity as any)[key];\n\n if (current instanceof AbstractRelationImpl) {\n if (calledFromConstructor) {\n current.setFromOpts(value);\n } else {\n current.set(value);\n }\n } else if (isLazyField(current)) {\n current.set(value);\n } else if (isProperty(current) || isAsyncProperty(current) || isReactiveGetter(current)) {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n } else if (isReactiveField(current) || isAsyncReactiveField(current)) {\n if (value instanceof FactoryInitialValue) {\n if (current instanceof ReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else if (current instanceof AsyncReactiveFieldImpl) {\n current.setFactoryValue(value.value);\n } else {\n throw new Error(`Unhandled case ${current.constructor.name}`);\n }\n } else {\n throw new Error(`Invalid argument, cannot set over ${key} ${current.constructor.name}`);\n }\n } else {\n // If setting an explicit id, go through setField, otherwise use\n // `entity[key]` to set the value directly to that we go through setters.\n if (key === \"id\" && entity.isNewEntity) {\n setField(entity, key, value);\n } else {\n (entity as any)[key] = value;\n }\n }\n}\n\nexport function ensureNotDeleted(entity: Entity, ignore?: \"pending\"): void {\n if (entity.isDeletedEntity && (ignore === undefined || getInstanceData(entity).isDeletedAndFlushed)) {\n fail(`${entity} is marked as deleted`);\n }\n}\n\n/** Adds `null` to every key in `T` to accept partial-update-style input. */\nexport type PartialOrNull<T> = {\n [P in keyof T]?: T[P] | null;\n};\n\nexport function getRequiredKeys<T extends Entity>(entity: T): string[];\nexport function getRequiredKeys<T extends Entity>(type: EntityConstructor<T>): string[];\nexport function getRequiredKeys<T extends Entity>(entityOrType: T | EntityConstructor<T>): string[] {\n return Object.values(getMetadata(entityOrType as any).fields)\n .filter((f) => f.required)\n .map((f) => f.fieldName);\n}\n\nexport function getRelations(entity: Entity): AbstractRelationImpl<any, any>[] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => (entity as any)[name]);\n}\n\nexport function getRelationEntries(entity: Entity): [string, AbstractRelationImpl<any, any>][] {\n return Object.entries(getProperties(getMetadata(entity)))\n .filter(([, v]) => v instanceof AbstractRelationImpl)\n .map(([name]) => [name, (entity as any)[name]]);\n}\n\n/** Casts a \"maybe abstract\" cstr to a concrete cstr when the calling code knows it's safe. */\nexport function asConcreteCstr<T extends Entity>(cstr: MaybeAbstractEntityConstructor<T>): EntityConstructor<T> {\n return cstr as any;\n}\n\n/**\n * Thrown when `.id` is accessed on an entity that does not have an id yet.\n *\n * For Postgres, entities are actually allowed to have ids pre-INSERT, if you call\n * `em.assignNewIds()`. Other databases typically require INSERTs to trigger the auto\n * id assignment.\n */\nexport class NoIdError extends Error {}\n\n/** Throws a `NoIdError` for `entity`, i.e. because `id` was called before being saved. */\nexport function failNoIdYet(entity: string): never {\n throw new NoIdError(`${entity} has no id yet`);\n}\n\n/**\n * Add a static function since getters can't have type guards.\n *\n * See https://github.com/microsoft/TypeScript/issues/43368\n */\nexport function isNewEntity<T extends Entity>(entity: T): entity is New<T> {\n return entity.isNewEntity;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,UAAU;CAAE,eAAA,yBAAA;CAAe,wBAAA,iBAAA;CAAwB,eAAA,iCAAA;AAAc;AAC9E,MAAa,YAAY,EAAE,kBAAA,iCAAA,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;AAC/C;;;;;;AAOA,SAAgB,YAA8B,QAA6B;CACzE,OAAO,OAAO;AAChB"}
package/build/index.d.cts CHANGED
@@ -65,9 +65,11 @@ import { AliasAssigner } from "./queries/sql/AliasAssigner.cjs";
65
65
  import { CaseElse, CaseWhen } from "./queries/sql/expressions/case.cjs";
66
66
  import { ExprFromInput, ExprInput } from "./queries/sql/expressions/types.cjs";
67
67
  import { expr } from "./queries/sql/expressions/expression.cjs";
68
- import { CheckScope, Clauses, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NotWidened, OrderByDirection, OrderByKeys, Query, QueryArg, QueryCondition, QueryJoin, QueryJoins, QueryRow, QuerySelect, QuerySource, QueryValue, RecursiveOptions, ScalarQuery, SetQuery, Subquery, SubqueryBrand, WithInput, WithSource, entityQueryBrand, query, queryMaybe, recursiveQuery, sql, subqueryBrand } from "./queries/sql/query.cjs";
68
+ import { CustomColumnConfig, CustomColumnInput, CustomColumnInputs, CustomColumnType, CustomTable, CustomTableDefinition, CustomTableFor, declareTable } from "./queries/sql/custom.cjs";
69
+ import { CollectionJoin, EntityColumn, PolyReference, PrimitiveColumn, ReferenceColumn, ReferenceJoin, Table, TableBrand, TableFilter, TableFor, TableMgmt, TableSourceBrand, TableSourceMgmt, getTableMetadata, getTableMgmt, isTable, newTableProxy, table, tableMgmt, tables } from "./queries/sql/Tables.cjs";
70
+ import { CheckScope, Clauses, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NotWidened, OrderByDirection, OrderByKeys, Query, QueryArg, QueryCondition, QueryJoin, QueryJoinInput, QueryJoinList, QueryRow, QuerySelect, QuerySource, QueryValue, RecursiveOptions, ResolvedJoins, ScalarQuery, SetQuery, Subquery, SubqueryBrand, WithInput, WithSource, entityQueryBrand, query, queryMaybe, recursiveQuery, sql, subqueryBrand } from "./queries/sql/query.cjs";
69
71
  import { ArrayAggOptions, Expr, ExprBrand, ExprLike, InnerJoin, LeftJoin, exprBrand } from "./queries/sql/Expr.cjs";
70
- import { CollectionJoin, EntityColumn, PolyReference, PrimitiveColumn, ReferenceColumn, ReferenceJoin, Table, TableBrand, TableFilter, TableFor, TableMgmt, getTableMetadata, getTableMgmt, isTable, newTableProxy, table, tableMgmt, tables } from "./queries/sql/Tables.cjs";
72
+ import { JoinTree } from "./queries/sql/JoinTree.cjs";
71
73
  import { ConditionBuilder } from "./queries/ConditionBuilder.cjs";
72
74
  import { EntityField, EntityFields, SettableFields } from "./EntityFields.cjs";
73
75
  import { EntityOrId, HintNode } from "./loading/HintTree.cjs";
@@ -92,7 +94,7 @@ import { getField, isChangeableField, isFieldSet, setField } from "./fields.cjs"
92
94
  import { lazyField } from "./newEntity.cjs";
93
95
  import { UnknownProperty, getLazyFields, getProperties } from "./getProperties.cjs";
94
96
  import { CustomJsonKeyHint, EntityKeyJsonHint, JsonHint, JsonPayload, Jsonable, JsonableValue, NestedJsonHint, ToJsonHint, toJSON } from "./json.cjs";
95
- import { assertIdIsTagged, assertIdsAreTagged, deTagId, deTagIds, ensureTagged, isTaggedId, keyToNumber, keyToTaggedId, maybeResolveReferenceToId, setTaggedIdDelimiter, tagFromId, tagId, tagIds, toIdOf, toTaggedId, unsafeDeTagIds } from "./keys.cjs";
97
+ import { assertIdIsTagged, assertIdsAreTagged, deTagId, deTagIds, ensureTagged, isTaggedId, keyToNumber, keyToTaggedId, maybeResolveReferenceToId, setTaggedIdDelimiter, tagFromId, tagId, tagIds, taggedIdPrefix, toIdOf, toTaggedId, unsafeDeTagIds } from "./keys.cjs";
96
98
  import { kq, kqDot, kqStar } from "./queries/sql/keywords.cjs";
97
99
  import { FactoryEntityOpt, FactoryOpts, defaultValue, factories, getTestIndex, isFactoryCreation, maybeBranchValue, maybeNew, maybeNewPoly, newTestInstance, noValue, setFactoryLogging, testIndex } from "./newTestInstance.cjs";
98
100
  import { setFactoryWriter } from "./logging/FactoryLogger.cjs";
@@ -174,5 +176,5 @@ declare function failNoIdYet(entity: string): never;
174
176
  */
175
177
  declare function isNewEntity<T extends Entity>(entity: T): entity is New<T>;
176
178
  //#endregion
177
- export { type ActualFactoryOpts, type Alias, AliasAssigner, type AliasBrand, type AliasColumn, AliasFn, type AliasMgmt, type AndCondition, type ArrayAggOptions, type AsyncMethod, type AsyncProperty, AsyncPropertyImpl, BaseEntity, BigIntSerde, BooleanFilter, BooleanGraphQLFilter, type CaseElse, type CaseWhen, Changes, type CheckScope, type Clauses, type Collection, type CollectionJoin, Column, type ColumnCondition, ColumnDescriptors, type ColumnsOf, ConditionBuilder, type ConditionGroup, ConfigApi, CrossJoinTable, CustomCollection, CustomJsonKeyHint, CustomReference, CustomSerde, CustomSerdeAdapter, DateSerde, DecimalToNumberSerde, type DeepNew, type DeepPartialOrNull, DeleteOp, type DeleteStatement, type DomainPredicate, type Driver, type DriverQueryResult, type Entity, type EntityAlias, EntityChanges, type EntityColumn, EntityConstructor, type EntityField, type EntityFields, EntityFilter, EntityFilterObject, EntityGraphQLFilter, type EntityHook, EntityKeyJsonHint, EntityManager, EntityManagerHook, EntityManagerInternalApi, EntityManagerMode, EntityManagerOpts, EntityMetadata, type EntityOf, type EntityOrId, type EntityQuery, EnumArrayFieldSerde, type EnumCollection, EnumCollectionFieldStatus, EnumCollectionImpl, EnumField, EnumFieldSerde, type EnumMetadata, type ExecuteResult, type ExistsCondition, type ExistsQuery, type Expr, type ExprBrand, type ExprFromInput, type ExprInput, type ExprLike, ExpressionCondition, ExpressionFilter, type ExpressionOrderBy, type FactoryEntityOpt, type FactoryExtrasOf, type FactoryOpts, Field, FieldColumn, FieldLogger, FieldLoggerWatch, FieldSerde, FieldStatus, type FieldsOf, FilterAndSettings, type FilterOf, FilterWithAlias, FindCountFilterOptions, FindFilter, FindFilterOptions, FindGqlFilterOptions, FindOperation, Flavor, FlushOptions, type GenericError, GraphQLFilterAndSettings, type GraphQLFilterOf, GraphQLFilterWithAlias, type HintNode, IdAssigner, IdOf, type IdType, ImmutableEntitiesPlugin, type InheritanceTypeOf, type InnerJoin, InsertFixup, InsertOp, type InsertStatement, type InsertValues, InstanceData, type JoinColumnValue, type JoinResult, type JoinRow, JoinRowOperation, type JoinRowTodo, JoinTable, JsonAggregatePreloader, JsonHint, JsonPayload, JsonSerde, Jsonable, JsonableValue, KeySerde, type LargeCollection, LargeOneToManyField, LateralJoinTable, type LazyField, LazyFieldImpl, type LeftJoin, Lens, type LoadHint, type Loadable, type Loaded, type LoadedCollection, type LoadedEnumCollection, type LoadedMethod, type LoadedProperty, type LoadedReadOnlyCollection, type LoadedReference, LoaderCache, ManyToManyCollection, ManyToManyEnumField, ManyToManyField, ManyToManyFieldStatus, ManyToManyLargeCollection, type ManyToManyLike, ManyToOneField, ManyToOneFieldStatus, type ManyToOneReference, ManyToOneReferenceImpl, type MarkLoaded, MaybeAbstractEntityConstructor, type MaybeNull, type MutationReturning, type MutationStatement, type NameOf, NestedJsonHint, type NestedLoadHint, type New, NoIdError, NotFoundError, type NotWidened, OneToManyCollection, OneToManyField, OneToManyFieldStatus, OneToManyLargeCollection, OneToOneField, type OneToOneReference, OneToOneReferenceImpl, OpColumn, Operator, type OptIdsOf, type OptsOf, type OrCondition, OrderBy, type OrderByDirection, type OrderByKeys, type OrderOf, ParsedCteClause, type ParsedEntityFilter, type ParsedExpressionCondition, type ParsedExpressionFilter, ParsedFindQuery, ParsedGroupBy, ParsedOrderBy, ParsedSelect, ParsedTable, type ParsedValueFilter, PartialOrNull, type PendingChange, type PendingCreate, type PendingDelete, type PendingM2M, type PendingUpdate, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, Plugin, PojoRowData, type PolyAlias, PolyComponent, type PolyReference, PolymorphicField, PolymorphicFieldComponent, PolymorphicKeySerde, type PolymorphicReference, PolymorphicReferenceImpl, type PredicateBrand, type PreloadHydrator, type PreloadPlugin, PrimaryKeyField, PrimaryTable, type PrimitiveAlias, type PrimitiveColumn, PrimitiveField, PrimitiveFieldStatus, PrimitiveSerde, type Property, PropertyImpl, type Query, type QueryArg, type QueryCondition, type QueryJoin, type QueryJoins, type QueryRow, type QuerySelect, type QuerySource, type QueryValue, RandomUuidAssigner, type RawCondition, type Reactable, type Reacted, ReactionLogger, type ReactiveField, type ReactiveGetter, type ReactiveHint, type ReactiveManyToMany, ReactiveManyToManyImpl, type ReactiveManyToManyOtherSide, ReactiveManyToManyOtherSideImpl, type ReactiveReference, ReactiveReferenceImpl, type ReactiveTarget, type ReadOnlyCollection, ReadOnlyError, RecursiveCycleError, type RecursiveOptions, type Reference, type ReferenceColumn, type ReferenceJoin, type Relation, type RelationsIn, type RelationsOf, ResolvedScope, type RootTypeNameOf, RowData, type RuntimeConfig, ScalarCodec, type ScalarQuery, Scope, ScopeFilterFragment, ScopeFn, ScopeJoinFilter, ScopeQuery, SequenceIdAssigner, SerdeField, type SetQuery, type SettableFields, SimpleFieldSerde, type SqlCondition, type SqlPredicate, StubbedRelation, type Subquery, type SubqueryBrand, SubqueryRenderer, SuperstructSerde, type Table, type TableBrand, type TableFilter, type TableFor, type TableMgmt, TaggedId, Temporal, TestUuidAssigner, TimestampCodec, TimestampFields, TimestampSerde, ToJsonHint, Todo, TooManyError, type TypeMap, type TypeMapEntry, type TypeNameOf, UniqueFilter, UnknownProperty, UpdateOp, type UpdateStatement, type UpdateValues, ValidationCode, type ValidationError, ValidationErrors, type ValidationRule, type ValidationRuleInternal, type ValidationRuleResult, ValueFilter, ValueGraphQLFilter, type WithInput, type WithLoaded, type WithSource, WriteFn, ZodSerde, ZonedDateTimeSerde, abbreviation, addTablePerClassJoinsAndClassTag, alias, aliases, appendStack, asConcreteCstr, asNew, assertIdIsTagged, assertIdsAreTagged, assertLoaded, assertNever, buildCteSql, buildRawQuery, buildUnnestCte, buildValueCondition, buildWhereClause, cannotBeChanged, cannotBeUpdated, cleanSql, cleanStringValue, configureMetadata, convertToLoadHint, createRowFromEntityData, deTagId, deTagIds, deepNormalizeHint, defaultValue, driverAfterBegin, driverAfterCommit, driverApi, driverBeforeBegin, driverBeforeCommit, emptyRowData, ensureLoaded, ensureNotDeleted, ensureRectangularArraySizes, ensureTagged, ensureWithLoaded, entityQueryBrand, expr, exprBrand, factories, fail, failIfAnyRejected, failNoIdYet, filterSoftDeletes, findFilterField, generateOps, getAliasMetadata, getAliasMgmt, getBaseAndSelfMetas, getBaseMeta, getBaseSelfAndSubMetas, getConstructorFromTaggedId, getDefaultEntityLimit, getEmInternalApi, getField, getInstanceData, getLazyFields, getLens, getLensPath, getMaybeCtiAlias, getMetadata, getMetadataForField, getMetadataForTable, getMetadataForType, getProperties, getRelationEntries, getRelations, getRequiredKeys, getRuntimeConfig, getSubMetas, getTableMetadata, getTableMgmt, getTables, getTestIndex, hasAsyncMethod, hasAsyncProperty, hasAsyncReactiveField, hasCustomCollection, hasCustomReference, hasEnumCollection, hasLargeMany, hasLargeManyToMany, hasLazyField, hasMany, hasManyDerived, hasManyThrough, hasManyToMany, hasOne, hasOneDerived, hasOnePolymorphic, hasOneThrough, hasOneToOne, hasProperty, hasReactiveField, hasReactiveGetter, hasReactiveManyToMany, hasReactiveManyToManyOtherSide, hasReactiveProperty, hasReactiveReference, hasRecursiveChildren, hasRecursiveM2m, hasRecursiveParents, hasSerde, indexBy, internals, isAlias, isAllSqlPaths, isAsyncProperty, isAsyncReactiveField, isChangeableField, isCollection, isCollectionField, isDefined, isEntity, isFactoryCreation, isFieldSet, isId, isInTrustedContext, isKey, isLazyField, isLensLoaded, isLensLoadedPath, isLoaded, isLoadedAsyncProperty, isLoadedCollection, isLoadedLazyField, isLoadedOneToOneReference, isLoadedProperty, isLoadedReadOnlyCollection, isLoadedReference, isManyToManyEnumField, isManyToManyField, isManyToOneField, isManyToOneReference, isNew, isNewEntity, isOneToManyField, isOneToOneField, isOneToOneReference, isPolymorphicField, isPolymorphicReference, isProperty, isReactiveField, isReactiveGetter, isReactiveManyToMany, isReactiveManyToManyOtherSide, isReactiveReference, isReadOnlyCollection, isReference, isReferenceField, isRelation, isScope, isScopeJoinFilter, isSelectAllFilter, isTable, isTaggedId, isTypeOrSubType, keyToNumber, keyToTaggedId, kq, kqDot, kqStar, lazyExcludedSelects, lazyField, lensPathToLoadHint, lensToLoadHint, lensToPath, loadLens, loadLensPath, makeLike, mapPathsToTarget, mapToDb, maxValueRule, maybeAddIdNotNulls, maybeAddNotSoftDeleted, maybeAddOrderBy, maybeBranchValue, maybeGetConstructorFromReference, maybeNew, maybeNewPoly, maybePopulateThen, maybeRequireTemporal, maybeResolveReferenceToId, mergeFindOptions, minValueRule, mustBeSubType, newAliasProxy, newChangesProxy, newPgConnectionConfig, newRequiredLazyFieldRule, newRequiredRule, newScopeFn, newTableProxy, newTestInstance, noValue, noopFieldLogger, normalizeHint, nowUTC, opToFn, operators, optimizeCollectionJoins, parseAlias, parseEntityFilter, parseFindQuery, parseValueFilter, partition, plainDateMapper, plainDateTimeMapper, plainTimeMapper, polymorphicField, query, queryMaybe, rangeValueRule, recursiveQuery, requireTemporal, resetBootFlag, resetDefaultEntityLimit, resolveScope, reverseReactiveHint, runInTrustedContext, sameEntity, sameReference, setDefaultEntityLimit, setFactoryLogging, setFactoryWriter, setField, setLastNow, setOpt, setOpts, setReactionLogging, setRuntimeConfig, setTaggedIdDelimiter, skipCondition, sql, stiSubtypeFilter, subqueryBrand, table, tableMgmt, tables, tagFromId, tagId, tagIds, testIndex, testing, toIdOf, toJSON, toTaggedId, unsafeDeTagIds, unsafeLoaded, updatePartial, upsert, visitConditions, withLoaded, zeroTo, zonedDateTimeMapper };
179
+ export { type ActualFactoryOpts, type Alias, AliasAssigner, type AliasBrand, type AliasColumn, AliasFn, type AliasMgmt, type AndCondition, type ArrayAggOptions, type AsyncMethod, type AsyncProperty, AsyncPropertyImpl, BaseEntity, BigIntSerde, BooleanFilter, BooleanGraphQLFilter, type CaseElse, type CaseWhen, Changes, type CheckScope, type Clauses, type Collection, type CollectionJoin, Column, type ColumnCondition, ColumnDescriptors, type ColumnsOf, ConditionBuilder, type ConditionGroup, ConfigApi, CrossJoinTable, CustomCollection, type CustomColumnConfig, type CustomColumnInput, type CustomColumnInputs, type CustomColumnType, CustomJsonKeyHint, CustomReference, CustomSerde, CustomSerdeAdapter, type CustomTable, type CustomTableDefinition, type CustomTableFor, DateSerde, DecimalToNumberSerde, type DeepNew, type DeepPartialOrNull, DeleteOp, type DeleteStatement, type DomainPredicate, type Driver, type DriverQueryResult, type Entity, type EntityAlias, EntityChanges, type EntityColumn, EntityConstructor, type EntityField, type EntityFields, EntityFilter, EntityFilterObject, EntityGraphQLFilter, type EntityHook, EntityKeyJsonHint, EntityManager, EntityManagerHook, EntityManagerInternalApi, EntityManagerMode, EntityManagerOpts, EntityMetadata, type EntityOf, type EntityOrId, type EntityQuery, EnumArrayFieldSerde, type EnumCollection, EnumCollectionFieldStatus, EnumCollectionImpl, EnumField, EnumFieldSerde, type EnumMetadata, type ExecuteResult, type ExistsCondition, type ExistsQuery, type Expr, type ExprBrand, type ExprFromInput, type ExprInput, type ExprLike, ExpressionCondition, ExpressionFilter, type ExpressionOrderBy, type FactoryEntityOpt, type FactoryExtrasOf, type FactoryOpts, Field, FieldColumn, FieldLogger, FieldLoggerWatch, FieldSerde, FieldStatus, type FieldsOf, FilterAndSettings, type FilterOf, FilterWithAlias, FindCountFilterOptions, FindFilter, FindFilterOptions, FindGqlFilterOptions, FindOperation, Flavor, FlushOptions, type GenericError, GraphQLFilterAndSettings, type GraphQLFilterOf, GraphQLFilterWithAlias, type HintNode, IdAssigner, IdOf, type IdType, ImmutableEntitiesPlugin, type InheritanceTypeOf, type InnerJoin, InsertFixup, InsertOp, type InsertStatement, type InsertValues, InstanceData, type JoinColumnValue, type JoinResult, type JoinRow, JoinRowOperation, type JoinRowTodo, JoinTable, type JoinTree, JsonAggregatePreloader, JsonHint, JsonPayload, JsonSerde, Jsonable, JsonableValue, KeySerde, type LargeCollection, LargeOneToManyField, LateralJoinTable, type LazyField, LazyFieldImpl, type LeftJoin, Lens, type LoadHint, type Loadable, type Loaded, type LoadedCollection, type LoadedEnumCollection, type LoadedMethod, type LoadedProperty, type LoadedReadOnlyCollection, type LoadedReference, LoaderCache, ManyToManyCollection, ManyToManyEnumField, ManyToManyField, ManyToManyFieldStatus, ManyToManyLargeCollection, type ManyToManyLike, ManyToOneField, ManyToOneFieldStatus, type ManyToOneReference, ManyToOneReferenceImpl, type MarkLoaded, MaybeAbstractEntityConstructor, type MaybeNull, type MutationReturning, type MutationStatement, type NameOf, NestedJsonHint, type NestedLoadHint, type New, NoIdError, NotFoundError, type NotWidened, OneToManyCollection, OneToManyField, OneToManyFieldStatus, OneToManyLargeCollection, OneToOneField, type OneToOneReference, OneToOneReferenceImpl, OpColumn, Operator, type OptIdsOf, type OptsOf, type OrCondition, OrderBy, type OrderByDirection, type OrderByKeys, type OrderOf, ParsedCteClause, type ParsedEntityFilter, type ParsedExpressionCondition, type ParsedExpressionFilter, ParsedFindQuery, ParsedGroupBy, ParsedOrderBy, ParsedSelect, ParsedTable, type ParsedValueFilter, PartialOrNull, type PendingChange, type PendingCreate, type PendingDelete, type PendingM2M, type PendingUpdate, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, Plugin, PojoRowData, type PolyAlias, PolyComponent, type PolyReference, PolymorphicField, PolymorphicFieldComponent, PolymorphicKeySerde, type PolymorphicReference, PolymorphicReferenceImpl, type PredicateBrand, type PreloadHydrator, type PreloadPlugin, PrimaryKeyField, PrimaryTable, type PrimitiveAlias, type PrimitiveColumn, PrimitiveField, PrimitiveFieldStatus, PrimitiveSerde, type Property, PropertyImpl, type Query, type QueryArg, type QueryCondition, type QueryJoin, type QueryJoinInput, type QueryJoinList, type QueryRow, type QuerySelect, type QuerySource, type QueryValue, RandomUuidAssigner, type RawCondition, type Reactable, type Reacted, ReactionLogger, type ReactiveField, type ReactiveGetter, type ReactiveHint, type ReactiveManyToMany, ReactiveManyToManyImpl, type ReactiveManyToManyOtherSide, ReactiveManyToManyOtherSideImpl, type ReactiveReference, ReactiveReferenceImpl, type ReactiveTarget, type ReadOnlyCollection, ReadOnlyError, RecursiveCycleError, type RecursiveOptions, type Reference, type ReferenceColumn, type ReferenceJoin, type Relation, type RelationsIn, type RelationsOf, type ResolvedJoins, ResolvedScope, type RootTypeNameOf, RowData, type RuntimeConfig, ScalarCodec, type ScalarQuery, Scope, ScopeFilterFragment, ScopeFn, ScopeJoinFilter, ScopeQuery, SequenceIdAssigner, SerdeField, type SetQuery, type SettableFields, SimpleFieldSerde, type SqlCondition, type SqlPredicate, StubbedRelation, type Subquery, type SubqueryBrand, SubqueryRenderer, SuperstructSerde, type Table, type TableBrand, type TableFilter, type TableFor, type TableMgmt, type TableSourceBrand, type TableSourceMgmt, TaggedId, Temporal, TestUuidAssigner, TimestampCodec, TimestampFields, TimestampSerde, ToJsonHint, Todo, TooManyError, type TypeMap, type TypeMapEntry, type TypeNameOf, UniqueFilter, UnknownProperty, UpdateOp, type UpdateStatement, type UpdateValues, ValidationCode, type ValidationError, ValidationErrors, type ValidationRule, type ValidationRuleInternal, type ValidationRuleResult, ValueFilter, ValueGraphQLFilter, type WithInput, type WithLoaded, type WithSource, WriteFn, ZodSerde, ZonedDateTimeSerde, abbreviation, addTablePerClassJoinsAndClassTag, alias, aliases, appendStack, asConcreteCstr, asNew, assertIdIsTagged, assertIdsAreTagged, assertLoaded, assertNever, buildCteSql, buildRawQuery, buildUnnestCte, buildValueCondition, buildWhereClause, cannotBeChanged, cannotBeUpdated, cleanSql, cleanStringValue, configureMetadata, convertToLoadHint, createRowFromEntityData, deTagId, deTagIds, declareTable, deepNormalizeHint, defaultValue, driverAfterBegin, driverAfterCommit, driverApi, driverBeforeBegin, driverBeforeCommit, emptyRowData, ensureLoaded, ensureNotDeleted, ensureRectangularArraySizes, ensureTagged, ensureWithLoaded, entityQueryBrand, expr, exprBrand, factories, fail, failIfAnyRejected, failNoIdYet, filterSoftDeletes, findFilterField, generateOps, getAliasMetadata, getAliasMgmt, getBaseAndSelfMetas, getBaseMeta, getBaseSelfAndSubMetas, getConstructorFromTaggedId, getDefaultEntityLimit, getEmInternalApi, getField, getInstanceData, getLazyFields, getLens, getLensPath, getMaybeCtiAlias, getMetadata, getMetadataForField, getMetadataForTable, getMetadataForType, getProperties, getRelationEntries, getRelations, getRequiredKeys, getRuntimeConfig, getSubMetas, getTableMetadata, getTableMgmt, getTables, getTestIndex, hasAsyncMethod, hasAsyncProperty, hasAsyncReactiveField, hasCustomCollection, hasCustomReference, hasEnumCollection, hasLargeMany, hasLargeManyToMany, hasLazyField, hasMany, hasManyDerived, hasManyThrough, hasManyToMany, hasOne, hasOneDerived, hasOnePolymorphic, hasOneThrough, hasOneToOne, hasProperty, hasReactiveField, hasReactiveGetter, hasReactiveManyToMany, hasReactiveManyToManyOtherSide, hasReactiveProperty, hasReactiveReference, hasRecursiveChildren, hasRecursiveM2m, hasRecursiveParents, hasSerde, indexBy, internals, isAlias, isAllSqlPaths, isAsyncProperty, isAsyncReactiveField, isChangeableField, isCollection, isCollectionField, isDefined, isEntity, isFactoryCreation, isFieldSet, isId, isInTrustedContext, isKey, isLazyField, isLensLoaded, isLensLoadedPath, isLoaded, isLoadedAsyncProperty, isLoadedCollection, isLoadedLazyField, isLoadedOneToOneReference, isLoadedProperty, isLoadedReadOnlyCollection, isLoadedReference, isManyToManyEnumField, isManyToManyField, isManyToOneField, isManyToOneReference, isNew, isNewEntity, isOneToManyField, isOneToOneField, isOneToOneReference, isPolymorphicField, isPolymorphicReference, isProperty, isReactiveField, isReactiveGetter, isReactiveManyToMany, isReactiveManyToManyOtherSide, isReactiveReference, isReadOnlyCollection, isReference, isReferenceField, isRelation, isScope, isScopeJoinFilter, isSelectAllFilter, isTable, isTaggedId, isTypeOrSubType, keyToNumber, keyToTaggedId, kq, kqDot, kqStar, lazyExcludedSelects, lazyField, lensPathToLoadHint, lensToLoadHint, lensToPath, loadLens, loadLensPath, makeLike, mapPathsToTarget, mapToDb, maxValueRule, maybeAddIdNotNulls, maybeAddNotSoftDeleted, maybeAddOrderBy, maybeBranchValue, maybeGetConstructorFromReference, maybeNew, maybeNewPoly, maybePopulateThen, maybeRequireTemporal, maybeResolveReferenceToId, mergeFindOptions, minValueRule, mustBeSubType, newAliasProxy, newChangesProxy, newPgConnectionConfig, newRequiredLazyFieldRule, newRequiredRule, newScopeFn, newTableProxy, newTestInstance, noValue, noopFieldLogger, normalizeHint, nowUTC, opToFn, operators, optimizeCollectionJoins, parseAlias, parseEntityFilter, parseFindQuery, parseValueFilter, partition, plainDateMapper, plainDateTimeMapper, plainTimeMapper, polymorphicField, query, queryMaybe, rangeValueRule, recursiveQuery, requireTemporal, resetBootFlag, resetDefaultEntityLimit, resolveScope, reverseReactiveHint, runInTrustedContext, sameEntity, sameReference, setDefaultEntityLimit, setFactoryLogging, setFactoryWriter, setField, setLastNow, setOpt, setOpts, setReactionLogging, setRuntimeConfig, setTaggedIdDelimiter, skipCondition, sql, stiSubtypeFilter, subqueryBrand, table, tableMgmt, tables, tagFromId, tagId, tagIds, taggedIdPrefix, testIndex, testing, toIdOf, toJSON, toTaggedId, unsafeDeTagIds, unsafeLoaded, updatePartial, upsert, visitConditions, withLoaded, zeroTo, zonedDateTimeMapper };
178
180
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ba;;;;;cACA;2BAAA;;UA0QH,UAAU;EAClB,QAAQ;;KAGE,OAAO,GAAG,WAAW,IAAI,UAAU;;;;;;;;;;;;;;;iBAgB/B,QAAQ,UAAU,QAChC,QAAQ,GACR,QAAQ,QAAQ,OAAO,iBACvB;EAAS;EAAmB;;;;;;;;;iBAoBd,OAAO,UAAU,QAC/B,MAAM,eAAe,IACrB,QAAQ,GACR,aACA,aACA,mBACA;iBAwDc,iBAAiB,QAAQ,QAAQ;;KAOrC,cAAc,QACvB,WAAW,KAAK,EAAE;iBAGL,gBAAgB,UAAU,QAAQ,QAAQ;iBAC1C,gBAAgB,UAAU,QAAQ,MAAM,kBAAkB;iBAO1D,aAAa,QAAQ,SAAS;iBAM9B,mBAAmB,QAAQ,kBAAkB;;iBAO7C,eAAe,UAAU,QAAQ,MAAM,+BAA+B,KAAK,kBAAkB;;;;;;;;cAWhG,kBAAkB;;iBAGf,YAAY;;;;;;iBASZ,YAAY,UAAU,QAAQ,QAAQ,IAAI,UAAU,IAAI"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ba;;;;;cACA;2BAAA;;UAyRH,UAAU;EAClB,QAAQ;;KAGE,OAAO,GAAG,WAAW,IAAI,UAAU;;;;;;;;;;;;;;;iBAgB/B,QAAQ,UAAU,QAChC,QAAQ,GACR,QAAQ,QAAQ,OAAO,iBACvB;EAAS;EAAmB;;;;;;;;;iBAoBd,OAAO,UAAU,QAC/B,MAAM,eAAe,IACrB,QAAQ,GACR,aACA,aACA,mBACA;iBAwDc,iBAAiB,QAAQ,QAAQ;;KAOrC,cAAc,QACvB,WAAW,KAAK,EAAE;iBAGL,gBAAgB,UAAU,QAAQ,QAAQ;iBAC1C,gBAAgB,UAAU,QAAQ,MAAM,kBAAkB;iBAO1D,aAAa,QAAQ,SAAS;iBAM9B,mBAAmB,QAAQ,kBAAkB;;iBAO7C,eAAe,UAAU,QAAQ,MAAM,+BAA+B,KAAK,kBAAkB;;;;;;;;cAWhG,kBAAkB;;iBAGf,YAAY;;;;;;iBASZ,YAAY,UAAU,QAAQ,QAAQ,IAAI,UAAU,IAAI"}
package/build/index.d.mts CHANGED
@@ -65,9 +65,11 @@ import { AliasAssigner } from "./queries/sql/AliasAssigner.mjs";
65
65
  import { CaseElse, CaseWhen } from "./queries/sql/expressions/case.mjs";
66
66
  import { ExprFromInput, ExprInput } from "./queries/sql/expressions/types.mjs";
67
67
  import { expr } from "./queries/sql/expressions/expression.mjs";
68
- import { CheckScope, Clauses, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NotWidened, OrderByDirection, OrderByKeys, Query, QueryArg, QueryCondition, QueryJoin, QueryJoins, QueryRow, QuerySelect, QuerySource, QueryValue, RecursiveOptions, ScalarQuery, SetQuery, Subquery, SubqueryBrand, WithInput, WithSource, entityQueryBrand, query, queryMaybe, recursiveQuery, sql, subqueryBrand } from "./queries/sql/query.mjs";
68
+ import { CustomColumnConfig, CustomColumnInput, CustomColumnInputs, CustomColumnType, CustomTable, CustomTableDefinition, CustomTableFor, declareTable } from "./queries/sql/custom.mjs";
69
+ import { CollectionJoin, EntityColumn, PolyReference, PrimitiveColumn, ReferenceColumn, ReferenceJoin, Table, TableBrand, TableFilter, TableFor, TableMgmt, TableSourceBrand, TableSourceMgmt, getTableMetadata, getTableMgmt, isTable, newTableProxy, table, tableMgmt, tables } from "./queries/sql/Tables.mjs";
70
+ import { CheckScope, Clauses, EntityQuery, ExistsQuery, ExpressionOrderBy, MaybeNull, NameOf, NotWidened, OrderByDirection, OrderByKeys, Query, QueryArg, QueryCondition, QueryJoin, QueryJoinInput, QueryJoinList, QueryRow, QuerySelect, QuerySource, QueryValue, RecursiveOptions, ResolvedJoins, ScalarQuery, SetQuery, Subquery, SubqueryBrand, WithInput, WithSource, entityQueryBrand, query, queryMaybe, recursiveQuery, sql, subqueryBrand } from "./queries/sql/query.mjs";
69
71
  import { ArrayAggOptions, Expr, ExprBrand, ExprLike, InnerJoin, LeftJoin, exprBrand } from "./queries/sql/Expr.mjs";
70
- import { CollectionJoin, EntityColumn, PolyReference, PrimitiveColumn, ReferenceColumn, ReferenceJoin, Table, TableBrand, TableFilter, TableFor, TableMgmt, getTableMetadata, getTableMgmt, isTable, newTableProxy, table, tableMgmt, tables } from "./queries/sql/Tables.mjs";
72
+ import { JoinTree } from "./queries/sql/JoinTree.mjs";
71
73
  import { ConditionBuilder } from "./queries/ConditionBuilder.mjs";
72
74
  import { EntityField, EntityFields, SettableFields } from "./EntityFields.mjs";
73
75
  import { EntityOrId, HintNode } from "./loading/HintTree.mjs";
@@ -92,7 +94,7 @@ import { getField, isChangeableField, isFieldSet, setField } from "./fields.mjs"
92
94
  import { lazyField } from "./newEntity.mjs";
93
95
  import { UnknownProperty, getLazyFields, getProperties } from "./getProperties.mjs";
94
96
  import { CustomJsonKeyHint, EntityKeyJsonHint, JsonHint, JsonPayload, Jsonable, JsonableValue, NestedJsonHint, ToJsonHint, toJSON } from "./json.mjs";
95
- import { assertIdIsTagged, assertIdsAreTagged, deTagId, deTagIds, ensureTagged, isTaggedId, keyToNumber, keyToTaggedId, maybeResolveReferenceToId, setTaggedIdDelimiter, tagFromId, tagId, tagIds, toIdOf, toTaggedId, unsafeDeTagIds } from "./keys.mjs";
97
+ import { assertIdIsTagged, assertIdsAreTagged, deTagId, deTagIds, ensureTagged, isTaggedId, keyToNumber, keyToTaggedId, maybeResolveReferenceToId, setTaggedIdDelimiter, tagFromId, tagId, tagIds, taggedIdPrefix, toIdOf, toTaggedId, unsafeDeTagIds } from "./keys.mjs";
96
98
  import { kq, kqDot, kqStar } from "./queries/sql/keywords.mjs";
97
99
  import { FactoryEntityOpt, FactoryOpts, defaultValue, factories, getTestIndex, isFactoryCreation, maybeBranchValue, maybeNew, maybeNewPoly, newTestInstance, noValue, setFactoryLogging, testIndex } from "./newTestInstance.mjs";
98
100
  import { setFactoryWriter } from "./logging/FactoryLogger.mjs";
@@ -174,5 +176,5 @@ declare function failNoIdYet(entity: string): never;
174
176
  */
175
177
  declare function isNewEntity<T extends Entity>(entity: T): entity is New<T>;
176
178
  //#endregion
177
- export { type ActualFactoryOpts, type Alias, AliasAssigner, type AliasBrand, type AliasColumn, AliasFn, type AliasMgmt, type AndCondition, type ArrayAggOptions, type AsyncMethod, type AsyncProperty, AsyncPropertyImpl, BaseEntity, BigIntSerde, BooleanFilter, BooleanGraphQLFilter, type CaseElse, type CaseWhen, Changes, type CheckScope, type Clauses, type Collection, type CollectionJoin, Column, type ColumnCondition, ColumnDescriptors, type ColumnsOf, ConditionBuilder, type ConditionGroup, ConfigApi, CrossJoinTable, CustomCollection, CustomJsonKeyHint, CustomReference, CustomSerde, CustomSerdeAdapter, DateSerde, DecimalToNumberSerde, type DeepNew, type DeepPartialOrNull, DeleteOp, type DeleteStatement, type DomainPredicate, type Driver, type DriverQueryResult, type Entity, type EntityAlias, EntityChanges, type EntityColumn, EntityConstructor, type EntityField, type EntityFields, EntityFilter, EntityFilterObject, EntityGraphQLFilter, type EntityHook, EntityKeyJsonHint, EntityManager, EntityManagerHook, EntityManagerInternalApi, EntityManagerMode, EntityManagerOpts, EntityMetadata, type EntityOf, type EntityOrId, type EntityQuery, EnumArrayFieldSerde, type EnumCollection, EnumCollectionFieldStatus, EnumCollectionImpl, EnumField, EnumFieldSerde, type EnumMetadata, type ExecuteResult, type ExistsCondition, type ExistsQuery, type Expr, type ExprBrand, type ExprFromInput, type ExprInput, type ExprLike, ExpressionCondition, ExpressionFilter, type ExpressionOrderBy, type FactoryEntityOpt, type FactoryExtrasOf, type FactoryOpts, Field, FieldColumn, FieldLogger, FieldLoggerWatch, FieldSerde, FieldStatus, type FieldsOf, FilterAndSettings, type FilterOf, FilterWithAlias, FindCountFilterOptions, FindFilter, FindFilterOptions, FindGqlFilterOptions, FindOperation, Flavor, FlushOptions, type GenericError, GraphQLFilterAndSettings, type GraphQLFilterOf, GraphQLFilterWithAlias, type HintNode, IdAssigner, IdOf, type IdType, ImmutableEntitiesPlugin, type InheritanceTypeOf, type InnerJoin, InsertFixup, InsertOp, type InsertStatement, type InsertValues, InstanceData, type JoinColumnValue, type JoinResult, type JoinRow, JoinRowOperation, type JoinRowTodo, JoinTable, JsonAggregatePreloader, JsonHint, JsonPayload, JsonSerde, Jsonable, JsonableValue, KeySerde, type LargeCollection, LargeOneToManyField, LateralJoinTable, type LazyField, LazyFieldImpl, type LeftJoin, Lens, type LoadHint, type Loadable, type Loaded, type LoadedCollection, type LoadedEnumCollection, type LoadedMethod, type LoadedProperty, type LoadedReadOnlyCollection, type LoadedReference, LoaderCache, ManyToManyCollection, ManyToManyEnumField, ManyToManyField, ManyToManyFieldStatus, ManyToManyLargeCollection, type ManyToManyLike, ManyToOneField, ManyToOneFieldStatus, type ManyToOneReference, ManyToOneReferenceImpl, type MarkLoaded, MaybeAbstractEntityConstructor, type MaybeNull, type MutationReturning, type MutationStatement, type NameOf, NestedJsonHint, type NestedLoadHint, type New, NoIdError, NotFoundError, type NotWidened, OneToManyCollection, OneToManyField, OneToManyFieldStatus, OneToManyLargeCollection, OneToOneField, type OneToOneReference, OneToOneReferenceImpl, OpColumn, Operator, type OptIdsOf, type OptsOf, type OrCondition, OrderBy, type OrderByDirection, type OrderByKeys, type OrderOf, ParsedCteClause, type ParsedEntityFilter, type ParsedExpressionCondition, type ParsedExpressionFilter, ParsedFindQuery, ParsedGroupBy, ParsedOrderBy, ParsedSelect, ParsedTable, type ParsedValueFilter, PartialOrNull, type PendingChange, type PendingCreate, type PendingDelete, type PendingM2M, type PendingUpdate, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, Plugin, PojoRowData, type PolyAlias, PolyComponent, type PolyReference, PolymorphicField, PolymorphicFieldComponent, PolymorphicKeySerde, type PolymorphicReference, PolymorphicReferenceImpl, type PredicateBrand, type PreloadHydrator, type PreloadPlugin, PrimaryKeyField, PrimaryTable, type PrimitiveAlias, type PrimitiveColumn, PrimitiveField, PrimitiveFieldStatus, PrimitiveSerde, type Property, PropertyImpl, type Query, type QueryArg, type QueryCondition, type QueryJoin, type QueryJoins, type QueryRow, type QuerySelect, type QuerySource, type QueryValue, RandomUuidAssigner, type RawCondition, type Reactable, type Reacted, ReactionLogger, type ReactiveField, type ReactiveGetter, type ReactiveHint, type ReactiveManyToMany, ReactiveManyToManyImpl, type ReactiveManyToManyOtherSide, ReactiveManyToManyOtherSideImpl, type ReactiveReference, ReactiveReferenceImpl, type ReactiveTarget, type ReadOnlyCollection, ReadOnlyError, RecursiveCycleError, type RecursiveOptions, type Reference, type ReferenceColumn, type ReferenceJoin, type Relation, type RelationsIn, type RelationsOf, ResolvedScope, type RootTypeNameOf, RowData, type RuntimeConfig, ScalarCodec, type ScalarQuery, Scope, ScopeFilterFragment, ScopeFn, ScopeJoinFilter, ScopeQuery, SequenceIdAssigner, SerdeField, type SetQuery, type SettableFields, SimpleFieldSerde, type SqlCondition, type SqlPredicate, StubbedRelation, type Subquery, type SubqueryBrand, SubqueryRenderer, SuperstructSerde, type Table, type TableBrand, type TableFilter, type TableFor, type TableMgmt, TaggedId, Temporal, TestUuidAssigner, TimestampCodec, TimestampFields, TimestampSerde, ToJsonHint, Todo, TooManyError, type TypeMap, type TypeMapEntry, type TypeNameOf, UniqueFilter, UnknownProperty, UpdateOp, type UpdateStatement, type UpdateValues, ValidationCode, type ValidationError, ValidationErrors, type ValidationRule, type ValidationRuleInternal, type ValidationRuleResult, ValueFilter, ValueGraphQLFilter, type WithInput, type WithLoaded, type WithSource, WriteFn, ZodSerde, ZonedDateTimeSerde, abbreviation, addTablePerClassJoinsAndClassTag, alias, aliases, appendStack, asConcreteCstr, asNew, assertIdIsTagged, assertIdsAreTagged, assertLoaded, assertNever, buildCteSql, buildRawQuery, buildUnnestCte, buildValueCondition, buildWhereClause, cannotBeChanged, cannotBeUpdated, cleanSql, cleanStringValue, configureMetadata, convertToLoadHint, createRowFromEntityData, deTagId, deTagIds, deepNormalizeHint, defaultValue, driverAfterBegin, driverAfterCommit, driverApi, driverBeforeBegin, driverBeforeCommit, emptyRowData, ensureLoaded, ensureNotDeleted, ensureRectangularArraySizes, ensureTagged, ensureWithLoaded, entityQueryBrand, expr, exprBrand, factories, fail, failIfAnyRejected, failNoIdYet, filterSoftDeletes, findFilterField, generateOps, getAliasMetadata, getAliasMgmt, getBaseAndSelfMetas, getBaseMeta, getBaseSelfAndSubMetas, getConstructorFromTaggedId, getDefaultEntityLimit, getEmInternalApi, getField, getInstanceData, getLazyFields, getLens, getLensPath, getMaybeCtiAlias, getMetadata, getMetadataForField, getMetadataForTable, getMetadataForType, getProperties, getRelationEntries, getRelations, getRequiredKeys, getRuntimeConfig, getSubMetas, getTableMetadata, getTableMgmt, getTables, getTestIndex, hasAsyncMethod, hasAsyncProperty, hasAsyncReactiveField, hasCustomCollection, hasCustomReference, hasEnumCollection, hasLargeMany, hasLargeManyToMany, hasLazyField, hasMany, hasManyDerived, hasManyThrough, hasManyToMany, hasOne, hasOneDerived, hasOnePolymorphic, hasOneThrough, hasOneToOne, hasProperty, hasReactiveField, hasReactiveGetter, hasReactiveManyToMany, hasReactiveManyToManyOtherSide, hasReactiveProperty, hasReactiveReference, hasRecursiveChildren, hasRecursiveM2m, hasRecursiveParents, hasSerde, indexBy, internals, isAlias, isAllSqlPaths, isAsyncProperty, isAsyncReactiveField, isChangeableField, isCollection, isCollectionField, isDefined, isEntity, isFactoryCreation, isFieldSet, isId, isInTrustedContext, isKey, isLazyField, isLensLoaded, isLensLoadedPath, isLoaded, isLoadedAsyncProperty, isLoadedCollection, isLoadedLazyField, isLoadedOneToOneReference, isLoadedProperty, isLoadedReadOnlyCollection, isLoadedReference, isManyToManyEnumField, isManyToManyField, isManyToOneField, isManyToOneReference, isNew, isNewEntity, isOneToManyField, isOneToOneField, isOneToOneReference, isPolymorphicField, isPolymorphicReference, isProperty, isReactiveField, isReactiveGetter, isReactiveManyToMany, isReactiveManyToManyOtherSide, isReactiveReference, isReadOnlyCollection, isReference, isReferenceField, isRelation, isScope, isScopeJoinFilter, isSelectAllFilter, isTable, isTaggedId, isTypeOrSubType, keyToNumber, keyToTaggedId, kq, kqDot, kqStar, lazyExcludedSelects, lazyField, lensPathToLoadHint, lensToLoadHint, lensToPath, loadLens, loadLensPath, makeLike, mapPathsToTarget, mapToDb, maxValueRule, maybeAddIdNotNulls, maybeAddNotSoftDeleted, maybeAddOrderBy, maybeBranchValue, maybeGetConstructorFromReference, maybeNew, maybeNewPoly, maybePopulateThen, maybeRequireTemporal, maybeResolveReferenceToId, mergeFindOptions, minValueRule, mustBeSubType, newAliasProxy, newChangesProxy, newPgConnectionConfig, newRequiredLazyFieldRule, newRequiredRule, newScopeFn, newTableProxy, newTestInstance, noValue, noopFieldLogger, normalizeHint, nowUTC, opToFn, operators, optimizeCollectionJoins, parseAlias, parseEntityFilter, parseFindQuery, parseValueFilter, partition, plainDateMapper, plainDateTimeMapper, plainTimeMapper, polymorphicField, query, queryMaybe, rangeValueRule, recursiveQuery, requireTemporal, resetBootFlag, resetDefaultEntityLimit, resolveScope, reverseReactiveHint, runInTrustedContext, sameEntity, sameReference, setDefaultEntityLimit, setFactoryLogging, setFactoryWriter, setField, setLastNow, setOpt, setOpts, setReactionLogging, setRuntimeConfig, setTaggedIdDelimiter, skipCondition, sql, stiSubtypeFilter, subqueryBrand, table, tableMgmt, tables, tagFromId, tagId, tagIds, testIndex, testing, toIdOf, toJSON, toTaggedId, unsafeDeTagIds, unsafeLoaded, updatePartial, upsert, visitConditions, withLoaded, zeroTo, zonedDateTimeMapper };
179
+ export { type ActualFactoryOpts, type Alias, AliasAssigner, type AliasBrand, type AliasColumn, AliasFn, type AliasMgmt, type AndCondition, type ArrayAggOptions, type AsyncMethod, type AsyncProperty, AsyncPropertyImpl, BaseEntity, BigIntSerde, BooleanFilter, BooleanGraphQLFilter, type CaseElse, type CaseWhen, Changes, type CheckScope, type Clauses, type Collection, type CollectionJoin, Column, type ColumnCondition, ColumnDescriptors, type ColumnsOf, ConditionBuilder, type ConditionGroup, ConfigApi, CrossJoinTable, CustomCollection, type CustomColumnConfig, type CustomColumnInput, type CustomColumnInputs, type CustomColumnType, CustomJsonKeyHint, CustomReference, CustomSerde, CustomSerdeAdapter, type CustomTable, type CustomTableDefinition, type CustomTableFor, DateSerde, DecimalToNumberSerde, type DeepNew, type DeepPartialOrNull, DeleteOp, type DeleteStatement, type DomainPredicate, type Driver, type DriverQueryResult, type Entity, type EntityAlias, EntityChanges, type EntityColumn, EntityConstructor, type EntityField, type EntityFields, EntityFilter, EntityFilterObject, EntityGraphQLFilter, type EntityHook, EntityKeyJsonHint, EntityManager, EntityManagerHook, EntityManagerInternalApi, EntityManagerMode, EntityManagerOpts, EntityMetadata, type EntityOf, type EntityOrId, type EntityQuery, EnumArrayFieldSerde, type EnumCollection, EnumCollectionFieldStatus, EnumCollectionImpl, EnumField, EnumFieldSerde, type EnumMetadata, type ExecuteResult, type ExistsCondition, type ExistsQuery, type Expr, type ExprBrand, type ExprFromInput, type ExprInput, type ExprLike, ExpressionCondition, ExpressionFilter, type ExpressionOrderBy, type FactoryEntityOpt, type FactoryExtrasOf, type FactoryOpts, Field, FieldColumn, FieldLogger, FieldLoggerWatch, FieldSerde, FieldStatus, type FieldsOf, FilterAndSettings, type FilterOf, FilterWithAlias, FindCountFilterOptions, FindFilter, FindFilterOptions, FindGqlFilterOptions, FindOperation, Flavor, FlushOptions, type GenericError, GraphQLFilterAndSettings, type GraphQLFilterOf, GraphQLFilterWithAlias, type HintNode, IdAssigner, IdOf, type IdType, ImmutableEntitiesPlugin, type InheritanceTypeOf, type InnerJoin, InsertFixup, InsertOp, type InsertStatement, type InsertValues, InstanceData, type JoinColumnValue, type JoinResult, type JoinRow, JoinRowOperation, type JoinRowTodo, JoinTable, type JoinTree, JsonAggregatePreloader, JsonHint, JsonPayload, JsonSerde, Jsonable, JsonableValue, KeySerde, type LargeCollection, LargeOneToManyField, LateralJoinTable, type LazyField, LazyFieldImpl, type LeftJoin, Lens, type LoadHint, type Loadable, type Loaded, type LoadedCollection, type LoadedEnumCollection, type LoadedMethod, type LoadedProperty, type LoadedReadOnlyCollection, type LoadedReference, LoaderCache, ManyToManyCollection, ManyToManyEnumField, ManyToManyField, ManyToManyFieldStatus, ManyToManyLargeCollection, type ManyToManyLike, ManyToOneField, ManyToOneFieldStatus, type ManyToOneReference, ManyToOneReferenceImpl, type MarkLoaded, MaybeAbstractEntityConstructor, type MaybeNull, type MutationReturning, type MutationStatement, type NameOf, NestedJsonHint, type NestedLoadHint, type New, NoIdError, NotFoundError, type NotWidened, OneToManyCollection, OneToManyField, OneToManyFieldStatus, OneToManyLargeCollection, OneToOneField, type OneToOneReference, OneToOneReferenceImpl, OpColumn, Operator, type OptIdsOf, type OptsOf, type OrCondition, OrderBy, type OrderByDirection, type OrderByKeys, type OrderOf, ParsedCteClause, type ParsedEntityFilter, type ParsedExpressionCondition, type ParsedExpressionFilter, ParsedFindQuery, ParsedGroupBy, ParsedOrderBy, ParsedSelect, ParsedTable, type ParsedValueFilter, PartialOrNull, type PendingChange, type PendingCreate, type PendingDelete, type PendingM2M, type PendingUpdate, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, Plugin, PojoRowData, type PolyAlias, PolyComponent, type PolyReference, PolymorphicField, PolymorphicFieldComponent, PolymorphicKeySerde, type PolymorphicReference, PolymorphicReferenceImpl, type PredicateBrand, type PreloadHydrator, type PreloadPlugin, PrimaryKeyField, PrimaryTable, type PrimitiveAlias, type PrimitiveColumn, PrimitiveField, PrimitiveFieldStatus, PrimitiveSerde, type Property, PropertyImpl, type Query, type QueryArg, type QueryCondition, type QueryJoin, type QueryJoinInput, type QueryJoinList, type QueryRow, type QuerySelect, type QuerySource, type QueryValue, RandomUuidAssigner, type RawCondition, type Reactable, type Reacted, ReactionLogger, type ReactiveField, type ReactiveGetter, type ReactiveHint, type ReactiveManyToMany, ReactiveManyToManyImpl, type ReactiveManyToManyOtherSide, ReactiveManyToManyOtherSideImpl, type ReactiveReference, ReactiveReferenceImpl, type ReactiveTarget, type ReadOnlyCollection, ReadOnlyError, RecursiveCycleError, type RecursiveOptions, type Reference, type ReferenceColumn, type ReferenceJoin, type Relation, type RelationsIn, type RelationsOf, type ResolvedJoins, ResolvedScope, type RootTypeNameOf, RowData, type RuntimeConfig, ScalarCodec, type ScalarQuery, Scope, ScopeFilterFragment, ScopeFn, ScopeJoinFilter, ScopeQuery, SequenceIdAssigner, SerdeField, type SetQuery, type SettableFields, SimpleFieldSerde, type SqlCondition, type SqlPredicate, StubbedRelation, type Subquery, type SubqueryBrand, SubqueryRenderer, SuperstructSerde, type Table, type TableBrand, type TableFilter, type TableFor, type TableMgmt, type TableSourceBrand, type TableSourceMgmt, TaggedId, Temporal, TestUuidAssigner, TimestampCodec, TimestampFields, TimestampSerde, ToJsonHint, Todo, TooManyError, type TypeMap, type TypeMapEntry, type TypeNameOf, UniqueFilter, UnknownProperty, UpdateOp, type UpdateStatement, type UpdateValues, ValidationCode, type ValidationError, ValidationErrors, type ValidationRule, type ValidationRuleInternal, type ValidationRuleResult, ValueFilter, ValueGraphQLFilter, type WithInput, type WithLoaded, type WithSource, WriteFn, ZodSerde, ZonedDateTimeSerde, abbreviation, addTablePerClassJoinsAndClassTag, alias, aliases, appendStack, asConcreteCstr, asNew, assertIdIsTagged, assertIdsAreTagged, assertLoaded, assertNever, buildCteSql, buildRawQuery, buildUnnestCte, buildValueCondition, buildWhereClause, cannotBeChanged, cannotBeUpdated, cleanSql, cleanStringValue, configureMetadata, convertToLoadHint, createRowFromEntityData, deTagId, deTagIds, declareTable, deepNormalizeHint, defaultValue, driverAfterBegin, driverAfterCommit, driverApi, driverBeforeBegin, driverBeforeCommit, emptyRowData, ensureLoaded, ensureNotDeleted, ensureRectangularArraySizes, ensureTagged, ensureWithLoaded, entityQueryBrand, expr, exprBrand, factories, fail, failIfAnyRejected, failNoIdYet, filterSoftDeletes, findFilterField, generateOps, getAliasMetadata, getAliasMgmt, getBaseAndSelfMetas, getBaseMeta, getBaseSelfAndSubMetas, getConstructorFromTaggedId, getDefaultEntityLimit, getEmInternalApi, getField, getInstanceData, getLazyFields, getLens, getLensPath, getMaybeCtiAlias, getMetadata, getMetadataForField, getMetadataForTable, getMetadataForType, getProperties, getRelationEntries, getRelations, getRequiredKeys, getRuntimeConfig, getSubMetas, getTableMetadata, getTableMgmt, getTables, getTestIndex, hasAsyncMethod, hasAsyncProperty, hasAsyncReactiveField, hasCustomCollection, hasCustomReference, hasEnumCollection, hasLargeMany, hasLargeManyToMany, hasLazyField, hasMany, hasManyDerived, hasManyThrough, hasManyToMany, hasOne, hasOneDerived, hasOnePolymorphic, hasOneThrough, hasOneToOne, hasProperty, hasReactiveField, hasReactiveGetter, hasReactiveManyToMany, hasReactiveManyToManyOtherSide, hasReactiveProperty, hasReactiveReference, hasRecursiveChildren, hasRecursiveM2m, hasRecursiveParents, hasSerde, indexBy, internals, isAlias, isAllSqlPaths, isAsyncProperty, isAsyncReactiveField, isChangeableField, isCollection, isCollectionField, isDefined, isEntity, isFactoryCreation, isFieldSet, isId, isInTrustedContext, isKey, isLazyField, isLensLoaded, isLensLoadedPath, isLoaded, isLoadedAsyncProperty, isLoadedCollection, isLoadedLazyField, isLoadedOneToOneReference, isLoadedProperty, isLoadedReadOnlyCollection, isLoadedReference, isManyToManyEnumField, isManyToManyField, isManyToOneField, isManyToOneReference, isNew, isNewEntity, isOneToManyField, isOneToOneField, isOneToOneReference, isPolymorphicField, isPolymorphicReference, isProperty, isReactiveField, isReactiveGetter, isReactiveManyToMany, isReactiveManyToManyOtherSide, isReactiveReference, isReadOnlyCollection, isReference, isReferenceField, isRelation, isScope, isScopeJoinFilter, isSelectAllFilter, isTable, isTaggedId, isTypeOrSubType, keyToNumber, keyToTaggedId, kq, kqDot, kqStar, lazyExcludedSelects, lazyField, lensPathToLoadHint, lensToLoadHint, lensToPath, loadLens, loadLensPath, makeLike, mapPathsToTarget, mapToDb, maxValueRule, maybeAddIdNotNulls, maybeAddNotSoftDeleted, maybeAddOrderBy, maybeBranchValue, maybeGetConstructorFromReference, maybeNew, maybeNewPoly, maybePopulateThen, maybeRequireTemporal, maybeResolveReferenceToId, mergeFindOptions, minValueRule, mustBeSubType, newAliasProxy, newChangesProxy, newPgConnectionConfig, newRequiredLazyFieldRule, newRequiredRule, newScopeFn, newTableProxy, newTestInstance, noValue, noopFieldLogger, normalizeHint, nowUTC, opToFn, operators, optimizeCollectionJoins, parseAlias, parseEntityFilter, parseFindQuery, parseValueFilter, partition, plainDateMapper, plainDateTimeMapper, plainTimeMapper, polymorphicField, query, queryMaybe, rangeValueRule, recursiveQuery, requireTemporal, resetBootFlag, resetDefaultEntityLimit, resolveScope, reverseReactiveHint, runInTrustedContext, sameEntity, sameReference, setDefaultEntityLimit, setFactoryLogging, setFactoryWriter, setField, setLastNow, setOpt, setOpts, setReactionLogging, setRuntimeConfig, setTaggedIdDelimiter, skipCondition, sql, stiSubtypeFilter, subqueryBrand, table, tableMgmt, tables, tagFromId, tagId, tagIds, taggedIdPrefix, testIndex, testing, toIdOf, toJSON, toTaggedId, unsafeDeTagIds, unsafeLoaded, updatePartial, upsert, visitConditions, withLoaded, zeroTo, zonedDateTimeMapper };
178
180
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ba;;;;;cACA;2BAAA;;UA0QH,UAAU;EAClB,QAAQ;;KAGE,OAAO,GAAG,WAAW,IAAI,UAAU;;;;;;;;;;;;;;;iBAgB/B,QAAQ,UAAU,QAChC,QAAQ,GACR,QAAQ,QAAQ,OAAO,iBACvB;EAAS;EAAmB;;;;;;;;;iBAoBd,OAAO,UAAU,QAC/B,MAAM,eAAe,IACrB,QAAQ,GACR,aACA,aACA,mBACA;iBAwDc,iBAAiB,QAAQ,QAAQ;;KAOrC,cAAc,QACvB,WAAW,KAAK,EAAE;iBAGL,gBAAgB,UAAU,QAAQ,QAAQ;iBAC1C,gBAAgB,UAAU,QAAQ,MAAM,kBAAkB;iBAO1D,aAAa,QAAQ,SAAS;iBAM9B,mBAAmB,QAAQ,kBAAkB;;iBAO7C,eAAe,UAAU,QAAQ,MAAM,+BAA+B,KAAK,kBAAkB;;;;;;;;cAWhG,kBAAkB;;iBAGf,YAAY;;;;;;iBASZ,YAAY,UAAU,QAAQ,QAAQ,IAAI,UAAU,IAAI"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0Ba;;;;;cACA;2BAAA;;UAyRH,UAAU;EAClB,QAAQ;;KAGE,OAAO,GAAG,WAAW,IAAI,UAAU;;;;;;;;;;;;;;;iBAgB/B,QAAQ,UAAU,QAChC,QAAQ,GACR,QAAQ,QAAQ,OAAO,iBACvB;EAAS;EAAmB;;;;;;;;;iBAoBd,OAAO,UAAU,QAC/B,MAAM,eAAe,IACrB,QAAQ,GACR,aACA,aACA,mBACA;iBAwDc,iBAAiB,QAAQ,QAAQ;;KAOrC,cAAc,QACvB,WAAW,KAAK,EAAE;iBAGL,gBAAgB,UAAU,QAAQ,QAAQ;iBAC1C,gBAAgB,UAAU,QAAQ,MAAM,kBAAkB;iBAO1D,aAAa,QAAQ,SAAS;iBAM9B,mBAAmB,QAAQ,kBAAkB;;iBAO7C,eAAe,UAAU,QAAQ,MAAM,+BAA+B,KAAK,kBAAkB;;;;;;;;cAWhG,kBAAkB;;iBAGf,YAAY;;;;;;iBASZ,YAAY,UAAU,QAAQ,QAAQ,IAAI,UAAU,IAAI"}
package/build/index.js CHANGED
@@ -16,7 +16,7 @@ import { PropertyImpl, hasProperty, hasReactiveProperty, isLoadedProperty, isPro
16
16
  import { AsyncPropertyImpl, hasAsyncProperty, isAsyncProperty, isLoadedAsyncProperty } from "./relations/AsyncProperty.js";
17
17
  import { Temporal, maybeRequireTemporal, requireTemporal } from "./serde/temporal.js";
18
18
  import { getField, isChangeableField, isFieldSet, setField } from "./fields.js";
19
- import { assertIdIsTagged, assertIdsAreTagged, deTagId, deTagIds, ensureTagged, isTaggedId, keyToNumber, keyToTaggedId, maybeResolveReferenceToId, setTaggedIdDelimiter, tagFromId, tagId, tagIds, toIdOf, toTaggedId, unsafeDeTagIds } from "./keys.js";
19
+ import { assertIdIsTagged, assertIdsAreTagged, deTagId, deTagIds, ensureTagged, isTaggedId, keyToNumber, keyToTaggedId, maybeResolveReferenceToId, setTaggedIdDelimiter, tagFromId, tagId, tagIds, taggedIdPrefix, toIdOf, toTaggedId, unsafeDeTagIds } from "./keys.js";
20
20
  import { kq, kqDot, kqStar } from "./queries/sql/keywords.js";
21
21
  import { PojoRowData, emptyRowData } from "./RowData.js";
22
22
  import { LazyFieldImpl, hasLazyField, isLazyField, isLoadedLazyField } from "./relations/LazyField.js";
@@ -67,6 +67,10 @@ import { partitionHint } from "./preloading/partitionHint.js";
67
67
  import { opToFn, operators } from "./queries/find/EntityGraphQLFilter.js";
68
68
  import { buildValueCondition, buildWhereClause } from "./queries/renderConditions.js";
69
69
  import { AliasAssigner } from "./queries/sql/AliasAssigner.js";
70
+ import { Column } from "./serde/columns.js";
71
+ import { plainDateMapper, plainDateTimeMapper, plainTimeMapper, zonedDateTimeMapper } from "./serde/temporalMappers.js";
72
+ import { BigIntSerde, CustomSerdeAdapter, DateSerde, DecimalToNumberSerde, EnumArrayFieldSerde, EnumFieldSerde, JsonSerde, KeySerde, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, PrimitiveSerde, SuperstructSerde, ZodSerde, ZonedDateTimeSerde } from "./serde/serde.js";
73
+ import { declareTable } from "./queries/sql/custom.js";
70
74
  import { getTableMetadata, getTableMgmt, isTable, newTableProxy, table, tableMgmt, tables } from "./queries/sql/Tables.js";
71
75
  import { mergeFindOptions } from "./queries/find/EntityFilter.js";
72
76
  import { expr } from "./queries/sql/expressions/expression.js";
@@ -76,7 +80,6 @@ import { Plugin } from "./PluginManager.js";
76
80
  import { buildCteSql, buildRawQuery } from "./queries/find/buildFindQuery.js";
77
81
  import { optimizeCollectionJoins } from "./queries/find/QueryParser.collectionJoins.js";
78
82
  import { Todo } from "./flush/Todo.js";
79
- import { plainDateMapper, plainDateTimeMapper, plainTimeMapper, zonedDateTimeMapper } from "./serde/temporalMappers.js";
80
83
  import { buildUnnestCte, ensureRectangularArraySizes } from "./queries/unnest.js";
81
84
  import { generateOps } from "./drivers/EntityWriter.js";
82
85
  import { driverApi } from "./drivers/driverApi.js";
@@ -89,8 +92,6 @@ import { ImmutableEntitiesPlugin } from "./plugins/ImmutableEntitiesPlugin.js";
89
92
  import { JsonAggregatePreloader } from "./preloading/JsonAggregatePreloader.js";
90
93
  import { entityQueryBrand, query, queryMaybe, recursiveQuery, sql, subqueryBrand } from "./queries/sql/query.js";
91
94
  import { nowUTC } from "./nowUTC.js";
92
- import { BigIntSerde, CustomSerdeAdapter, DateSerde, DecimalToNumberSerde, EnumArrayFieldSerde, EnumFieldSerde, JsonSerde, KeySerde, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, PrimitiveSerde, SuperstructSerde, ZodSerde, ZonedDateTimeSerde } from "./serde/serde.js";
93
- import { Column } from "./serde/columns.js";
94
95
  import { updatePartial, upsert } from "./upsert.js";
95
96
  import { StubbedRelation, ensureWithLoaded, withLoaded } from "./loading/withLoaded.js";
96
97
  import { EntityManager, NotFoundError, ReadOnlyError, TooManyError, appendStack, createRowFromEntityData, driverAfterBegin, driverAfterCommit, driverBeforeBegin, driverBeforeCommit, getDefaultEntityLimit, getEmInternalApi, isDefined, isId, isKey, resetDefaultEntityLimit, sameEntity, sameReference, setDefaultEntityLimit, setLastNow } from "./EntityManager.js";
@@ -191,6 +192,6 @@ function isNewEntity(entity) {
191
192
  return entity.isNewEntity;
192
193
  }
193
194
  //#endregion
194
- export { AliasAssigner, AsyncPropertyImpl, BaseEntity, BigIntSerde, Column, ConditionBuilder, ConfigApi, CustomCollection, CustomReference, CustomSerdeAdapter, DateSerde, DecimalToNumberSerde, EntityManager, EnumArrayFieldSerde, EnumCollectionImpl, EnumFieldSerde, FieldColumn, FieldLogger, ImmutableEntitiesPlugin, InstanceData, JoinRowOperation, JsonAggregatePreloader, JsonSerde, KeySerde, LazyFieldImpl, ManyToManyCollection, ManyToManyLargeCollection, ManyToOneReferenceImpl, NoIdError, NotFoundError, OneToManyCollection, OneToManyLargeCollection, OneToOneReferenceImpl, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, Plugin, PojoRowData, PolyComponent, PolymorphicKeySerde, PolymorphicReferenceImpl, PrimitiveSerde, PropertyImpl, RandomUuidAssigner, ReactionLogger, ReactiveManyToManyImpl, ReactiveManyToManyOtherSideImpl, ReactiveReferenceImpl, ReadOnlyError, RecursiveCycleError, SequenceIdAssigner, SimpleFieldSerde, StubbedRelation, SuperstructSerde, Temporal, TestUuidAssigner, Todo, TooManyError, UnknownProperty, ValidationCode, ValidationErrors, ZodSerde, ZonedDateTimeSerde, abbreviation, addTablePerClassJoinsAndClassTag, alias, aliases, appendStack, asConcreteCstr, asNew, assertIdIsTagged, assertIdsAreTagged, assertLoaded, assertNever, buildCteSql, buildRawQuery, buildUnnestCte, buildValueCondition, buildWhereClause, cannotBeChanged, cannotBeUpdated, cleanSql, cleanStringValue, configureMetadata, convertToLoadHint, createRowFromEntityData, deTagId, deTagIds, deepNormalizeHint, defaultValue, driverAfterBegin, driverAfterCommit, driverApi, driverBeforeBegin, driverBeforeCommit, emptyRowData, ensureLoaded, ensureNotDeleted, ensureRectangularArraySizes, ensureTagged, ensureWithLoaded, entityQueryBrand, expr, exprBrand, factories, fail, failIfAnyRejected, failNoIdYet, filterSoftDeletes, findFilterField, generateOps, getAliasMetadata, getAliasMgmt, getBaseAndSelfMetas, getBaseMeta, getBaseSelfAndSubMetas, getConstructorFromTaggedId, getDefaultEntityLimit, getEmInternalApi, getField, getInstanceData, getLazyFields, getLens, getLensPath, getMaybeCtiAlias, getMetadata, getMetadataForField, getMetadataForTable, getMetadataForType, getProperties, getRelationEntries, getRelations, getRequiredKeys, getRuntimeConfig, getSubMetas, getTableMetadata, getTableMgmt, getTables, getTestIndex, hasAsyncMethod, hasAsyncProperty, hasAsyncReactiveField, hasCustomCollection, hasCustomReference, hasEnumCollection, hasLargeMany, hasLargeManyToMany, hasLazyField, hasMany, hasManyDerived, hasManyThrough, hasManyToMany, hasOne, hasOneDerived, hasOnePolymorphic, hasOneThrough, hasOneToOne, hasProperty, hasReactiveField, hasReactiveGetter, hasReactiveManyToMany, hasReactiveManyToManyOtherSide, hasReactiveProperty, hasReactiveReference, hasRecursiveChildren, hasRecursiveM2m, hasRecursiveParents, hasSerde, indexBy, internals, isAlias, isAllSqlPaths, isAsyncProperty, isAsyncReactiveField, isChangeableField, isCollection, isCollectionField, isDefined, isEntity, isFactoryCreation, isFieldSet, isId, isInTrustedContext, isKey, isLazyField, isLensLoaded, isLensLoadedPath, isLoaded, isLoadedAsyncProperty, isLoadedCollection, isLoadedLazyField, isLoadedOneToOneReference, isLoadedProperty, isLoadedReadOnlyCollection, isLoadedReference, isManyToManyEnumField, isManyToManyField, isManyToOneField, isManyToOneReference, isNew, isNewEntity, isOneToManyField, isOneToOneField, isOneToOneReference, isPolymorphicField, isPolymorphicReference, isProperty, isReactiveField, isReactiveGetter, isReactiveManyToMany, isReactiveManyToManyOtherSide, isReactiveReference, isReadOnlyCollection, isReference, isReferenceField, isRelation, isScope, isScopeJoinFilter, isSelectAllFilter, isTable, isTaggedId, isTypeOrSubType, keyToNumber, keyToTaggedId, kq, kqDot, kqStar, lazyExcludedSelects, lazyField, lensPathToLoadHint, lensToLoadHint, lensToPath, loadLens, loadLensPath, makeLike, mapPathsToTarget, mapToDb, maxValueRule, maybeAddIdNotNulls, maybeAddNotSoftDeleted, maybeAddOrderBy, maybeBranchValue, maybeGetConstructorFromReference, maybeNew, maybeNewPoly, maybePopulateThen, maybeRequireTemporal, maybeResolveReferenceToId, mergeFindOptions, minValueRule, mustBeSubType, newAliasProxy, newChangesProxy, newPgConnectionConfig, newRequiredLazyFieldRule, newRequiredRule, newScopeFn, newTableProxy, newTestInstance, noValue, noopFieldLogger, normalizeHint, nowUTC, opToFn, operators, optimizeCollectionJoins, parseAlias, parseEntityFilter, parseFindQuery, parseValueFilter, partition, plainDateMapper, plainDateTimeMapper, plainTimeMapper, polymorphicField, query, queryMaybe, rangeValueRule, recursiveQuery, requireTemporal, resetBootFlag, resetDefaultEntityLimit, resolveScope, reverseReactiveHint, runInTrustedContext, sameEntity, sameReference, setDefaultEntityLimit, setFactoryLogging, setFactoryWriter, setField, setLastNow, setOpt, setOpts, setReactionLogging, setRuntimeConfig, setTaggedIdDelimiter, skipCondition, sql, stiSubtypeFilter, subqueryBrand, table, tableMgmt, tables, tagFromId, tagId, tagIds, testIndex, testing, toIdOf, toJSON, toTaggedId, unsafeDeTagIds, unsafeLoaded, updatePartial, upsert, visitConditions, withLoaded, zeroTo, zonedDateTimeMapper };
195
+ export { AliasAssigner, AsyncPropertyImpl, BaseEntity, BigIntSerde, Column, ConditionBuilder, ConfigApi, CustomCollection, CustomReference, CustomSerdeAdapter, DateSerde, DecimalToNumberSerde, EntityManager, EnumArrayFieldSerde, EnumCollectionImpl, EnumFieldSerde, FieldColumn, FieldLogger, ImmutableEntitiesPlugin, InstanceData, JoinRowOperation, JsonAggregatePreloader, JsonSerde, KeySerde, LazyFieldImpl, ManyToManyCollection, ManyToManyLargeCollection, ManyToOneReferenceImpl, NoIdError, NotFoundError, OneToManyCollection, OneToManyLargeCollection, OneToOneReferenceImpl, PlainDateSerde, PlainDateTimeSerde, PlainTimeSerde, Plugin, PojoRowData, PolyComponent, PolymorphicKeySerde, PolymorphicReferenceImpl, PrimitiveSerde, PropertyImpl, RandomUuidAssigner, ReactionLogger, ReactiveManyToManyImpl, ReactiveManyToManyOtherSideImpl, ReactiveReferenceImpl, ReadOnlyError, RecursiveCycleError, SequenceIdAssigner, SimpleFieldSerde, StubbedRelation, SuperstructSerde, Temporal, TestUuidAssigner, Todo, TooManyError, UnknownProperty, ValidationCode, ValidationErrors, ZodSerde, ZonedDateTimeSerde, abbreviation, addTablePerClassJoinsAndClassTag, alias, aliases, appendStack, asConcreteCstr, asNew, assertIdIsTagged, assertIdsAreTagged, assertLoaded, assertNever, buildCteSql, buildRawQuery, buildUnnestCte, buildValueCondition, buildWhereClause, cannotBeChanged, cannotBeUpdated, cleanSql, cleanStringValue, configureMetadata, convertToLoadHint, createRowFromEntityData, deTagId, deTagIds, declareTable, deepNormalizeHint, defaultValue, driverAfterBegin, driverAfterCommit, driverApi, driverBeforeBegin, driverBeforeCommit, emptyRowData, ensureLoaded, ensureNotDeleted, ensureRectangularArraySizes, ensureTagged, ensureWithLoaded, entityQueryBrand, expr, exprBrand, factories, fail, failIfAnyRejected, failNoIdYet, filterSoftDeletes, findFilterField, generateOps, getAliasMetadata, getAliasMgmt, getBaseAndSelfMetas, getBaseMeta, getBaseSelfAndSubMetas, getConstructorFromTaggedId, getDefaultEntityLimit, getEmInternalApi, getField, getInstanceData, getLazyFields, getLens, getLensPath, getMaybeCtiAlias, getMetadata, getMetadataForField, getMetadataForTable, getMetadataForType, getProperties, getRelationEntries, getRelations, getRequiredKeys, getRuntimeConfig, getSubMetas, getTableMetadata, getTableMgmt, getTables, getTestIndex, hasAsyncMethod, hasAsyncProperty, hasAsyncReactiveField, hasCustomCollection, hasCustomReference, hasEnumCollection, hasLargeMany, hasLargeManyToMany, hasLazyField, hasMany, hasManyDerived, hasManyThrough, hasManyToMany, hasOne, hasOneDerived, hasOnePolymorphic, hasOneThrough, hasOneToOne, hasProperty, hasReactiveField, hasReactiveGetter, hasReactiveManyToMany, hasReactiveManyToManyOtherSide, hasReactiveProperty, hasReactiveReference, hasRecursiveChildren, hasRecursiveM2m, hasRecursiveParents, hasSerde, indexBy, internals, isAlias, isAllSqlPaths, isAsyncProperty, isAsyncReactiveField, isChangeableField, isCollection, isCollectionField, isDefined, isEntity, isFactoryCreation, isFieldSet, isId, isInTrustedContext, isKey, isLazyField, isLensLoaded, isLensLoadedPath, isLoaded, isLoadedAsyncProperty, isLoadedCollection, isLoadedLazyField, isLoadedOneToOneReference, isLoadedProperty, isLoadedReadOnlyCollection, isLoadedReference, isManyToManyEnumField, isManyToManyField, isManyToOneField, isManyToOneReference, isNew, isNewEntity, isOneToManyField, isOneToOneField, isOneToOneReference, isPolymorphicField, isPolymorphicReference, isProperty, isReactiveField, isReactiveGetter, isReactiveManyToMany, isReactiveManyToManyOtherSide, isReactiveReference, isReadOnlyCollection, isReference, isReferenceField, isRelation, isScope, isScopeJoinFilter, isSelectAllFilter, isTable, isTaggedId, isTypeOrSubType, keyToNumber, keyToTaggedId, kq, kqDot, kqStar, lazyExcludedSelects, lazyField, lensPathToLoadHint, lensToLoadHint, lensToPath, loadLens, loadLensPath, makeLike, mapPathsToTarget, mapToDb, maxValueRule, maybeAddIdNotNulls, maybeAddNotSoftDeleted, maybeAddOrderBy, maybeBranchValue, maybeGetConstructorFromReference, maybeNew, maybeNewPoly, maybePopulateThen, maybeRequireTemporal, maybeResolveReferenceToId, mergeFindOptions, minValueRule, mustBeSubType, newAliasProxy, newChangesProxy, newPgConnectionConfig, newRequiredLazyFieldRule, newRequiredRule, newScopeFn, newTableProxy, newTestInstance, noValue, noopFieldLogger, normalizeHint, nowUTC, opToFn, operators, optimizeCollectionJoins, parseAlias, parseEntityFilter, parseFindQuery, parseValueFilter, partition, plainDateMapper, plainDateTimeMapper, plainTimeMapper, polymorphicField, query, queryMaybe, rangeValueRule, recursiveQuery, requireTemporal, resetBootFlag, resetDefaultEntityLimit, resolveScope, reverseReactiveHint, runInTrustedContext, sameEntity, sameReference, setDefaultEntityLimit, setFactoryLogging, setFactoryWriter, setField, setLastNow, setOpt, setOpts, setReactionLogging, setRuntimeConfig, setTaggedIdDelimiter, skipCondition, sql, stiSubtypeFilter, subqueryBrand, table, tableMgmt, tables, tagFromId, tagId, tagIds, taggedIdPrefix, testIndex, testing, toIdOf, toJSON, toTaggedId, unsafeDeTagIds, unsafeLoaded, updatePartial, upsert, visitConditions, withLoaded, zeroTo, zonedDateTimeMapper };
195
196
 
196
197
  //# sourceMappingURL=index.js.map