orcaq 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +15 -0
- package/.output/public/_nuxt/8qASMGdV.js +1 -0
- package/.output/public/_nuxt/9lJACZIQ.js +19 -0
- package/.output/public/_nuxt/B2DnNiWd.js +1 -0
- package/.output/public/_nuxt/B6E6ObS_.js +8 -0
- package/.output/public/_nuxt/BH83_dXo.js +39 -0
- package/.output/public/_nuxt/BIKqrFbQ.js +1 -0
- package/.output/public/_nuxt/BNjPC06x.js +1 -0
- package/.output/public/_nuxt/BPQ-Pz1w.js +39 -0
- package/.output/public/_nuxt/BRpgKkVT.js +51 -0
- package/.output/public/_nuxt/BTCLPbPY.js +4 -0
- package/.output/public/_nuxt/BUV-RarV.js +1 -0
- package/.output/public/_nuxt/Bh6RgYlO.js +1 -0
- package/.output/public/_nuxt/Bq3cyzOD.js +1 -0
- package/.output/public/_nuxt/Bt9sU68B.js +9 -0
- package/.output/public/_nuxt/BwpH2ZxJ.js +1 -0
- package/.output/public/_nuxt/C25Tmn1m.js +1 -0
- package/.output/public/_nuxt/C2HlI1ss.js +1 -0
- package/.output/public/_nuxt/CU3ZV9iV.js +1 -0
- package/.output/public/_nuxt/CbcyysXi.js +1 -0
- package/.output/public/_nuxt/CepyvMhE.js +1 -0
- package/.output/public/_nuxt/CrgoNCm2.js +2 -0
- package/.output/public/_nuxt/CuBKbBH_.js +1 -0
- package/.output/public/_nuxt/CulD8qYQ.js +193 -0
- package/.output/public/_nuxt/CustomEdge.BNBpjEHb.css +1 -0
- package/.output/public/_nuxt/CylkLpwm.js +1 -0
- package/.output/public/_nuxt/D-bWLYHw.js +1 -0
- package/.output/public/_nuxt/D-zecHND.js +1 -0
- package/.output/public/_nuxt/D8vj6kFe.js +160 -0
- package/.output/public/_nuxt/DIETYtCL.js +1 -0
- package/.output/public/_nuxt/DJ4vUzxS.js +1 -0
- package/.output/public/_nuxt/DK-itzXx.js +8 -0
- package/.output/public/_nuxt/DL3T5jYo.js +3867 -0
- package/.output/public/_nuxt/DUsuhY9i.js +1 -0
- package/.output/public/_nuxt/DXV2HFBA.js +224 -0
- package/.output/public/_nuxt/Dh2zppOR.js +1 -0
- package/.output/public/_nuxt/DlAUqK2U.js +1 -0
- package/.output/public/_nuxt/DlmSeCnw.js +5 -0
- package/.output/public/_nuxt/DswTpYG4.js +1 -0
- package/.output/public/_nuxt/DynamicTable.DJeANwbG.css +1 -0
- package/.output/public/_nuxt/G830WtVn.js +1 -0
- package/.output/public/_nuxt/ICwM1E4-.js +15 -0
- package/.output/public/_nuxt/QZbJy9YW.js +31 -0
- package/.output/public/_nuxt/QuickQueryTable.DS_ON57S.css +1 -0
- package/.output/public/_nuxt/UXhX8z2W.js +1 -0
- package/.output/public/_nuxt/WrapperErdDiagram.DwhUd9Wr.css +1 -0
- package/.output/public/_nuxt/_fileId_.DmPfwyyD.css +1 -0
- package/.output/public/_nuxt/_tabViewId_.9Axt3zoi.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -0
- package/.output/public/_nuxt/builds/meta/6364d5cf-4642-479f-ba12-6440c56702af.json +1 -0
- package/.output/public/_nuxt/default.DixIpIal.css +1 -0
- package/.output/public/_nuxt/entry.GqPNPe1e.css +1 -0
- package/.output/public/_nuxt/index.CrXmf4gr.css +1 -0
- package/.output/public/_nuxt/ivUnXl9B.js +1 -0
- package/.output/public/_nuxt/pAheHeBV.js +36 -0
- package/.output/public/_nuxt/s5fCn4j5.js +1 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/logo.png +0 -0
- package/.output/public/manifest.json +25 -0
- package/.output/public/robots.txt +1 -0
- package/.output/public/vite.svg +1 -0
- package/.output/server/chunks/_/error-500.mjs +8 -0
- package/.output/server/chunks/_/error-500.mjs.map +1 -0
- package/.output/server/chunks/build/client.manifest.mjs +773 -0
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +6432 -0
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -0
- package/.output/server/chunks/routes/api/ai/chat.mjs +77 -0
- package/.output/server/chunks/routes/api/ai/chat.mjs.map +1 -0
- package/.output/server/chunks/routes/api/execute-bulk-delete.mjs +100 -0
- package/.output/server/chunks/routes/api/execute-bulk-delete.mjs.map +1 -0
- package/.output/server/chunks/routes/api/execute-bulk-update.mjs +105 -0
- package/.output/server/chunks/routes/api/execute-bulk-update.mjs.map +1 -0
- package/.output/server/chunks/routes/api/execute.mjs +47 -0
- package/.output/server/chunks/routes/api/execute.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-one-function.mjs +28 -0
- package/.output/server/chunks/routes/api/get-one-function.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-one-table.mjs +180 -0
- package/.output/server/chunks/routes/api/get-one-table.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-over-view-function.mjs +41 -0
- package/.output/server/chunks/routes/api/get-over-view-function.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-over-view-tables.mjs +53 -0
- package/.output/server/chunks/routes/api/get-over-view-tables.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs +112 -0
- package/.output/server/chunks/routes/api/get-reverse-table-schemas.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-schema-meta-data.mjs +152 -0
- package/.output/server/chunks/routes/api/get-schema-meta-data.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-table-size.mjs +49 -0
- package/.output/server/chunks/routes/api/get-table-size.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-table-structure.mjs +111 -0
- package/.output/server/chunks/routes/api/get-table-structure.mjs.map +1 -0
- package/.output/server/chunks/routes/api/get-tables.mjs +287 -0
- package/.output/server/chunks/routes/api/get-tables.mjs.map +1 -0
- package/.output/server/chunks/routes/api/getMetricMonitor.mjs +46 -0
- package/.output/server/chunks/routes/api/getMetricMonitor.mjs.map +1 -0
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +28 -0
- package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -0
- package/.output/server/chunks/routes/api/raw-execute.mjs +48 -0
- package/.output/server/chunks/routes/api/raw-execute.mjs.map +1 -0
- package/.output/server/chunks/routes/renderer.mjs +316 -0
- package/.output/server/chunks/routes/renderer.mjs.map +1 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs +4 -0
- package/.output/server/chunks/virtual/_virtual_spa-template.mjs.map +1 -0
- package/.output/server/index.mjs +14 -0
- package/.output/server/index.mjs.map +1 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/dist/index.mjs +4374 -0
- package/.output/server/node_modules/@ai-sdk/anthropic/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/gateway/dist/index.mjs +1082 -0
- package/.output/server/node_modules/@ai-sdk/gateway/package.json +69 -0
- package/.output/server/node_modules/@ai-sdk/google/dist/index.mjs +2007 -0
- package/.output/server/node_modules/@ai-sdk/google/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/openai/dist/index.mjs +5956 -0
- package/.output/server/node_modules/@ai-sdk/openai/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/dist/index.mjs +1551 -0
- package/.output/server/node_modules/@ai-sdk/openai-compatible/package.json +74 -0
- package/.output/server/node_modules/@ai-sdk/provider/dist/index.mjs +377 -0
- package/.output/server/node_modules/@ai-sdk/provider/package.json +57 -0
- package/.output/server/node_modules/@ai-sdk/provider-utils/dist/index.mjs +2549 -0
- package/.output/server/node_modules/@ai-sdk/provider-utils/package.json +75 -0
- package/.output/server/node_modules/@ai-sdk/xai/dist/index.mjs +2214 -0
- package/.output/server/node_modules/@ai-sdk/xai/package.json +68 -0
- package/.output/server/node_modules/@babel/parser/lib/index.js +14246 -0
- package/.output/server/node_modules/@babel/parser/package.json +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/index.mjs +350 -0
- package/.output/server/node_modules/@iconify/utils/lib/colors/keywords.mjs +188 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/common.mjs +90 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/format.mjs +38 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icon.mjs +76 -0
- package/.output/server/node_modules/@iconify/utils/lib/css/icons.mjs +168 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/bool.mjs +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/defaults.mjs +14 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/flip.mjs +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/merge.mjs +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/customisations/rotate.mjs +33 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/cleanup.mjs +51 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/convert.mjs +84 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/data.mjs +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/format.mjs +44 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/parse.mjs +58 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/base.mjs +231 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/create.mjs +31 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.mjs +164 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/similar.mjs +216 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/regex/tree.mjs +113 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/find.mjs +104 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/replace/replace.mjs +34 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/components.mjs +75 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/missing.mjs +97 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/name.mjs +54 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/parse.mjs +97 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/similar.mjs +45 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/tree.mjs +105 -0
- package/.output/server/node_modules/@iconify/utils/lib/emoji/test/variations.mjs +54 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/defaults.mjs +24 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/merge.mjs +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/name.mjs +53 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/square.mjs +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon/transformations.mjs +16 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/convert-info.mjs +182 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/expand.mjs +22 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icon.mjs +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/get-icons.mjs +46 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/minify.mjs +66 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/parse.mjs +51 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/tree.mjs +23 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.mjs +62 -0
- package/.output/server/node_modules/@iconify/utils/lib/icon-set/validate.mjs +161 -0
- package/.output/server/node_modules/@iconify/utils/lib/index.mjs +64 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/custom.mjs +50 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/loader.mjs +59 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/modern.mjs +80 -0
- package/.output/server/node_modules/@iconify/utils/lib/loader/utils.mjs +92 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/objects.mjs +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/strings.mjs +17 -0
- package/.output/server/node_modules/@iconify/utils/lib/misc/title.mjs +5 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/build.mjs +119 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/defs.mjs +30 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.mjs +20 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/html.mjs +9 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/id.mjs +28 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/inner-html.mjs +19 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/parse.mjs +83 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/pretty.mjs +70 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/size.mjs +40 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/trim.mjs +5 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/url.mjs +11 -0
- package/.output/server/node_modules/@iconify/utils/lib/svg/viewbox.mjs +8 -0
- package/.output/server/node_modules/@iconify/utils/package.json +447 -0
- package/.output/server/node_modules/@ioredis/commands/built/commands.json +2447 -0
- package/.output/server/node_modules/@ioredis/commands/built/index.js +208 -0
- package/.output/server/node_modules/@ioredis/commands/package.json +52 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/context.js +81 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/diag.js +93 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/metrics.js +61 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/propagation.js +89 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/api/trace.js +79 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js +63 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js +55 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js +23 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/baggage/utils.js +51 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js +38 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/context/context.js +55 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/context-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js +59 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js +57 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js +45 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag/types.js +44 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/diag-api.js +29 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/index.js +81 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/internal/global-utils.js +64 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/internal/semver.js +122 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/Metric.js +25 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/NoopMeter.js +127 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics/NoopMeterProvider.js +31 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/metrics-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/platform/index.js +29 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/platform/node/globalThis.js +22 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/platform/node/index.js +29 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js +34 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js +41 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/propagation-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js +69 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js +75 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js +32 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js +55 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js +54 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js +42 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/context-utils.js +82 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js +103 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js +46 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/internal/utils.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js +27 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/span_kind.js +46 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js +49 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/status.js +23 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace/trace_flags.js +26 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/trace-api.js +24 -0
- package/.output/server/node_modules/@opentelemetry/api/build/src/version.js +21 -0
- package/.output/server/node_modules/@opentelemetry/api/package.json +113 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Formatter.js +234 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Indentation.js +42 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/InlineBlock.js +60 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Params.js +21 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/Tokenizer.js +272 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/escapeRegExp.js +10 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/last.js +7 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/core/types.js +22 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/Db2Formatter.js +585 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/N1qlFormatter.js +257 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/PlSqlFormatter.js +459 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/StandardSqlFormatter.js +369 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/languages/utils/abstract.js +23 -0
- package/.output/server/node_modules/@sqltools/formatter/lib/sqlFormatter.js +34 -0
- package/.output/server/node_modules/@sqltools/formatter/package.json +59 -0
- package/.output/server/node_modules/@standard-schema/spec/dist/index.js +0 -0
- package/.output/server/node_modules/@standard-schema/spec/package.json +52 -0
- package/.output/server/node_modules/@vercel/oidc/dist/auth-config.js +84 -0
- package/.output/server/node_modules/@vercel/oidc/dist/get-context.js +34 -0
- package/.output/server/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js +80 -0
- package/.output/server/node_modules/@vercel/oidc/dist/index.js +33 -0
- package/.output/server/node_modules/@vercel/oidc/dist/oauth.js +88 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token-error.js +40 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token-io.js +78 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token-util.js +198 -0
- package/.output/server/node_modules/@vercel/oidc/dist/token.js +53 -0
- package/.output/server/node_modules/@vercel/oidc/package.json +52 -0
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6690 -0
- package/.output/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +686 -0
- package/.output/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1404 -0
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1789 -0
- package/.output/server/node_modules/@vue/reactivity/package.json +55 -0
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6654 -0
- package/.output/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1669 -0
- package/.output/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +857 -0
- package/.output/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +594 -0
- package/.output/server/node_modules/@vue/shared/package.json +47 -0
- package/.output/server/node_modules/ai/dist/index.mjs +12363 -0
- package/.output/server/node_modules/ai/package.json +106 -0
- package/.output/server/node_modules/ansis/index.js +1 -0
- package/.output/server/node_modules/ansis/package.json +28 -0
- package/.output/server/node_modules/app-root-path/index.js +4 -0
- package/.output/server/node_modules/app-root-path/lib/app-root-path.js +30 -0
- package/.output/server/node_modules/app-root-path/lib/resolve.js +128 -0
- package/.output/server/node_modules/app-root-path/package.json +66 -0
- package/.output/server/node_modules/balanced-match/index.js +62 -0
- package/.output/server/node_modules/balanced-match/package.json +48 -0
- package/.output/server/node_modules/bindings/bindings.js +221 -0
- package/.output/server/node_modules/bindings/package.json +28 -0
- package/.output/server/node_modules/brace-expansion/index.js +203 -0
- package/.output/server/node_modules/brace-expansion/package.json +46 -0
- package/.output/server/node_modules/cluster-key-slot/lib/index.js +166 -0
- package/.output/server/node_modules/cluster-key-slot/package.json +56 -0
- package/.output/server/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/.output/server/node_modules/consola/dist/core.mjs +512 -0
- package/.output/server/node_modules/consola/dist/index.mjs +651 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/.output/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/.output/server/node_modules/consola/package.json +136 -0
- package/.output/server/node_modules/dayjs/dayjs.min.js +1 -0
- package/.output/server/node_modules/dayjs/package.json +84 -0
- package/.output/server/node_modules/debug/package.json +65 -0
- package/.output/server/node_modules/debug/src/browser.js +272 -0
- package/.output/server/node_modules/debug/src/common.js +292 -0
- package/.output/server/node_modules/debug/src/index.js +10 -0
- package/.output/server/node_modules/debug/src/node.js +263 -0
- package/.output/server/node_modules/dedent/dist/dedent.js +73 -0
- package/.output/server/node_modules/dedent/package.json +119 -0
- package/.output/server/node_modules/denque/index.js +481 -0
- package/.output/server/node_modules/denque/package.json +58 -0
- package/.output/server/node_modules/devalue/index.js +3 -0
- package/.output/server/node_modules/devalue/package.json +34 -0
- package/.output/server/node_modules/devalue/src/base64.js +110 -0
- package/.output/server/node_modules/devalue/src/constants.js +6 -0
- package/.output/server/node_modules/devalue/src/parse.js +160 -0
- package/.output/server/node_modules/devalue/src/stringify.js +232 -0
- package/.output/server/node_modules/devalue/src/uneval.js +351 -0
- package/.output/server/node_modules/devalue/src/utils.js +113 -0
- package/.output/server/node_modules/dotenv/lib/main.js +361 -0
- package/.output/server/node_modules/dotenv/package.json +61 -0
- package/.output/server/node_modules/entities/lib/decode.js +536 -0
- package/.output/server/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/.output/server/node_modules/entities/package.json +90 -0
- package/.output/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/.output/server/node_modules/estree-walker/package.json +37 -0
- package/.output/server/node_modules/eventsource-parser/dist/index.js +106 -0
- package/.output/server/node_modules/eventsource-parser/dist/stream.js +29 -0
- package/.output/server/node_modules/eventsource-parser/package.json +115 -0
- package/.output/server/node_modules/file-uri-to-path/index.js +66 -0
- package/.output/server/node_modules/file-uri-to-path/package.json +32 -0
- package/.output/server/node_modules/glob/dist/commonjs/glob.js +247 -0
- package/.output/server/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/.output/server/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/.output/server/node_modules/glob/dist/commonjs/index.js +68 -0
- package/.output/server/node_modules/glob/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/glob/dist/commonjs/pattern.js +219 -0
- package/.output/server/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/.output/server/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/.output/server/node_modules/glob/package.json +99 -0
- package/.output/server/node_modules/has-flag/index.js +8 -0
- package/.output/server/node_modules/has-flag/package.json +46 -0
- package/.output/server/node_modules/hookable/dist/index.mjs +290 -0
- package/.output/server/node_modules/hookable/package.json +49 -0
- package/.output/server/node_modules/inherits/inherits.js +9 -0
- package/.output/server/node_modules/inherits/inherits_browser.js +27 -0
- package/.output/server/node_modules/inherits/package.json +29 -0
- package/.output/server/node_modules/ioredis/built/Command.js +349 -0
- package/.output/server/node_modules/ioredis/built/DataHandler.js +220 -0
- package/.output/server/node_modules/ioredis/built/Pipeline.js +334 -0
- package/.output/server/node_modules/ioredis/built/Redis.js +697 -0
- package/.output/server/node_modules/ioredis/built/ScanStream.js +51 -0
- package/.output/server/node_modules/ioredis/built/Script.js +62 -0
- package/.output/server/node_modules/ioredis/built/SubscriptionSet.js +41 -0
- package/.output/server/node_modules/ioredis/built/autoPipelining.js +159 -0
- package/.output/server/node_modules/ioredis/built/cluster/ClusterOptions.js +22 -0
- package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriber.js +202 -0
- package/.output/server/node_modules/ioredis/built/cluster/ClusterSubscriberGroup.js +224 -0
- package/.output/server/node_modules/ioredis/built/cluster/ConnectionPool.js +154 -0
- package/.output/server/node_modules/ioredis/built/cluster/DelayQueue.js +53 -0
- package/.output/server/node_modules/ioredis/built/cluster/index.js +862 -0
- package/.output/server/node_modules/ioredis/built/cluster/util.js +100 -0
- package/.output/server/node_modules/ioredis/built/connectors/AbstractConnector.js +26 -0
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/FailoverDetector.js +45 -0
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/SentinelIterator.js +37 -0
- package/.output/server/node_modules/ioredis/built/connectors/SentinelConnector/index.js +305 -0
- package/.output/server/node_modules/ioredis/built/connectors/StandaloneConnector.js +69 -0
- package/.output/server/node_modules/ioredis/built/connectors/index.js +7 -0
- package/.output/server/node_modules/ioredis/built/constants/TLSProfiles.js +149 -0
- package/.output/server/node_modules/ioredis/built/errors/ClusterAllFailedError.js +15 -0
- package/.output/server/node_modules/ioredis/built/errors/MaxRetriesPerRequestError.js +14 -0
- package/.output/server/node_modules/ioredis/built/errors/index.js +5 -0
- package/.output/server/node_modules/ioredis/built/index.js +62 -0
- package/.output/server/node_modules/ioredis/built/redis/RedisOptions.js +55 -0
- package/.output/server/node_modules/ioredis/built/redis/event_handler.js +292 -0
- package/.output/server/node_modules/ioredis/built/transaction.js +93 -0
- package/.output/server/node_modules/ioredis/built/utils/Commander.js +117 -0
- package/.output/server/node_modules/ioredis/built/utils/applyMixin.js +8 -0
- package/.output/server/node_modules/ioredis/built/utils/debug.js +95 -0
- package/.output/server/node_modules/ioredis/built/utils/index.js +297 -0
- package/.output/server/node_modules/ioredis/built/utils/lodash.js +9 -0
- package/.output/server/node_modules/ioredis/package.json +100 -0
- package/.output/server/node_modules/lodash.defaults/index.js +668 -0
- package/.output/server/node_modules/lodash.defaults/package.json +19 -0
- package/.output/server/node_modules/lodash.isarguments/index.js +229 -0
- package/.output/server/node_modules/lodash.isarguments/package.json +19 -0
- package/.output/server/node_modules/lru-cache/dist/commonjs/index.js +1546 -0
- package/.output/server/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/lru-cache/package.json +116 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/ast.js +592 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/escape.js +22 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/index.js +1017 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/minimatch/dist/commonjs/unescape.js +24 -0
- package/.output/server/node_modules/minimatch/package.json +82 -0
- package/.output/server/node_modules/minipass/dist/commonjs/index.js +1028 -0
- package/.output/server/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/minipass/package.json +82 -0
- package/.output/server/node_modules/ms/index.js +162 -0
- package/.output/server/node_modules/ms/package.json +38 -0
- package/.output/server/node_modules/path-scurry/dist/commonjs/index.js +2014 -0
- package/.output/server/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/.output/server/node_modules/path-scurry/package.json +89 -0
- package/.output/server/node_modules/pg/lib/client.js +650 -0
- package/.output/server/node_modules/pg/lib/connection-parameters.js +167 -0
- package/.output/server/node_modules/pg/lib/connection.js +222 -0
- package/.output/server/node_modules/pg/lib/crypto/cert-signatures.js +121 -0
- package/.output/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/.output/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/.output/server/node_modules/pg/lib/crypto/utils-webcrypto.js +88 -0
- package/.output/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/.output/server/node_modules/pg/lib/defaults.js +84 -0
- package/.output/server/node_modules/pg/lib/index.js +58 -0
- package/.output/server/node_modules/pg/lib/native/client.js +307 -0
- package/.output/server/node_modules/pg/lib/native/index.js +2 -0
- package/.output/server/node_modules/pg/lib/native/query.js +168 -0
- package/.output/server/node_modules/pg/lib/query.js +253 -0
- package/.output/server/node_modules/pg/lib/result.js +108 -0
- package/.output/server/node_modules/pg/lib/stream.js +81 -0
- package/.output/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/.output/server/node_modules/pg/lib/utils.js +206 -0
- package/.output/server/node_modules/pg/package.json +62 -0
- package/.output/server/node_modules/pg-cloudflare/dist/empty.js +4 -0
- package/.output/server/node_modules/pg-cloudflare/package.json +32 -0
- package/.output/server/node_modules/pg-connection-string/index.js +112 -0
- package/.output/server/node_modules/pg-connection-string/package.json +40 -0
- package/.output/server/node_modules/pg-cursor/index.js +265 -0
- package/.output/server/node_modules/pg-cursor/package.json +38 -0
- package/.output/server/node_modules/pg-int8/index.js +100 -0
- package/.output/server/node_modules/pg-int8/package.json +24 -0
- package/.output/server/node_modules/pg-pool/index.js +471 -0
- package/.output/server/node_modules/pg-pool/package.json +41 -0
- package/.output/server/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
- package/.output/server/node_modules/pg-protocol/dist/buffer-writer.js +81 -0
- package/.output/server/node_modules/pg-protocol/dist/index.js +15 -0
- package/.output/server/node_modules/pg-protocol/dist/messages.js +160 -0
- package/.output/server/node_modules/pg-protocol/dist/parser.js +304 -0
- package/.output/server/node_modules/pg-protocol/dist/serializer.js +189 -0
- package/.output/server/node_modules/pg-protocol/package.json +35 -0
- package/.output/server/node_modules/pg-query-stream/dist/index.js +48 -0
- package/.output/server/node_modules/pg-query-stream/package.json +60 -0
- package/.output/server/node_modules/pg-types/index.js +47 -0
- package/.output/server/node_modules/pg-types/lib/arrayParser.js +11 -0
- package/.output/server/node_modules/pg-types/lib/binaryParsers.js +257 -0
- package/.output/server/node_modules/pg-types/lib/builtins.js +73 -0
- package/.output/server/node_modules/pg-types/lib/textParsers.js +215 -0
- package/.output/server/node_modules/pg-types/package.json +42 -0
- package/.output/server/node_modules/pgpass/lib/helper.js +233 -0
- package/.output/server/node_modules/pgpass/lib/index.js +23 -0
- package/.output/server/node_modules/pgpass/package.json +41 -0
- package/.output/server/node_modules/postgres-array/index.js +97 -0
- package/.output/server/node_modules/postgres-array/package.json +35 -0
- package/.output/server/node_modules/postgres-bytea/index.js +31 -0
- package/.output/server/node_modules/postgres-bytea/package.json +34 -0
- package/.output/server/node_modules/postgres-date/index.js +116 -0
- package/.output/server/node_modules/postgres-date/package.json +33 -0
- package/.output/server/node_modules/postgres-interval/index.js +125 -0
- package/.output/server/node_modules/postgres-interval/package.json +36 -0
- package/.output/server/node_modules/redis-errors/index.js +7 -0
- package/.output/server/node_modules/redis-errors/lib/modern.js +59 -0
- package/.output/server/node_modules/redis-errors/lib/old.js +119 -0
- package/.output/server/node_modules/redis-errors/package.json +41 -0
- package/.output/server/node_modules/redis-parser/index.js +3 -0
- package/.output/server/node_modules/redis-parser/lib/parser.js +552 -0
- package/.output/server/node_modules/redis-parser/package.json +53 -0
- package/.output/server/node_modules/reflect-metadata/Reflect.js +1415 -0
- package/.output/server/node_modules/reflect-metadata/package.json +68 -0
- package/.output/server/node_modules/safe-buffer/index.js +65 -0
- package/.output/server/node_modules/safe-buffer/package.json +51 -0
- package/.output/server/node_modules/sha.js/hash.js +81 -0
- package/.output/server/node_modules/sha.js/index.js +15 -0
- package/.output/server/node_modules/sha.js/package.json +30 -0
- package/.output/server/node_modules/sha.js/sha.js +94 -0
- package/.output/server/node_modules/sha.js/sha1.js +99 -0
- package/.output/server/node_modules/sha.js/sha224.js +53 -0
- package/.output/server/node_modules/sha.js/sha256.js +135 -0
- package/.output/server/node_modules/sha.js/sha384.js +57 -0
- package/.output/server/node_modules/sha.js/sha512.js +260 -0
- package/.output/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/.output/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/.output/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/.output/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/.output/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/.output/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/.output/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/.output/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/.output/server/node_modules/source-map-js/lib/util.js +594 -0
- package/.output/server/node_modules/source-map-js/package.json +71 -0
- package/.output/server/node_modules/source-map-js/source-map.js +8 -0
- package/.output/server/node_modules/split2/index.js +141 -0
- package/.output/server/node_modules/split2/package.json +39 -0
- package/.output/server/node_modules/sql-highlight/lib/escapeHtml.js +59 -0
- package/.output/server/node_modules/sql-highlight/lib/index.js +85 -0
- package/.output/server/node_modules/sql-highlight/lib/keywords.js +145 -0
- package/.output/server/node_modules/sql-highlight/package.json +49 -0
- package/.output/server/node_modules/sqlite3/build/Release/node_sqlite3.node +0 -0
- package/.output/server/node_modules/sqlite3/build/Release/node_sqlite3.node.bak +0 -0
- package/.output/server/node_modules/sqlite3/lib/sqlite3-binding.js +1 -0
- package/.output/server/node_modules/sqlite3/lib/sqlite3.js +207 -0
- package/.output/server/node_modules/sqlite3/lib/trace.js +38 -0
- package/.output/server/node_modules/sqlite3/package.json +89 -0
- package/.output/server/node_modules/standard-as-callback/built/index.js +41 -0
- package/.output/server/node_modules/standard-as-callback/built/utils.js +23 -0
- package/.output/server/node_modules/standard-as-callback/package.json +40 -0
- package/.output/server/node_modules/supports-color/index.js +152 -0
- package/.output/server/node_modules/supports-color/package.json +58 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/node_modules/typeorm/cache/DbQueryResultCache.js +264 -0
- package/.output/server/node_modules/typeorm/cache/QueryResultCacheFactory.js +42 -0
- package/.output/server/node_modules/typeorm/cache/RedisQueryResultCache.js +197 -0
- package/.output/server/node_modules/typeorm/common/DeepPartial.js +4 -0
- package/.output/server/node_modules/typeorm/common/EntityTarget.js +4 -0
- package/.output/server/node_modules/typeorm/common/MixedList.js +4 -0
- package/.output/server/node_modules/typeorm/common/ObjectLiteral.js +4 -0
- package/.output/server/node_modules/typeorm/common/ObjectType.js +4 -0
- package/.output/server/node_modules/typeorm/common/RelationType.js +4 -0
- package/.output/server/node_modules/typeorm/connection/Connection.js +16 -0
- package/.output/server/node_modules/typeorm/connection/ConnectionManager.js +66 -0
- package/.output/server/node_modules/typeorm/connection/ConnectionMetadataBuilder.js +74 -0
- package/.output/server/node_modules/typeorm/connection/ConnectionOptionsReader.js +198 -0
- package/.output/server/node_modules/typeorm/connection/options-reader/ConnectionOptionsEnvReader.js +111 -0
- package/.output/server/node_modules/typeorm/container.js +60 -0
- package/.output/server/node_modules/typeorm/data-source/DataSource.js +517 -0
- package/.output/server/node_modules/typeorm/decorator/Check.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/EntityRepository.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/Exclusion.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/ForeignKey.js +44 -0
- package/.output/server/node_modules/typeorm/decorator/Generated.js +24 -0
- package/.output/server/node_modules/typeorm/decorator/Index.js +56 -0
- package/.output/server/node_modules/typeorm/decorator/Unique.js +50 -0
- package/.output/server/node_modules/typeorm/decorator/columns/Column.js +78 -0
- package/.output/server/node_modules/typeorm/decorator/columns/CreateDateColumn.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/columns/DeleteDateColumn.js +20 -0
- package/.output/server/node_modules/typeorm/decorator/columns/ObjectIdColumn.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/columns/PrimaryColumn.js +63 -0
- package/.output/server/node_modules/typeorm/decorator/columns/PrimaryGeneratedColumn.js +59 -0
- package/.output/server/node_modules/typeorm/decorator/columns/UpdateDateColumn.js +20 -0
- package/.output/server/node_modules/typeorm/decorator/columns/VersionColumn.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/columns/ViewColumn.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/columns/VirtualColumn.js +49 -0
- package/.output/server/node_modules/typeorm/decorator/entity/ChildEntity.js +25 -0
- package/.output/server/node_modules/typeorm/decorator/entity/Entity.js +31 -0
- package/.output/server/node_modules/typeorm/decorator/entity/TableInheritance.js +22 -0
- package/.output/server/node_modules/typeorm/decorator/entity-view/ViewEntity.js +32 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterInsert.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterLoad.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterRecover.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterSoftRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/AfterUpdate.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeInsert.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRecover.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeSoftRemove.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/BeforeUpdate.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/listeners/EventSubscriber.js +17 -0
- package/.output/server/node_modules/typeorm/decorator/options/ColumnOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/EntityOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/IndexOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/JoinColumnOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/JoinTableOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/RelationOptions.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/options/ValueTransformer.js +4 -0
- package/.output/server/node_modules/typeorm/decorator/relations/JoinColumn.js +27 -0
- package/.output/server/node_modules/typeorm/decorator/relations/JoinTable.js +34 -0
- package/.output/server/node_modules/typeorm/decorator/relations/ManyToMany.js +46 -0
- package/.output/server/node_modules/typeorm/decorator/relations/ManyToOne.js +46 -0
- package/.output/server/node_modules/typeorm/decorator/relations/OneToMany.js +37 -0
- package/.output/server/node_modules/typeorm/decorator/relations/OneToOne.js +45 -0
- package/.output/server/node_modules/typeorm/decorator/relations/RelationCount.js +23 -0
- package/.output/server/node_modules/typeorm/decorator/relations/RelationId.js +22 -0
- package/.output/server/node_modules/typeorm/decorator/tree/Tree.js +21 -0
- package/.output/server/node_modules/typeorm/decorator/tree/TreeChildren.js +34 -0
- package/.output/server/node_modules/typeorm/decorator/tree/TreeLevelColumn.js +19 -0
- package/.output/server/node_modules/typeorm/decorator/tree/TreeParent.js +33 -0
- package/.output/server/node_modules/typeorm/driver/DriverFactory.js +98 -0
- package/.output/server/node_modules/typeorm/driver/DriverUtils.js +228 -0
- package/.output/server/node_modules/typeorm/driver/Query.js +16 -0
- package/.output/server/node_modules/typeorm/driver/SqlInMemory.js +15 -0
- package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlDriver.js +847 -0
- package/.output/server/node_modules/typeorm/driver/aurora-mysql/AuroraMysqlQueryRunner.js +1709 -0
- package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresDriver.js +103 -0
- package/.output/server/node_modules/typeorm/driver/aurora-postgres/AuroraPostgresQueryRunner.js +146 -0
- package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3Driver.js +153 -0
- package/.output/server/node_modules/typeorm/driver/better-sqlite3/BetterSqlite3QueryRunner.js +126 -0
- package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorDriver.js +78 -0
- package/.output/server/node_modules/typeorm/driver/capacitor/CapacitorQueryRunner.js +98 -0
- package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachDriver.js +885 -0
- package/.output/server/node_modules/typeorm/driver/cockroachdb/CockroachQueryRunner.js +2453 -0
- package/.output/server/node_modules/typeorm/driver/cordova/CordovaDriver.js +76 -0
- package/.output/server/node_modules/typeorm/driver/cordova/CordovaQueryRunner.js +170 -0
- package/.output/server/node_modules/typeorm/driver/expo/ExpoDriver.js +29 -0
- package/.output/server/node_modules/typeorm/driver/expo/ExpoDriverFactory.js +22 -0
- package/.output/server/node_modules/typeorm/driver/expo/ExpoQueryRunner.js +65 -0
- package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyDriver.js +75 -0
- package/.output/server/node_modules/typeorm/driver/expo/legacy/ExpoLegacyQueryRunner.js +169 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/MongoDriver.js +404 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/MongoQueryRunner.js +701 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/bson.typings.js +5 -0
- package/.output/server/node_modules/typeorm/driver/mongodb/typings.js +23 -0
- package/.output/server/node_modules/typeorm/driver/mysql/MysqlDriver.js +1105 -0
- package/.output/server/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js +2139 -0
- package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptDriver.js +94 -0
- package/.output/server/node_modules/typeorm/driver/nativescript/NativescriptQueryRunner.js +92 -0
- package/.output/server/node_modules/typeorm/driver/oracle/OracleDriver.js +869 -0
- package/.output/server/node_modules/typeorm/driver/oracle/OracleQueryRunner.js +1884 -0
- package/.output/server/node_modules/typeorm/driver/postgres/PostgresDriver.js +1259 -0
- package/.output/server/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js +2729 -0
- package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeDriver.js +728 -0
- package/.output/server/node_modules/typeorm/driver/react-native/ReactNativeQueryRunner.js +107 -0
- package/.output/server/node_modules/typeorm/driver/sap/SapDriver.js +681 -0
- package/.output/server/node_modules/typeorm/driver/sap/SapQueryRunner.js +2054 -0
- package/.output/server/node_modules/typeorm/driver/spanner/SpannerDriver.js +613 -0
- package/.output/server/node_modules/typeorm/driver/spanner/SpannerQueryRunner.js +1464 -0
- package/.output/server/node_modules/typeorm/driver/sqlite/SqliteDriver.js +174 -0
- package/.output/server/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js +124 -0
- package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteDriver.js +695 -0
- package/.output/server/node_modules/typeorm/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +1511 -0
- package/.output/server/node_modules/typeorm/driver/sqljs/SqljsDriver.js +250 -0
- package/.output/server/node_modules/typeorm/driver/sqljs/SqljsQueryRunner.js +123 -0
- package/.output/server/node_modules/typeorm/driver/sqlserver/MssqlParameter.js +23 -0
- package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerDriver.js +922 -0
- package/.output/server/node_modules/typeorm/driver/sqlserver/SqlServerQueryRunner.js +2484 -0
- package/.output/server/node_modules/typeorm/driver/types/DatabaseType.js +4 -0
- package/.output/server/node_modules/typeorm/driver/types/GeoJsonTypes.js +4 -0
- package/.output/server/node_modules/typeorm/driver/types/MetadataTableType.js +11 -0
- package/.output/server/node_modules/typeorm/driver/types/ReplicationMode.js +4 -0
- package/.output/server/node_modules/typeorm/entity-manager/EntityManager.js +853 -0
- package/.output/server/node_modules/typeorm/entity-manager/EntityManagerFactory.js +24 -0
- package/.output/server/node_modules/typeorm/entity-manager/MongoEntityManager.js +668 -0
- package/.output/server/node_modules/typeorm/entity-manager/SqljsEntityManager.js +44 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchema.js +15 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedColumnOptions.js +8 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaEmbeddedError.js +18 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaOptions.js +11 -0
- package/.output/server/node_modules/typeorm/entity-schema/EntitySchemaTransformer.js +333 -0
- package/.output/server/node_modules/typeorm/error/AlreadyHasActiveConnectionError.js +16 -0
- package/.output/server/node_modules/typeorm/error/CannotAttachTreeChildrenEntityError.js +16 -0
- package/.output/server/node_modules/typeorm/error/CannotConnectAlreadyConnectedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CannotCreateEntityIdMapError.js +21 -0
- package/.output/server/node_modules/typeorm/error/CannotDetermineEntityError.js +16 -0
- package/.output/server/node_modules/typeorm/error/CannotExecuteNotConnectedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CannotGetEntityManagerNotConnectedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CannotReflectMethodParameterTypeError.js +18 -0
- package/.output/server/node_modules/typeorm/error/CircularRelationsError.js +16 -0
- package/.output/server/node_modules/typeorm/error/ColumnTypeUndefinedError.js +19 -0
- package/.output/server/node_modules/typeorm/error/ConnectionIsNotSetError.js +15 -0
- package/.output/server/node_modules/typeorm/error/ConnectionNotFoundError.js +15 -0
- package/.output/server/node_modules/typeorm/error/CustomRepositoryCannotInheritRepositoryError.js +18 -0
- package/.output/server/node_modules/typeorm/error/CustomRepositoryDoesNotHaveEntityError.js +18 -0
- package/.output/server/node_modules/typeorm/error/CustomRepositoryNotFoundError.js +18 -0
- package/.output/server/node_modules/typeorm/error/DataTypeNotSupportedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/DriverOptionNotSetError.js +16 -0
- package/.output/server/node_modules/typeorm/error/DriverPackageNotInstalledError.js +16 -0
- package/.output/server/node_modules/typeorm/error/EntityMetadataNotFoundError.js +29 -0
- package/.output/server/node_modules/typeorm/error/EntityNotFoundError.js +42 -0
- package/.output/server/node_modules/typeorm/error/EntityPropertyNotFoundError.js +17 -0
- package/.output/server/node_modules/typeorm/error/FindRelationsNotFoundError.js +23 -0
- package/.output/server/node_modules/typeorm/error/ForbiddenTransactionModeOverrideError.js +16 -0
- package/.output/server/node_modules/typeorm/error/InitializedRelationError.js +20 -0
- package/.output/server/node_modules/typeorm/error/InsertValuesMissingError.js +16 -0
- package/.output/server/node_modules/typeorm/error/LimitOnUpdateNotSupportedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/LockNotSupportedOnGivenDriverError.js +15 -0
- package/.output/server/node_modules/typeorm/error/MetadataAlreadyExistsError.js +18 -0
- package/.output/server/node_modules/typeorm/error/MetadataWithSuchNameAlreadyExistsError.js +16 -0
- package/.output/server/node_modules/typeorm/error/MissingDeleteDateColumnError.js +12 -0
- package/.output/server/node_modules/typeorm/error/MissingDriverError.js +16 -0
- package/.output/server/node_modules/typeorm/error/MissingJoinColumnError.js +23 -0
- package/.output/server/node_modules/typeorm/error/MissingJoinTableError.js +23 -0
- package/.output/server/node_modules/typeorm/error/MissingPrimaryColumnError.js +13 -0
- package/.output/server/node_modules/typeorm/error/MustBeEntityError.js +15 -0
- package/.output/server/node_modules/typeorm/error/NestedSetMultipleRootError.js +12 -0
- package/.output/server/node_modules/typeorm/error/NoConnectionForRepositoryError.js +16 -0
- package/.output/server/node_modules/typeorm/error/NoConnectionOptionError.js +16 -0
- package/.output/server/node_modules/typeorm/error/NoNeedToReleaseEntityManagerError.js +17 -0
- package/.output/server/node_modules/typeorm/error/NoVersionOrUpdateDateColumnError.js +15 -0
- package/.output/server/node_modules/typeorm/error/OffsetWithoutLimitNotSupportedError.js +17 -0
- package/.output/server/node_modules/typeorm/error/OptimisticLockCanNotBeUsedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/OptimisticLockVersionMismatchError.js +15 -0
- package/.output/server/node_modules/typeorm/error/PersistedEntityNotFoundError.js +15 -0
- package/.output/server/node_modules/typeorm/error/PessimisticLockTransactionRequiredError.js +15 -0
- package/.output/server/node_modules/typeorm/error/PrimaryColumnCannotBeNullableError.js +13 -0
- package/.output/server/node_modules/typeorm/error/QueryFailedError.js +30 -0
- package/.output/server/node_modules/typeorm/error/QueryRunnerAlreadyReleasedError.js +12 -0
- package/.output/server/node_modules/typeorm/error/QueryRunnerProviderAlreadyReleasedError.js +16 -0
- package/.output/server/node_modules/typeorm/error/RepositoryNotTreeError.js +32 -0
- package/.output/server/node_modules/typeorm/error/ReturningStatementNotSupportedError.js +16 -0
- package/.output/server/node_modules/typeorm/error/SubjectRemovedAndUpdatedError.js +16 -0
- package/.output/server/node_modules/typeorm/error/SubjectWithoutIdentifierError.js +17 -0
- package/.output/server/node_modules/typeorm/error/TransactionAlreadyStartedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/TransactionNotStartedError.js +15 -0
- package/.output/server/node_modules/typeorm/error/TreeRepositoryNotSupportedError.js +12 -0
- package/.output/server/node_modules/typeorm/error/TypeORMError.js +23 -0
- package/.output/server/node_modules/typeorm/error/UpdateValuesMissingError.js +12 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinColumnIsNotAllowedError.js +13 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinColumnOnlyOnOneSideAllowedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinTableIsNotAllowedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/UsingJoinTableOnlyOnOneSideAllowedError.js +14 -0
- package/.output/server/node_modules/typeorm/error/index.js +66 -0
- package/.output/server/node_modules/typeorm/find-options/EqualOperator.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/FindManyOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOneOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOperator.js +96 -0
- package/.output/server/node_modules/typeorm/find-options/FindOperatorType.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsOrder.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsRelations.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsSelect.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsUtils.js +350 -0
- package/.output/server/node_modules/typeorm/find-options/FindOptionsWhere.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/FindTreeOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/JoinOptions.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/OrderByCondition.js +4 -0
- package/.output/server/node_modules/typeorm/find-options/operator/And.js +9 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Any.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayContainedBy.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayContains.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ArrayOverlap.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Between.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Equal.js +17 -0
- package/.output/server/node_modules/typeorm/find-options/operator/ILike.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/In.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/IsNull.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/JsonContains.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/LessThan.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/LessThanOrEqual.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Like.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/MoreThan.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/MoreThanOrEqual.js +13 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Not.js +14 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Or.js +9 -0
- package/.output/server/node_modules/typeorm/find-options/operator/Raw.js +12 -0
- package/.output/server/node_modules/typeorm/globals.js +182 -0
- package/.output/server/node_modules/typeorm/index.js +196 -0
- package/.output/server/node_modules/typeorm/index.mjs +422 -0
- package/.output/server/node_modules/typeorm/logger/AbstractLogger.js +238 -0
- package/.output/server/node_modules/typeorm/logger/AdvancedConsoleLogger.js +56 -0
- package/.output/server/node_modules/typeorm/logger/DebugLogger.js +78 -0
- package/.output/server/node_modules/typeorm/logger/FileLogger.js +88 -0
- package/.output/server/node_modules/typeorm/logger/FormattedConsoleLogger.js +59 -0
- package/.output/server/node_modules/typeorm/logger/Logger.js +4 -0
- package/.output/server/node_modules/typeorm/logger/LoggerFactory.js +39 -0
- package/.output/server/node_modules/typeorm/logger/LoggerOptions.js +4 -0
- package/.output/server/node_modules/typeorm/logger/SimpleConsoleLogger.js +57 -0
- package/.output/server/node_modules/typeorm/metadata/CheckMetadata.js +35 -0
- package/.output/server/node_modules/typeorm/metadata/ColumnMetadata.js +618 -0
- package/.output/server/node_modules/typeorm/metadata/EmbeddedMetadata.js +224 -0
- package/.output/server/node_modules/typeorm/metadata/EntityListenerMetadata.js +77 -0
- package/.output/server/node_modules/typeorm/metadata/EntityMetadata.js +692 -0
- package/.output/server/node_modules/typeorm/metadata/ExclusionMetadata.js +35 -0
- package/.output/server/node_modules/typeorm/metadata/ForeignKeyMetadata.js +57 -0
- package/.output/server/node_modules/typeorm/metadata/IndexMetadata.js +144 -0
- package/.output/server/node_modules/typeorm/metadata/RelationCountMetadata.js +39 -0
- package/.output/server/node_modules/typeorm/metadata/RelationIdMetadata.js +62 -0
- package/.output/server/node_modules/typeorm/metadata/RelationMetadata.js +440 -0
- package/.output/server/node_modules/typeorm/metadata/UniqueMetadata.js +101 -0
- package/.output/server/node_modules/typeorm/metadata/types/EventListenerTypes.js +22 -0
- package/.output/server/node_modules/typeorm/metadata-args/MetadataArgsStorage.js +236 -0
- package/.output/server/node_modules/typeorm/metadata-builder/ClosureJunctionEntityMetadataBuilder.js +145 -0
- package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataBuilder.js +838 -0
- package/.output/server/node_modules/typeorm/metadata-builder/EntityMetadataValidator.js +258 -0
- package/.output/server/node_modules/typeorm/metadata-builder/JunctionEntityMetadataBuilder.js +287 -0
- package/.output/server/node_modules/typeorm/metadata-builder/MetadataUtils.js +44 -0
- package/.output/server/node_modules/typeorm/metadata-builder/RelationJoinColumnBuilder.js +185 -0
- package/.output/server/node_modules/typeorm/migration/Migration.js +21 -0
- package/.output/server/node_modules/typeorm/migration/MigrationExecutor.js +534 -0
- package/.output/server/node_modules/typeorm/naming-strategy/DefaultNamingStrategy.js +145 -0
- package/.output/server/node_modules/typeorm/naming-strategy/LegacyOracleNamingStrategy.js +50 -0
- package/.output/server/node_modules/typeorm/package.json +268 -0
- package/.output/server/node_modules/typeorm/persistence/EntityPersistExecutor.js +170 -0
- package/.output/server/node_modules/typeorm/persistence/Subject.js +239 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectChangedColumnsComputer.js +216 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectDatabaseEntityLoader.js +135 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectExecutor.js +760 -0
- package/.output/server/node_modules/typeorm/persistence/SubjectTopologicalSorter.js +174 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/CascadesSubjectBuilder.js +107 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/ManyToManySubjectBuilder.js +218 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToManySubjectBuilder.js +181 -0
- package/.output/server/node_modules/typeorm/persistence/subject-builder/OneToOneInverseSideSubjectBuilder.js +155 -0
- package/.output/server/node_modules/typeorm/persistence/tree/ClosureSubjectExecutor.js +241 -0
- package/.output/server/node_modules/typeorm/persistence/tree/MaterializedPathSubjectExecutor.js +125 -0
- package/.output/server/node_modules/typeorm/persistence/tree/NestedSetSubjectExecutor.js +271 -0
- package/.output/server/node_modules/typeorm/platform/PlatformTools.js +243 -0
- package/.output/server/node_modules/typeorm/query-builder/Alias.js +29 -0
- package/.output/server/node_modules/typeorm/query-builder/Brackets.js +19 -0
- package/.output/server/node_modules/typeorm/query-builder/DeleteQueryBuilder.js +200 -0
- package/.output/server/node_modules/typeorm/query-builder/InsertQueryBuilder.js +745 -0
- package/.output/server/node_modules/typeorm/query-builder/JoinAttribute.js +175 -0
- package/.output/server/node_modules/typeorm/query-builder/NotBrackets.js +17 -0
- package/.output/server/node_modules/typeorm/query-builder/QueryBuilder.js +1139 -0
- package/.output/server/node_modules/typeorm/query-builder/QueryBuilderUtils.js +32 -0
- package/.output/server/node_modules/typeorm/query-builder/QueryExpressionMap.js +328 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationIdLoader.js +503 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationLoader.js +283 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationQueryBuilder.js +155 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationRemover.js +143 -0
- package/.output/server/node_modules/typeorm/query-builder/RelationUpdater.js +152 -0
- package/.output/server/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js +176 -0
- package/.output/server/node_modules/typeorm/query-builder/SelectQueryBuilder.js +2656 -0
- package/.output/server/node_modules/typeorm/query-builder/SoftDeleteQueryBuilder.js +368 -0
- package/.output/server/node_modules/typeorm/query-builder/UpdateQueryBuilder.js +498 -0
- package/.output/server/node_modules/typeorm/query-builder/index.js +20 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountAttribute.js +80 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountLoader.js +168 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-count/RelationCountMetadataToAttributeTransformer.js +55 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdAttribute.js +88 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdLoader.js +275 -0
- package/.output/server/node_modules/typeorm/query-builder/relation-id/RelationIdMetadataToAttributeTransformer.js +55 -0
- package/.output/server/node_modules/typeorm/query-builder/result/DeleteResult.js +17 -0
- package/.output/server/node_modules/typeorm/query-builder/result/InsertResult.js +28 -0
- package/.output/server/node_modules/typeorm/query-builder/result/UpdateResult.js +29 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/DocumentToEntityTransformer.js +196 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToDatabaseEntityTransformer.js +112 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/PlainObjectToNewEntityTransformer.js +92 -0
- package/.output/server/node_modules/typeorm/query-builder/transformer/RawSqlResultsToEntityTransformer.js +447 -0
- package/.output/server/node_modules/typeorm/query-runner/BaseQueryRunner.js +454 -0
- package/.output/server/node_modules/typeorm/query-runner/QueryLock.js +28 -0
- package/.output/server/node_modules/typeorm/query-runner/QueryResult.js +17 -0
- package/.output/server/node_modules/typeorm/repository/AbstractRepository.js +92 -0
- package/.output/server/node_modules/typeorm/repository/BaseEntity.js +328 -0
- package/.output/server/node_modules/typeorm/repository/MongoRepository.js +305 -0
- package/.output/server/node_modules/typeorm/repository/RemoveOptions.js +4 -0
- package/.output/server/node_modules/typeorm/repository/Repository.js +379 -0
- package/.output/server/node_modules/typeorm/repository/SaveOptions.js +4 -0
- package/.output/server/node_modules/typeorm/repository/TreeRepository.js +255 -0
- package/.output/server/node_modules/typeorm/schema-builder/MongoSchemaBuilder.js +66 -0
- package/.output/server/node_modules/typeorm/schema-builder/RdbmsSchemaBuilder.js +929 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableCheckOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableColumnOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableExclusionOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableForeignKeyOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableIndexOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/TableUniqueOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/options/ViewOptions.js +4 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/Table.js +296 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableCheck.js +49 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableColumn.js +117 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableExclusion.js +43 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableForeignKey.js +72 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableIndex.js +68 -0
- package/.output/server/node_modules/typeorm/schema-builder/table/TableUnique.js +50 -0
- package/.output/server/node_modules/typeorm/schema-builder/util/TableUtils.js +41 -0
- package/.output/server/node_modules/typeorm/schema-builder/util/ViewUtils.js +27 -0
- package/.output/server/node_modules/typeorm/schema-builder/view/View.js +71 -0
- package/.output/server/node_modules/typeorm/subscriber/Broadcaster.js +660 -0
- package/.output/server/node_modules/typeorm/subscriber/BroadcasterResult.js +30 -0
- package/.output/server/node_modules/typeorm/subscriber/event/QueryEvent.js +4 -0
- package/.output/server/node_modules/typeorm/util/ApplyValueTransformers.js +25 -0
- package/.output/server/node_modules/typeorm/util/DateUtils.js +229 -0
- package/.output/server/node_modules/typeorm/util/DepGraph.js +230 -0
- package/.output/server/node_modules/typeorm/util/DirectoryExportedClassesLoader.js +65 -0
- package/.output/server/node_modules/typeorm/util/ImportUtils.js +66 -0
- package/.output/server/node_modules/typeorm/util/InstanceChecker.js +104 -0
- package/.output/server/node_modules/typeorm/util/ObjectUtils.js +49 -0
- package/.output/server/node_modules/typeorm/util/OrmUtils.js +443 -0
- package/.output/server/node_modules/typeorm/util/PathUtils.js +33 -0
- package/.output/server/node_modules/typeorm/util/RandomGenerator.js +154 -0
- package/.output/server/node_modules/typeorm/util/SqlTagUtils.js +43 -0
- package/.output/server/node_modules/typeorm/util/StringUtils.js +113 -0
- package/.output/server/node_modules/typeorm/util/TreeRepositoryUtils.js +67 -0
- package/.output/server/node_modules/typeorm/util/VersionUtils.js +27 -0
- package/.output/server/node_modules/typeorm/util/escapeRegExp.js +10 -0
- package/.output/server/node_modules/ufo/dist/index.mjs +630 -0
- package/.output/server/node_modules/ufo/package.json +47 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +94 -0
- package/.output/server/node_modules/unhead/dist/server.mjs +220 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.C13swrCa.mjs +48 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +148 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.Cp0iF6eN.mjs +177 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DGkFBTYv.mjs +172 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DZbvapt-.mjs +70 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.DeCxexjU.mjs +166 -0
- package/.output/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/.output/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/.output/server/node_modules/unhead/package.json +101 -0
- package/.output/server/node_modules/uuid/dist/cjs/index.js +31 -0
- package/.output/server/node_modules/uuid/dist/cjs/max.js +3 -0
- package/.output/server/node_modules/uuid/dist/cjs/md5.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/native.js +4 -0
- package/.output/server/node_modules/uuid/dist/cjs/nil.js +3 -0
- package/.output/server/node_modules/uuid/dist/cjs/package.json +1 -0
- package/.output/server/node_modules/uuid/dist/cjs/parse.js +11 -0
- package/.output/server/node_modules/uuid/dist/cjs/regex.js +3 -0
- package/.output/server/node_modules/uuid/dist/cjs/rng.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/sha1.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/stringify.js +39 -0
- package/.output/server/node_modules/uuid/dist/cjs/v1.js +87 -0
- package/.output/server/node_modules/uuid/dist/cjs/v1ToV6.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/v3.js +14 -0
- package/.output/server/node_modules/uuid/dist/cjs/v35.js +41 -0
- package/.output/server/node_modules/uuid/dist/cjs/v4.js +29 -0
- package/.output/server/node_modules/uuid/dist/cjs/v5.js +14 -0
- package/.output/server/node_modules/uuid/dist/cjs/v6.js +19 -0
- package/.output/server/node_modules/uuid/dist/cjs/v6ToV1.js +13 -0
- package/.output/server/node_modules/uuid/dist/cjs/v7.js +69 -0
- package/.output/server/node_modules/uuid/dist/cjs/validate.js +7 -0
- package/.output/server/node_modules/uuid/dist/cjs/version.js +10 -0
- package/.output/server/node_modules/uuid/package.json +132 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/.output/server/node_modules/vue/index.js +7 -0
- package/.output/server/node_modules/vue/index.mjs +1 -0
- package/.output/server/node_modules/vue/package.json +112 -0
- package/.output/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +196 -0
- package/.output/server/node_modules/vue-bundle-renderer/package.json +50 -0
- package/.output/server/node_modules/xtend/mutable.js +17 -0
- package/.output/server/node_modules/xtend/package.json +55 -0
- package/.output/server/node_modules/zod/index.js +4 -0
- package/.output/server/node_modules/zod/package.json +135 -0
- package/.output/server/node_modules/zod/v3/ZodError.js +133 -0
- package/.output/server/node_modules/zod/v3/errors.js +9 -0
- package/.output/server/node_modules/zod/v3/external.js +6 -0
- package/.output/server/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/.output/server/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/.output/server/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/.output/server/node_modules/zod/v3/helpers/util.js +133 -0
- package/.output/server/node_modules/zod/v3/index.js +4 -0
- package/.output/server/node_modules/zod/v3/locales/en.js +109 -0
- package/.output/server/node_modules/zod/v3/package.json +6 -0
- package/.output/server/node_modules/zod/v3/types.js +3695 -0
- package/.output/server/node_modules/zod/v4/classic/checks.js +1 -0
- package/.output/server/node_modules/zod/v4/classic/coerce.js +17 -0
- package/.output/server/node_modules/zod/v4/classic/compat.js +31 -0
- package/.output/server/node_modules/zod/v4/classic/errors.js +48 -0
- package/.output/server/node_modules/zod/v4/classic/external.js +20 -0
- package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
- package/.output/server/node_modules/zod/v4/classic/index.js +4 -0
- package/.output/server/node_modules/zod/v4/classic/iso.js +30 -0
- package/.output/server/node_modules/zod/v4/classic/package.json +6 -0
- package/.output/server/node_modules/zod/v4/classic/parse.js +15 -0
- package/.output/server/node_modules/zod/v4/classic/schemas.js +1157 -0
- package/.output/server/node_modules/zod/v4/core/api.js +1082 -0
- package/.output/server/node_modules/zod/v4/core/checks.js +575 -0
- package/.output/server/node_modules/zod/v4/core/core.js +76 -0
- package/.output/server/node_modules/zod/v4/core/doc.js +35 -0
- package/.output/server/node_modules/zod/v4/core/errors.js +182 -0
- package/.output/server/node_modules/zod/v4/core/index.js +16 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
- package/.output/server/node_modules/zod/v4/core/json-schema.js +1 -0
- package/.output/server/node_modules/zod/v4/core/package.json +6 -0
- package/.output/server/node_modules/zod/v4/core/parse.js +93 -0
- package/.output/server/node_modules/zod/v4/core/regexes.js +133 -0
- package/.output/server/node_modules/zod/v4/core/registries.js +51 -0
- package/.output/server/node_modules/zod/v4/core/schemas.js +2095 -0
- package/.output/server/node_modules/zod/v4/core/to-json-schema.js +437 -0
- package/.output/server/node_modules/zod/v4/core/util.js +651 -0
- package/.output/server/node_modules/zod/v4/core/versions.js +5 -0
- package/.output/server/node_modules/zod/v4/index.js +3 -0
- package/.output/server/node_modules/zod/v4/locales/ar.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/az.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/be.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/bg.js +120 -0
- package/.output/server/node_modules/zod/v4/locales/ca.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/cs.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/da.js +115 -0
- package/.output/server/node_modules/zod/v4/locales/de.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/en.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/eo.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/es.js +132 -0
- package/.output/server/node_modules/zod/v4/locales/fa.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/fi.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/fr.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/he.js +214 -0
- package/.output/server/node_modules/zod/v4/locales/hu.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
- package/.output/server/node_modules/zod/v4/locales/id.js +106 -0
- package/.output/server/node_modules/zod/v4/locales/index.js +49 -0
- package/.output/server/node_modules/zod/v4/locales/is.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/it.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ja.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/ka.js +112 -0
- package/.output/server/node_modules/zod/v4/locales/kh.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/km.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ko.js +111 -0
- package/.output/server/node_modules/zod/v4/locales/lt.js +203 -0
- package/.output/server/node_modules/zod/v4/locales/mk.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ms.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/nl.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/no.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ota.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/package.json +6 -0
- package/.output/server/node_modules/zod/v4/locales/pl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/ps.js +114 -0
- package/.output/server/node_modules/zod/v4/locales/pt.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ru.js +156 -0
- package/.output/server/node_modules/zod/v4/locales/sl.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/sv.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/ta.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/th.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/tr.js +105 -0
- package/.output/server/node_modules/zod/v4/locales/ua.js +5 -0
- package/.output/server/node_modules/zod/v4/locales/uk.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/ur.js +110 -0
- package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/vi.js +108 -0
- package/.output/server/node_modules/zod/v4/locales/yo.js +107 -0
- package/.output/server/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/.output/server/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/.output/server/node_modules/zod/v4/package.json +6 -0
- package/.output/server/package.json +95 -0
- package/README.md +46 -0
- package/bin/cli.mjs +113 -0
- package/bin/entry.cjs +84 -0
- package/package.json +48 -0
|
@@ -0,0 +1,1139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryBuilder = void 0;
|
|
4
|
+
const QueryExpressionMap_1 = require("./QueryExpressionMap");
|
|
5
|
+
const Brackets_1 = require("./Brackets");
|
|
6
|
+
const FindOperator_1 = require("../find-options/FindOperator");
|
|
7
|
+
const In_1 = require("../find-options/operator/In");
|
|
8
|
+
const error_1 = require("../error");
|
|
9
|
+
const EntityPropertyNotFoundError_1 = require("../error/EntityPropertyNotFoundError");
|
|
10
|
+
const InstanceChecker_1 = require("../util/InstanceChecker");
|
|
11
|
+
const escapeRegExp_1 = require("../util/escapeRegExp");
|
|
12
|
+
// todo: completely cover query builder with tests
|
|
13
|
+
// todo: entityOrProperty can be target name. implement proper behaviour if it is.
|
|
14
|
+
// todo: check in persistment if id exist on object and throw exception (can be in partial selection?)
|
|
15
|
+
// todo: fix problem with long aliases eg getMaxIdentifierLength
|
|
16
|
+
// todo: fix replacing in .select("COUNT(post.id) AS cnt") statement
|
|
17
|
+
// todo: implement joinAlways in relations and relationId
|
|
18
|
+
// todo: finish partial selection
|
|
19
|
+
// todo: sugar methods like: .addCount and .selectCount, selectCountAndMap, selectSum, selectSumAndMap, ...
|
|
20
|
+
// todo: implement @Select decorator
|
|
21
|
+
// todo: add select and map functions
|
|
22
|
+
// todo: implement relation/entity loading and setting them into properties within a separate query
|
|
23
|
+
// .loadAndMap("post.categories", "post.categories", qb => ...)
|
|
24
|
+
// .loadAndMap("post.categories", Category, qb => ...)
|
|
25
|
+
/**
|
|
26
|
+
* Allows to build complex sql queries in a fashion way and execute those queries.
|
|
27
|
+
*/
|
|
28
|
+
class QueryBuilder {
|
|
29
|
+
/**
|
|
30
|
+
* QueryBuilder can be initialized from given Connection and QueryRunner objects or from given other QueryBuilder.
|
|
31
|
+
*/
|
|
32
|
+
constructor(connectionOrQueryBuilder, queryRunner) {
|
|
33
|
+
this["@instanceof"] = Symbol.for("QueryBuilder");
|
|
34
|
+
/**
|
|
35
|
+
* Memo to help keep place of current parameter index for `createParameter`
|
|
36
|
+
*/
|
|
37
|
+
this.parameterIndex = 0;
|
|
38
|
+
if (InstanceChecker_1.InstanceChecker.isDataSource(connectionOrQueryBuilder)) {
|
|
39
|
+
this.connection = connectionOrQueryBuilder;
|
|
40
|
+
this.queryRunner = queryRunner;
|
|
41
|
+
this.expressionMap = new QueryExpressionMap_1.QueryExpressionMap(this.connection);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.connection = connectionOrQueryBuilder.connection;
|
|
45
|
+
this.queryRunner = connectionOrQueryBuilder.queryRunner;
|
|
46
|
+
this.expressionMap = connectionOrQueryBuilder.expressionMap.clone();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
static registerQueryBuilderClass(name, factory) {
|
|
50
|
+
QueryBuilder.queryBuilderRegistry[name] = factory;
|
|
51
|
+
}
|
|
52
|
+
// -------------------------------------------------------------------------
|
|
53
|
+
// Accessors
|
|
54
|
+
// -------------------------------------------------------------------------
|
|
55
|
+
/**
|
|
56
|
+
* Gets the main alias string used in this query builder.
|
|
57
|
+
*/
|
|
58
|
+
get alias() {
|
|
59
|
+
if (!this.expressionMap.mainAlias)
|
|
60
|
+
throw new error_1.TypeORMError(`Main alias is not set`); // todo: better exception
|
|
61
|
+
return this.expressionMap.mainAlias.name;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Creates SELECT query and selects given data.
|
|
65
|
+
* Replaces all previous selections if they exist.
|
|
66
|
+
*/
|
|
67
|
+
select(selection, selectionAliasName) {
|
|
68
|
+
this.expressionMap.queryType = "select";
|
|
69
|
+
if (Array.isArray(selection)) {
|
|
70
|
+
this.expressionMap.selects = selection.map((selection) => ({
|
|
71
|
+
selection: selection,
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
else if (selection) {
|
|
75
|
+
this.expressionMap.selects = [
|
|
76
|
+
{ selection: selection, aliasName: selectionAliasName },
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
if (InstanceChecker_1.InstanceChecker.isSelectQueryBuilder(this))
|
|
80
|
+
return this;
|
|
81
|
+
return QueryBuilder.queryBuilderRegistry["SelectQueryBuilder"](this);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Creates INSERT query.
|
|
85
|
+
*/
|
|
86
|
+
insert() {
|
|
87
|
+
this.expressionMap.queryType = "insert";
|
|
88
|
+
if (InstanceChecker_1.InstanceChecker.isInsertQueryBuilder(this))
|
|
89
|
+
return this;
|
|
90
|
+
return QueryBuilder.queryBuilderRegistry["InsertQueryBuilder"](this);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates UPDATE query and applies given update values.
|
|
94
|
+
*/
|
|
95
|
+
update(entityOrTableNameUpdateSet, maybeUpdateSet) {
|
|
96
|
+
const updateSet = maybeUpdateSet
|
|
97
|
+
? maybeUpdateSet
|
|
98
|
+
: entityOrTableNameUpdateSet;
|
|
99
|
+
entityOrTableNameUpdateSet = InstanceChecker_1.InstanceChecker.isEntitySchema(entityOrTableNameUpdateSet)
|
|
100
|
+
? entityOrTableNameUpdateSet.options.name
|
|
101
|
+
: entityOrTableNameUpdateSet;
|
|
102
|
+
if (typeof entityOrTableNameUpdateSet === "function" ||
|
|
103
|
+
typeof entityOrTableNameUpdateSet === "string") {
|
|
104
|
+
const mainAlias = this.createFromAlias(entityOrTableNameUpdateSet);
|
|
105
|
+
this.expressionMap.setMainAlias(mainAlias);
|
|
106
|
+
}
|
|
107
|
+
this.expressionMap.queryType = "update";
|
|
108
|
+
this.expressionMap.valuesSet = updateSet;
|
|
109
|
+
if (InstanceChecker_1.InstanceChecker.isUpdateQueryBuilder(this))
|
|
110
|
+
return this;
|
|
111
|
+
return QueryBuilder.queryBuilderRegistry["UpdateQueryBuilder"](this);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Creates DELETE query.
|
|
115
|
+
*/
|
|
116
|
+
delete() {
|
|
117
|
+
this.expressionMap.queryType = "delete";
|
|
118
|
+
if (InstanceChecker_1.InstanceChecker.isDeleteQueryBuilder(this))
|
|
119
|
+
return this;
|
|
120
|
+
return QueryBuilder.queryBuilderRegistry["DeleteQueryBuilder"](this);
|
|
121
|
+
}
|
|
122
|
+
softDelete() {
|
|
123
|
+
this.expressionMap.queryType = "soft-delete";
|
|
124
|
+
if (InstanceChecker_1.InstanceChecker.isSoftDeleteQueryBuilder(this))
|
|
125
|
+
return this;
|
|
126
|
+
return QueryBuilder.queryBuilderRegistry["SoftDeleteQueryBuilder"](this);
|
|
127
|
+
}
|
|
128
|
+
restore() {
|
|
129
|
+
this.expressionMap.queryType = "restore";
|
|
130
|
+
if (InstanceChecker_1.InstanceChecker.isSoftDeleteQueryBuilder(this))
|
|
131
|
+
return this;
|
|
132
|
+
return QueryBuilder.queryBuilderRegistry["SoftDeleteQueryBuilder"](this);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Sets entity's relation with which this query builder gonna work.
|
|
136
|
+
*/
|
|
137
|
+
relation(entityTargetOrPropertyPath, maybePropertyPath) {
|
|
138
|
+
const entityTarget = arguments.length === 2 ? entityTargetOrPropertyPath : undefined;
|
|
139
|
+
const propertyPath = arguments.length === 2
|
|
140
|
+
? maybePropertyPath
|
|
141
|
+
: entityTargetOrPropertyPath;
|
|
142
|
+
this.expressionMap.queryType = "relation";
|
|
143
|
+
this.expressionMap.relationPropertyPath = propertyPath;
|
|
144
|
+
if (entityTarget) {
|
|
145
|
+
const mainAlias = this.createFromAlias(entityTarget);
|
|
146
|
+
this.expressionMap.setMainAlias(mainAlias);
|
|
147
|
+
}
|
|
148
|
+
if (InstanceChecker_1.InstanceChecker.isRelationQueryBuilder(this))
|
|
149
|
+
return this;
|
|
150
|
+
return QueryBuilder.queryBuilderRegistry["RelationQueryBuilder"](this);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Checks if given relation or relations exist in the entity.
|
|
154
|
+
* Returns true if relation exists, false otherwise.
|
|
155
|
+
*
|
|
156
|
+
* todo: move this method to manager? or create a shortcut?
|
|
157
|
+
*/
|
|
158
|
+
hasRelation(target, relation) {
|
|
159
|
+
const entityMetadata = this.connection.getMetadata(target);
|
|
160
|
+
const relations = Array.isArray(relation) ? relation : [relation];
|
|
161
|
+
return relations.every((relation) => {
|
|
162
|
+
return !!entityMetadata.findRelationWithPropertyPath(relation);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Check the existence of a parameter for this query builder.
|
|
167
|
+
*/
|
|
168
|
+
hasParameter(key) {
|
|
169
|
+
return (this.parentQueryBuilder?.hasParameter(key) ||
|
|
170
|
+
key in this.expressionMap.parameters);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Sets parameter name and its value.
|
|
174
|
+
*
|
|
175
|
+
* The key for this parameter may contain numbers, letters, underscores, or periods.
|
|
176
|
+
*/
|
|
177
|
+
setParameter(key, value) {
|
|
178
|
+
if (typeof value === "function") {
|
|
179
|
+
throw new error_1.TypeORMError(`Function parameter isn't supported in the parameters. Please check "${key}" parameter.`);
|
|
180
|
+
}
|
|
181
|
+
if (!key.match(/^([A-Za-z0-9_.]+)$/)) {
|
|
182
|
+
throw new error_1.TypeORMError("QueryBuilder parameter keys may only contain numbers, letters, underscores, or periods.");
|
|
183
|
+
}
|
|
184
|
+
if (this.parentQueryBuilder) {
|
|
185
|
+
this.parentQueryBuilder.setParameter(key, value);
|
|
186
|
+
}
|
|
187
|
+
this.expressionMap.parameters[key] = value;
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Adds all parameters from the given object.
|
|
192
|
+
*/
|
|
193
|
+
setParameters(parameters) {
|
|
194
|
+
for (const [key, value] of Object.entries(parameters)) {
|
|
195
|
+
this.setParameter(key, value);
|
|
196
|
+
}
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
createParameter(value) {
|
|
200
|
+
let parameterName;
|
|
201
|
+
do {
|
|
202
|
+
parameterName = `orm_param_${this.parameterIndex++}`;
|
|
203
|
+
} while (this.hasParameter(parameterName));
|
|
204
|
+
this.setParameter(parameterName, value);
|
|
205
|
+
return `:${parameterName}`;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Adds native parameters from the given object.
|
|
209
|
+
*
|
|
210
|
+
* @deprecated Use `setParameters` instead
|
|
211
|
+
*/
|
|
212
|
+
setNativeParameters(parameters) {
|
|
213
|
+
// set parent query builder parameters as well in sub-query mode
|
|
214
|
+
if (this.parentQueryBuilder) {
|
|
215
|
+
this.parentQueryBuilder.setNativeParameters(parameters);
|
|
216
|
+
}
|
|
217
|
+
Object.keys(parameters).forEach((key) => {
|
|
218
|
+
this.expressionMap.nativeParameters[key] = parameters[key];
|
|
219
|
+
});
|
|
220
|
+
return this;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Gets all parameters.
|
|
224
|
+
*/
|
|
225
|
+
getParameters() {
|
|
226
|
+
const parameters = Object.assign({}, this.expressionMap.parameters);
|
|
227
|
+
// add discriminator column parameter if it exist
|
|
228
|
+
if (this.expressionMap.mainAlias &&
|
|
229
|
+
this.expressionMap.mainAlias.hasMetadata) {
|
|
230
|
+
const metadata = this.expressionMap.mainAlias.metadata;
|
|
231
|
+
if (metadata.discriminatorColumn && metadata.parentEntityMetadata) {
|
|
232
|
+
const values = metadata.childEntityMetadatas
|
|
233
|
+
.filter((childMetadata) => childMetadata.discriminatorColumn)
|
|
234
|
+
.map((childMetadata) => childMetadata.discriminatorValue);
|
|
235
|
+
values.push(metadata.discriminatorValue);
|
|
236
|
+
parameters["discriminatorColumnValues"] = values;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return parameters;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Prints sql to stdout using console.log.
|
|
243
|
+
*/
|
|
244
|
+
printSql() {
|
|
245
|
+
// TODO rename to logSql()
|
|
246
|
+
const [query, parameters] = this.getQueryAndParameters();
|
|
247
|
+
this.connection.logger.logQuery(query, parameters);
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Gets generated sql that will be executed.
|
|
252
|
+
* Parameters in the query are escaped for the currently used driver.
|
|
253
|
+
*/
|
|
254
|
+
getSql() {
|
|
255
|
+
return this.getQueryAndParameters()[0];
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Gets query to be executed with all parameters used in it.
|
|
259
|
+
*/
|
|
260
|
+
getQueryAndParameters() {
|
|
261
|
+
// this execution order is important because getQuery method generates this.expressionMap.nativeParameters values
|
|
262
|
+
const query = this.getQuery();
|
|
263
|
+
const parameters = this.getParameters();
|
|
264
|
+
return this.connection.driver.escapeQueryWithParameters(query, parameters, this.expressionMap.nativeParameters);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Executes sql generated by query builder and returns raw database results.
|
|
268
|
+
*/
|
|
269
|
+
async execute() {
|
|
270
|
+
const [sql, parameters] = this.getQueryAndParameters();
|
|
271
|
+
const queryRunner = this.obtainQueryRunner();
|
|
272
|
+
try {
|
|
273
|
+
return await queryRunner.query(sql, parameters); // await is needed here because we are using finally
|
|
274
|
+
}
|
|
275
|
+
finally {
|
|
276
|
+
if (queryRunner !== this.queryRunner) {
|
|
277
|
+
// means we created our own query runner
|
|
278
|
+
await queryRunner.release();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Creates a completely new query builder.
|
|
284
|
+
* Uses same query runner as current QueryBuilder.
|
|
285
|
+
*/
|
|
286
|
+
createQueryBuilder(queryRunner) {
|
|
287
|
+
return new this.constructor(this.connection, queryRunner ?? this.queryRunner);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Clones query builder as it is.
|
|
291
|
+
* Note: it uses new query runner, if you want query builder that uses exactly same query runner,
|
|
292
|
+
* you can create query builder using its constructor, for example new SelectQueryBuilder(queryBuilder)
|
|
293
|
+
* where queryBuilder is cloned QueryBuilder.
|
|
294
|
+
*/
|
|
295
|
+
clone() {
|
|
296
|
+
return new this.constructor(this);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Includes a Query comment in the query builder. This is helpful for debugging purposes,
|
|
300
|
+
* such as finding a specific query in the database server's logs, or for categorization using
|
|
301
|
+
* an APM product.
|
|
302
|
+
*/
|
|
303
|
+
comment(comment) {
|
|
304
|
+
this.expressionMap.comment = comment;
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Disables escaping.
|
|
309
|
+
*/
|
|
310
|
+
disableEscaping() {
|
|
311
|
+
this.expressionMap.disableEscaping = false;
|
|
312
|
+
return this;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Escapes table name, column name or alias name using current database's escaping character.
|
|
316
|
+
*/
|
|
317
|
+
escape(name) {
|
|
318
|
+
if (!this.expressionMap.disableEscaping)
|
|
319
|
+
return name;
|
|
320
|
+
return this.connection.driver.escape(name);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Sets or overrides query builder's QueryRunner.
|
|
324
|
+
*/
|
|
325
|
+
setQueryRunner(queryRunner) {
|
|
326
|
+
this.queryRunner = queryRunner;
|
|
327
|
+
return this;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Indicates if listeners and subscribers must be called before and after query execution.
|
|
331
|
+
* Enabled by default.
|
|
332
|
+
*/
|
|
333
|
+
callListeners(enabled) {
|
|
334
|
+
this.expressionMap.callListeners = enabled;
|
|
335
|
+
return this;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* If set to true the query will be wrapped into a transaction.
|
|
339
|
+
*/
|
|
340
|
+
useTransaction(enabled) {
|
|
341
|
+
this.expressionMap.useTransaction = enabled;
|
|
342
|
+
return this;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Adds CTE to query
|
|
346
|
+
*/
|
|
347
|
+
addCommonTableExpression(queryBuilder, alias, options) {
|
|
348
|
+
this.expressionMap.commonTableExpressions.push({
|
|
349
|
+
queryBuilder,
|
|
350
|
+
alias,
|
|
351
|
+
options: options || {},
|
|
352
|
+
});
|
|
353
|
+
return this;
|
|
354
|
+
}
|
|
355
|
+
// -------------------------------------------------------------------------
|
|
356
|
+
// Protected Methods
|
|
357
|
+
// -------------------------------------------------------------------------
|
|
358
|
+
/**
|
|
359
|
+
* Gets escaped table name with schema name if SqlServer driver used with custom
|
|
360
|
+
* schema name, otherwise returns escaped table name.
|
|
361
|
+
*/
|
|
362
|
+
getTableName(tablePath) {
|
|
363
|
+
return tablePath
|
|
364
|
+
.split(".")
|
|
365
|
+
.map((i) => {
|
|
366
|
+
// this condition need because in SQL Server driver when custom database name was specified and schema name was not, we got `dbName..tableName` string, and doesn't need to escape middle empty string
|
|
367
|
+
if (i === "")
|
|
368
|
+
return i;
|
|
369
|
+
return this.escape(i);
|
|
370
|
+
})
|
|
371
|
+
.join(".");
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Gets name of the table where insert should be performed.
|
|
375
|
+
*/
|
|
376
|
+
getMainTableName() {
|
|
377
|
+
if (!this.expressionMap.mainAlias)
|
|
378
|
+
throw new error_1.TypeORMError(`Entity where values should be inserted is not specified. Call "qb.into(entity)" method to specify it.`);
|
|
379
|
+
if (this.expressionMap.mainAlias.hasMetadata)
|
|
380
|
+
return this.expressionMap.mainAlias.metadata.tablePath;
|
|
381
|
+
return this.expressionMap.mainAlias.tablePath;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Specifies FROM which entity's table select/update/delete will be executed.
|
|
385
|
+
* Also sets a main string alias of the selection data.
|
|
386
|
+
*/
|
|
387
|
+
createFromAlias(entityTarget, aliasName) {
|
|
388
|
+
// if table has a metadata then find it to properly escape its properties
|
|
389
|
+
// const metadata = this.connection.entityMetadatas.find(metadata => metadata.tableName === tableName);
|
|
390
|
+
if (this.connection.hasMetadata(entityTarget)) {
|
|
391
|
+
const metadata = this.connection.getMetadata(entityTarget);
|
|
392
|
+
return this.expressionMap.createAlias({
|
|
393
|
+
type: "from",
|
|
394
|
+
name: aliasName,
|
|
395
|
+
metadata: this.connection.getMetadata(entityTarget),
|
|
396
|
+
tablePath: metadata.tablePath,
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
if (typeof entityTarget === "string") {
|
|
401
|
+
const isSubquery = entityTarget.substr(0, 1) === "(" &&
|
|
402
|
+
entityTarget.substr(-1) === ")";
|
|
403
|
+
return this.expressionMap.createAlias({
|
|
404
|
+
type: "from",
|
|
405
|
+
name: aliasName,
|
|
406
|
+
tablePath: !isSubquery
|
|
407
|
+
? entityTarget
|
|
408
|
+
: undefined,
|
|
409
|
+
subQuery: isSubquery ? entityTarget : undefined,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
const subQueryBuilder = entityTarget(this.subQuery());
|
|
413
|
+
this.setParameters(subQueryBuilder.getParameters());
|
|
414
|
+
const subquery = subQueryBuilder.getQuery();
|
|
415
|
+
return this.expressionMap.createAlias({
|
|
416
|
+
type: "from",
|
|
417
|
+
name: aliasName,
|
|
418
|
+
subQuery: subquery,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* @deprecated this way of replace property names is too slow.
|
|
424
|
+
* Instead, we'll replace property names at the end - once query is build.
|
|
425
|
+
*/
|
|
426
|
+
replacePropertyNames(statement) {
|
|
427
|
+
return statement;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Replaces all entity's propertyName to name in the given SQL string.
|
|
431
|
+
*/
|
|
432
|
+
replacePropertyNamesForTheWholeQuery(statement) {
|
|
433
|
+
const replacements = {};
|
|
434
|
+
for (const alias of this.expressionMap.aliases) {
|
|
435
|
+
if (!alias.hasMetadata)
|
|
436
|
+
continue;
|
|
437
|
+
const replaceAliasNamePrefix = this.expressionMap.aliasNamePrefixingEnabled && alias.name
|
|
438
|
+
? `${alias.name}.`
|
|
439
|
+
: "";
|
|
440
|
+
if (!replacements[replaceAliasNamePrefix]) {
|
|
441
|
+
replacements[replaceAliasNamePrefix] = {};
|
|
442
|
+
}
|
|
443
|
+
// Insert & overwrite the replacements from least to most relevant in our replacements object.
|
|
444
|
+
// To do this we iterate and overwrite in the order of relevance.
|
|
445
|
+
// Least to Most Relevant:
|
|
446
|
+
// * Relation Property Path to first join column key
|
|
447
|
+
// * Relation Property Path + Column Path
|
|
448
|
+
// * Column Database Name
|
|
449
|
+
// * Column Property Name
|
|
450
|
+
// * Column Property Path
|
|
451
|
+
for (const relation of alias.metadata.relations) {
|
|
452
|
+
if (relation.joinColumns.length > 0)
|
|
453
|
+
replacements[replaceAliasNamePrefix][relation.propertyPath] = relation.joinColumns[0].databaseName;
|
|
454
|
+
}
|
|
455
|
+
for (const relation of alias.metadata.relations) {
|
|
456
|
+
const allColumns = [
|
|
457
|
+
...relation.joinColumns,
|
|
458
|
+
...relation.inverseJoinColumns,
|
|
459
|
+
];
|
|
460
|
+
for (const joinColumn of allColumns) {
|
|
461
|
+
const propertyKey = `${relation.propertyPath}.${joinColumn.referencedColumn.propertyPath}`;
|
|
462
|
+
replacements[replaceAliasNamePrefix][propertyKey] =
|
|
463
|
+
joinColumn.databaseName;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
for (const column of alias.metadata.columns) {
|
|
467
|
+
replacements[replaceAliasNamePrefix][column.databaseName] =
|
|
468
|
+
column.databaseName;
|
|
469
|
+
}
|
|
470
|
+
for (const column of alias.metadata.columns) {
|
|
471
|
+
replacements[replaceAliasNamePrefix][column.propertyName] =
|
|
472
|
+
column.databaseName;
|
|
473
|
+
}
|
|
474
|
+
for (const column of alias.metadata.columns) {
|
|
475
|
+
replacements[replaceAliasNamePrefix][column.propertyPath] =
|
|
476
|
+
column.databaseName;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
const replacementKeys = Object.keys(replacements);
|
|
480
|
+
const replaceAliasNamePrefixes = replacementKeys
|
|
481
|
+
.map((key) => (0, escapeRegExp_1.escapeRegExp)(key))
|
|
482
|
+
.join("|");
|
|
483
|
+
if (replacementKeys.length > 0) {
|
|
484
|
+
statement = statement.replace(new RegExp(
|
|
485
|
+
// Avoid a lookbehind here since it's not well supported
|
|
486
|
+
`([ =(]|^.{0})` + // any of ' =(' or start of line
|
|
487
|
+
// followed by our prefix, e.g. 'tablename.' or ''
|
|
488
|
+
`${replaceAliasNamePrefixes
|
|
489
|
+
? "(" + replaceAliasNamePrefixes + ")"
|
|
490
|
+
: ""}([^ =(),]+)` + // a possible property name: sequence of anything but ' =(),'
|
|
491
|
+
// terminated by ' =),' or end of line
|
|
492
|
+
`(?=[ =),]|.{0}$)`, "gm"), (...matches) => {
|
|
493
|
+
let match, pre, p;
|
|
494
|
+
if (replaceAliasNamePrefixes) {
|
|
495
|
+
match = matches[0];
|
|
496
|
+
pre = matches[1];
|
|
497
|
+
p = matches[3];
|
|
498
|
+
if (replacements[matches[2]][p]) {
|
|
499
|
+
return `${pre}${this.escape(matches[2].substring(0, matches[2].length - 1))}.${this.escape(replacements[matches[2]][p])}`;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
match = matches[0];
|
|
504
|
+
pre = matches[1];
|
|
505
|
+
p = matches[2];
|
|
506
|
+
if (replacements[""][p]) {
|
|
507
|
+
return `${pre}${this.escape(replacements[""][p])}`;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return match;
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
return statement;
|
|
514
|
+
}
|
|
515
|
+
createComment() {
|
|
516
|
+
if (!this.expressionMap.comment) {
|
|
517
|
+
return "";
|
|
518
|
+
}
|
|
519
|
+
// ANSI SQL 2003 support C style comments - comments that start with `/*` and end with `*/`
|
|
520
|
+
// In some dialects query nesting is available - but not all. Because of this, we'll need
|
|
521
|
+
// to scrub "ending" characters from the SQL but otherwise we can leave everything else
|
|
522
|
+
// as-is and it should be valid.
|
|
523
|
+
return `/* ${this.expressionMap.comment.replace(/\*\//g, "")} */ `;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Time travel queries for CockroachDB
|
|
527
|
+
*/
|
|
528
|
+
createTimeTravelQuery() {
|
|
529
|
+
if (this.expressionMap.queryType === "select" &&
|
|
530
|
+
this.expressionMap.timeTravel) {
|
|
531
|
+
return ` AS OF SYSTEM TIME ${this.expressionMap.timeTravel}`;
|
|
532
|
+
}
|
|
533
|
+
return "";
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Creates "WHERE" expression.
|
|
537
|
+
*/
|
|
538
|
+
createWhereExpression() {
|
|
539
|
+
const conditionsArray = [];
|
|
540
|
+
const whereExpression = this.createWhereClausesExpression(this.expressionMap.wheres);
|
|
541
|
+
if (whereExpression.length > 0 && whereExpression !== "1=1") {
|
|
542
|
+
conditionsArray.push(this.replacePropertyNames(whereExpression));
|
|
543
|
+
}
|
|
544
|
+
if (this.expressionMap.mainAlias.hasMetadata) {
|
|
545
|
+
const metadata = this.expressionMap.mainAlias.metadata;
|
|
546
|
+
// Adds the global condition of "non-deleted" for the entity with delete date columns in select query.
|
|
547
|
+
if (this.expressionMap.queryType === "select" &&
|
|
548
|
+
!this.expressionMap.withDeleted &&
|
|
549
|
+
metadata.deleteDateColumn) {
|
|
550
|
+
const column = this.expressionMap.aliasNamePrefixingEnabled
|
|
551
|
+
? this.expressionMap.mainAlias.name +
|
|
552
|
+
"." +
|
|
553
|
+
metadata.deleteDateColumn.propertyName
|
|
554
|
+
: metadata.deleteDateColumn.propertyName;
|
|
555
|
+
const condition = `${this.replacePropertyNames(column)} IS NULL`;
|
|
556
|
+
conditionsArray.push(condition);
|
|
557
|
+
}
|
|
558
|
+
if (metadata.discriminatorColumn && metadata.parentEntityMetadata) {
|
|
559
|
+
const column = this.expressionMap.aliasNamePrefixingEnabled
|
|
560
|
+
? this.expressionMap.mainAlias.name +
|
|
561
|
+
"." +
|
|
562
|
+
metadata.discriminatorColumn.databaseName
|
|
563
|
+
: metadata.discriminatorColumn.databaseName;
|
|
564
|
+
const condition = `${this.replacePropertyNames(column)} IN (:...discriminatorColumnValues)`;
|
|
565
|
+
conditionsArray.push(condition);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
if (this.expressionMap.extraAppendedAndWhereCondition) {
|
|
569
|
+
const condition = this.replacePropertyNames(this.expressionMap.extraAppendedAndWhereCondition);
|
|
570
|
+
conditionsArray.push(condition);
|
|
571
|
+
}
|
|
572
|
+
let condition = "";
|
|
573
|
+
// time travel
|
|
574
|
+
condition += this.createTimeTravelQuery();
|
|
575
|
+
if (!conditionsArray.length) {
|
|
576
|
+
condition += "";
|
|
577
|
+
}
|
|
578
|
+
else if (conditionsArray.length === 1) {
|
|
579
|
+
condition += ` WHERE ${conditionsArray[0]}`;
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
condition += ` WHERE ( ${conditionsArray.join(" ) AND ( ")} )`;
|
|
583
|
+
}
|
|
584
|
+
return condition;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Creates "RETURNING" / "OUTPUT" expression.
|
|
588
|
+
*/
|
|
589
|
+
createReturningExpression(returningType) {
|
|
590
|
+
const columns = this.getReturningColumns();
|
|
591
|
+
const driver = this.connection.driver;
|
|
592
|
+
// also add columns we must auto-return to perform entity updation
|
|
593
|
+
// if user gave his own returning
|
|
594
|
+
if (typeof this.expressionMap.returning !== "string" &&
|
|
595
|
+
this.expressionMap.extraReturningColumns.length > 0 &&
|
|
596
|
+
driver.isReturningSqlSupported(returningType)) {
|
|
597
|
+
columns.push(...this.expressionMap.extraReturningColumns.filter((column) => {
|
|
598
|
+
return columns.indexOf(column) === -1;
|
|
599
|
+
}));
|
|
600
|
+
}
|
|
601
|
+
if (columns.length) {
|
|
602
|
+
let columnsExpression = columns
|
|
603
|
+
.map((column) => {
|
|
604
|
+
const name = this.escape(column.databaseName);
|
|
605
|
+
if (driver.options.type === "mssql") {
|
|
606
|
+
if (this.expressionMap.queryType === "insert" ||
|
|
607
|
+
this.expressionMap.queryType === "update" ||
|
|
608
|
+
this.expressionMap.queryType === "soft-delete" ||
|
|
609
|
+
this.expressionMap.queryType === "restore") {
|
|
610
|
+
return "INSERTED." + name;
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
return (this.escape(this.getMainTableName()) +
|
|
614
|
+
"." +
|
|
615
|
+
name);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
return name;
|
|
620
|
+
}
|
|
621
|
+
})
|
|
622
|
+
.join(", ");
|
|
623
|
+
if (driver.options.type === "oracle") {
|
|
624
|
+
columnsExpression +=
|
|
625
|
+
" INTO " +
|
|
626
|
+
columns
|
|
627
|
+
.map((column) => {
|
|
628
|
+
return this.createParameter({
|
|
629
|
+
type: driver.columnTypeToNativeParameter(column.type),
|
|
630
|
+
dir: driver.oracle.BIND_OUT,
|
|
631
|
+
});
|
|
632
|
+
})
|
|
633
|
+
.join(", ");
|
|
634
|
+
}
|
|
635
|
+
if (driver.options.type === "mssql") {
|
|
636
|
+
if (this.expressionMap.queryType === "insert" ||
|
|
637
|
+
this.expressionMap.queryType === "update") {
|
|
638
|
+
columnsExpression += " INTO @OutputTable";
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return columnsExpression;
|
|
642
|
+
}
|
|
643
|
+
else if (typeof this.expressionMap.returning === "string") {
|
|
644
|
+
return this.expressionMap.returning;
|
|
645
|
+
}
|
|
646
|
+
return "";
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* If returning / output cause is set to array of column names,
|
|
650
|
+
* then this method will return all column metadatas of those column names.
|
|
651
|
+
*/
|
|
652
|
+
getReturningColumns() {
|
|
653
|
+
const columns = [];
|
|
654
|
+
if (Array.isArray(this.expressionMap.returning)) {
|
|
655
|
+
;
|
|
656
|
+
this.expressionMap.returning.forEach((columnName) => {
|
|
657
|
+
if (this.expressionMap.mainAlias.hasMetadata) {
|
|
658
|
+
columns.push(...this.expressionMap.mainAlias.metadata.findColumnsWithPropertyPath(columnName));
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
return columns;
|
|
663
|
+
}
|
|
664
|
+
createWhereClausesExpression(clauses) {
|
|
665
|
+
return clauses
|
|
666
|
+
.map((clause, index) => {
|
|
667
|
+
const expression = this.createWhereConditionExpression(clause.condition);
|
|
668
|
+
switch (clause.type) {
|
|
669
|
+
case "and":
|
|
670
|
+
return ((index > 0 ? "AND " : "") +
|
|
671
|
+
`${this.connection.options.isolateWhereStatements
|
|
672
|
+
? "("
|
|
673
|
+
: ""}${expression}${this.connection.options.isolateWhereStatements
|
|
674
|
+
? ")"
|
|
675
|
+
: ""}`);
|
|
676
|
+
case "or":
|
|
677
|
+
return ((index > 0 ? "OR " : "") +
|
|
678
|
+
`${this.connection.options.isolateWhereStatements
|
|
679
|
+
? "("
|
|
680
|
+
: ""}${expression}${this.connection.options.isolateWhereStatements
|
|
681
|
+
? ")"
|
|
682
|
+
: ""}`);
|
|
683
|
+
}
|
|
684
|
+
return expression;
|
|
685
|
+
})
|
|
686
|
+
.join(" ")
|
|
687
|
+
.trim();
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Computes given where argument - transforms to a where string all forms it can take.
|
|
691
|
+
*/
|
|
692
|
+
createWhereConditionExpression(condition, alwaysWrap = false) {
|
|
693
|
+
if (typeof condition === "string")
|
|
694
|
+
return condition;
|
|
695
|
+
if (Array.isArray(condition)) {
|
|
696
|
+
if (condition.length === 0) {
|
|
697
|
+
return "1=1";
|
|
698
|
+
}
|
|
699
|
+
// In the future we should probably remove this entire condition
|
|
700
|
+
// but for now to prevent any breaking changes it exists.
|
|
701
|
+
if (condition.length === 1 && !alwaysWrap) {
|
|
702
|
+
return this.createWhereClausesExpression(condition);
|
|
703
|
+
}
|
|
704
|
+
return "(" + this.createWhereClausesExpression(condition) + ")";
|
|
705
|
+
}
|
|
706
|
+
const { driver } = this.connection;
|
|
707
|
+
switch (condition.operator) {
|
|
708
|
+
case "lessThan":
|
|
709
|
+
return `${condition.parameters[0]} < ${condition.parameters[1]}`;
|
|
710
|
+
case "lessThanOrEqual":
|
|
711
|
+
return `${condition.parameters[0]} <= ${condition.parameters[1]}`;
|
|
712
|
+
case "arrayContains":
|
|
713
|
+
return `${condition.parameters[0]} @> ${condition.parameters[1]}`;
|
|
714
|
+
case "jsonContains":
|
|
715
|
+
return `${condition.parameters[0]} ::jsonb @> ${condition.parameters[1]}`;
|
|
716
|
+
case "arrayContainedBy":
|
|
717
|
+
return `${condition.parameters[0]} <@ ${condition.parameters[1]}`;
|
|
718
|
+
case "arrayOverlap":
|
|
719
|
+
return `${condition.parameters[0]} && ${condition.parameters[1]}`;
|
|
720
|
+
case "moreThan":
|
|
721
|
+
return `${condition.parameters[0]} > ${condition.parameters[1]}`;
|
|
722
|
+
case "moreThanOrEqual":
|
|
723
|
+
return `${condition.parameters[0]} >= ${condition.parameters[1]}`;
|
|
724
|
+
case "notEqual":
|
|
725
|
+
return `${condition.parameters[0]} != ${condition.parameters[1]}`;
|
|
726
|
+
case "equal":
|
|
727
|
+
return `${condition.parameters[0]} = ${condition.parameters[1]}`;
|
|
728
|
+
case "ilike":
|
|
729
|
+
if (driver.options.type === "postgres" ||
|
|
730
|
+
driver.options.type === "cockroachdb") {
|
|
731
|
+
return `${condition.parameters[0]} ILIKE ${condition.parameters[1]}`;
|
|
732
|
+
}
|
|
733
|
+
return `UPPER(${condition.parameters[0]}) LIKE UPPER(${condition.parameters[1]})`;
|
|
734
|
+
case "like":
|
|
735
|
+
return `${condition.parameters[0]} LIKE ${condition.parameters[1]}`;
|
|
736
|
+
case "between":
|
|
737
|
+
return `${condition.parameters[0]} BETWEEN ${condition.parameters[1]} AND ${condition.parameters[2]}`;
|
|
738
|
+
case "in":
|
|
739
|
+
if (condition.parameters.length <= 1) {
|
|
740
|
+
return "0=1";
|
|
741
|
+
}
|
|
742
|
+
return `${condition.parameters[0]} IN (${condition.parameters
|
|
743
|
+
.slice(1)
|
|
744
|
+
.join(", ")})`;
|
|
745
|
+
case "any":
|
|
746
|
+
if (driver.options.type === "cockroachdb") {
|
|
747
|
+
return `${condition.parameters[0]}::STRING = ANY(${condition.parameters[1]}::STRING[])`;
|
|
748
|
+
}
|
|
749
|
+
return `${condition.parameters[0]} = ANY(${condition.parameters[1]})`;
|
|
750
|
+
case "isNull":
|
|
751
|
+
return `${condition.parameters[0]} IS NULL`;
|
|
752
|
+
case "not":
|
|
753
|
+
return `NOT(${this.createWhereConditionExpression(condition.condition)})`;
|
|
754
|
+
case "brackets":
|
|
755
|
+
return `${this.createWhereConditionExpression(condition.condition, true)}`;
|
|
756
|
+
case "and":
|
|
757
|
+
return "(" + condition.parameters.join(" AND ") + ")";
|
|
758
|
+
case "or":
|
|
759
|
+
return "(" + condition.parameters.join(" OR ") + ")";
|
|
760
|
+
}
|
|
761
|
+
throw new TypeError(`Unsupported FindOperator ${FindOperator_1.FindOperator.constructor.name}`);
|
|
762
|
+
}
|
|
763
|
+
createCteExpression() {
|
|
764
|
+
if (!this.hasCommonTableExpressions()) {
|
|
765
|
+
return "";
|
|
766
|
+
}
|
|
767
|
+
const databaseRequireRecusiveHint = this.connection.driver.cteCapabilities.requiresRecursiveHint;
|
|
768
|
+
const cteStrings = this.expressionMap.commonTableExpressions.map((cte) => {
|
|
769
|
+
let cteBodyExpression = typeof cte.queryBuilder === "string" ? cte.queryBuilder : "";
|
|
770
|
+
if (typeof cte.queryBuilder !== "string") {
|
|
771
|
+
if (cte.queryBuilder.hasCommonTableExpressions()) {
|
|
772
|
+
throw new error_1.TypeORMError(`Nested CTEs aren't supported (CTE: ${cte.alias})`);
|
|
773
|
+
}
|
|
774
|
+
cteBodyExpression = cte.queryBuilder.getQuery();
|
|
775
|
+
if (!this.connection.driver.cteCapabilities.writable &&
|
|
776
|
+
!InstanceChecker_1.InstanceChecker.isSelectQueryBuilder(cte.queryBuilder)) {
|
|
777
|
+
throw new error_1.TypeORMError(`Only select queries are supported in CTEs in ${this.connection.options.type} (CTE: ${cte.alias})`);
|
|
778
|
+
}
|
|
779
|
+
this.setParameters(cte.queryBuilder.getParameters());
|
|
780
|
+
}
|
|
781
|
+
let cteHeader = this.escape(cte.alias);
|
|
782
|
+
if (cte.options.columnNames) {
|
|
783
|
+
const escapedColumnNames = cte.options.columnNames.map((column) => this.escape(column));
|
|
784
|
+
if (InstanceChecker_1.InstanceChecker.isSelectQueryBuilder(cte.queryBuilder)) {
|
|
785
|
+
if (cte.queryBuilder.expressionMap.selects.length &&
|
|
786
|
+
cte.options.columnNames.length !==
|
|
787
|
+
cte.queryBuilder.expressionMap.selects.length) {
|
|
788
|
+
throw new error_1.TypeORMError(`cte.options.columnNames length (${cte.options.columnNames.length}) doesn't match subquery select list length ${cte.queryBuilder.expressionMap.selects.length} (CTE: ${cte.alias})`);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
cteHeader += `(${escapedColumnNames.join(", ")})`;
|
|
792
|
+
}
|
|
793
|
+
const recursiveClause = cte.options.recursive && databaseRequireRecusiveHint
|
|
794
|
+
? "RECURSIVE"
|
|
795
|
+
: "";
|
|
796
|
+
let materializeClause = "";
|
|
797
|
+
if (this.connection.driver.cteCapabilities.materializedHint &&
|
|
798
|
+
cte.options.materialized !== undefined) {
|
|
799
|
+
materializeClause = cte.options.materialized
|
|
800
|
+
? "MATERIALIZED"
|
|
801
|
+
: "NOT MATERIALIZED";
|
|
802
|
+
}
|
|
803
|
+
return [
|
|
804
|
+
recursiveClause,
|
|
805
|
+
cteHeader,
|
|
806
|
+
"AS",
|
|
807
|
+
materializeClause,
|
|
808
|
+
`(${cteBodyExpression})`,
|
|
809
|
+
]
|
|
810
|
+
.filter(Boolean)
|
|
811
|
+
.join(" ");
|
|
812
|
+
});
|
|
813
|
+
return "WITH " + cteStrings.join(", ") + " ";
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Creates "WHERE" condition for an in-ids condition.
|
|
817
|
+
*/
|
|
818
|
+
getWhereInIdsCondition(ids) {
|
|
819
|
+
const metadata = this.expressionMap.mainAlias.metadata;
|
|
820
|
+
const normalized = (Array.isArray(ids) ? ids : [ids]).map((id) => metadata.ensureEntityIdMap(id));
|
|
821
|
+
// using in(...ids) for single primary key entities
|
|
822
|
+
if (!metadata.hasMultiplePrimaryKeys) {
|
|
823
|
+
const primaryColumn = metadata.primaryColumns[0];
|
|
824
|
+
// getEntityValue will try to transform `In`, it is a bug
|
|
825
|
+
// todo: remove this transformer check after #2390 is fixed
|
|
826
|
+
// This also fails for embedded & relation, so until that is fixed skip it.
|
|
827
|
+
if (!primaryColumn.transformer &&
|
|
828
|
+
!primaryColumn.relationMetadata &&
|
|
829
|
+
!primaryColumn.embeddedMetadata) {
|
|
830
|
+
return {
|
|
831
|
+
[primaryColumn.propertyName]: (0, In_1.In)(normalized.map((id) => primaryColumn.getEntityValue(id, false))),
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return new Brackets_1.Brackets((qb) => {
|
|
836
|
+
for (const data of normalized) {
|
|
837
|
+
qb.orWhere(new Brackets_1.Brackets((qb) => qb.where(data)));
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
}
|
|
841
|
+
getExistsCondition(subQuery) {
|
|
842
|
+
const query = subQuery
|
|
843
|
+
.clone()
|
|
844
|
+
.orderBy()
|
|
845
|
+
.groupBy()
|
|
846
|
+
.offset(undefined)
|
|
847
|
+
.limit(undefined)
|
|
848
|
+
.skip(undefined)
|
|
849
|
+
.take(undefined)
|
|
850
|
+
.select("1")
|
|
851
|
+
.setOption("disable-global-order");
|
|
852
|
+
return [`EXISTS (${query.getQuery()})`, query.getParameters()];
|
|
853
|
+
}
|
|
854
|
+
findColumnsForPropertyPath(propertyPath) {
|
|
855
|
+
// Make a helper to iterate the entity & relations?
|
|
856
|
+
// Use that to set the correct alias? Or the other way around?
|
|
857
|
+
// Start with the main alias with our property paths
|
|
858
|
+
let alias = this.expressionMap.mainAlias;
|
|
859
|
+
const root = [];
|
|
860
|
+
const propertyPathParts = propertyPath.split(".");
|
|
861
|
+
while (propertyPathParts.length > 1) {
|
|
862
|
+
const part = propertyPathParts[0];
|
|
863
|
+
if (!alias?.hasMetadata) {
|
|
864
|
+
// If there's no metadata, we're wasting our time
|
|
865
|
+
// and can't actually look any of this up.
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
if (alias.metadata.hasEmbeddedWithPropertyPath(part)) {
|
|
869
|
+
// If this is an embedded then we should combine the two as part of our lookup.
|
|
870
|
+
// Instead of just breaking, we keep going with this in case there's an embedded/relation
|
|
871
|
+
// inside an embedded.
|
|
872
|
+
propertyPathParts.unshift(`${propertyPathParts.shift()}.${propertyPathParts.shift()}`);
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
if (alias.metadata.hasRelationWithPropertyPath(part)) {
|
|
876
|
+
// If this is a relation then we should find the aliases
|
|
877
|
+
// that match the relation & then continue further down
|
|
878
|
+
// the property path
|
|
879
|
+
const joinAttr = this.expressionMap.joinAttributes.find((joinAttr) => joinAttr.relationPropertyPath === part);
|
|
880
|
+
if (!joinAttr?.alias) {
|
|
881
|
+
const fullRelationPath = root.length > 0 ? `${root.join(".")}.${part}` : part;
|
|
882
|
+
throw new Error(`Cannot find alias for relation at ${fullRelationPath}`);
|
|
883
|
+
}
|
|
884
|
+
alias = joinAttr.alias;
|
|
885
|
+
root.push(...part.split("."));
|
|
886
|
+
propertyPathParts.shift();
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
break;
|
|
890
|
+
}
|
|
891
|
+
if (!alias) {
|
|
892
|
+
throw new Error(`Cannot find alias for property ${propertyPath}`);
|
|
893
|
+
}
|
|
894
|
+
// Remaining parts are combined back and used to find the actual property path
|
|
895
|
+
const aliasPropertyPath = propertyPathParts.join(".");
|
|
896
|
+
const columns = alias.metadata.findColumnsWithPropertyPath(aliasPropertyPath);
|
|
897
|
+
if (!columns.length) {
|
|
898
|
+
throw new EntityPropertyNotFoundError_1.EntityPropertyNotFoundError(propertyPath, alias.metadata);
|
|
899
|
+
}
|
|
900
|
+
return [alias, root, columns];
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Creates a property paths for a given ObjectLiteral.
|
|
904
|
+
*/
|
|
905
|
+
createPropertyPath(metadata, entity, prefix = "") {
|
|
906
|
+
const paths = [];
|
|
907
|
+
for (const key of Object.keys(entity)) {
|
|
908
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
909
|
+
// There's times where we don't actually want to traverse deeper.
|
|
910
|
+
// If the value is a `FindOperator`, or null, or not an object, then we don't, for example.
|
|
911
|
+
if (entity[key] === null ||
|
|
912
|
+
typeof entity[key] !== "object" ||
|
|
913
|
+
InstanceChecker_1.InstanceChecker.isFindOperator(entity[key])) {
|
|
914
|
+
paths.push(path);
|
|
915
|
+
continue;
|
|
916
|
+
}
|
|
917
|
+
if (metadata.hasEmbeddedWithPropertyPath(path)) {
|
|
918
|
+
const subPaths = this.createPropertyPath(metadata, entity[key], path);
|
|
919
|
+
paths.push(...subPaths);
|
|
920
|
+
continue;
|
|
921
|
+
}
|
|
922
|
+
if (metadata.hasRelationWithPropertyPath(path)) {
|
|
923
|
+
const relation = metadata.findRelationWithPropertyPath(path);
|
|
924
|
+
// There's also cases where we don't want to return back all of the properties.
|
|
925
|
+
// These handles the situation where someone passes the model & we don't need to make
|
|
926
|
+
// a HUGE `where` to uniquely look up the entity.
|
|
927
|
+
// In the case of a *-to-one, there's only ever one possible entity on the other side
|
|
928
|
+
// so if the join columns are all defined we can return just the relation itself
|
|
929
|
+
// because it will fetch only the join columns and do the lookup.
|
|
930
|
+
if (relation.relationType === "one-to-one" ||
|
|
931
|
+
relation.relationType === "many-to-one") {
|
|
932
|
+
const joinColumns = relation.joinColumns
|
|
933
|
+
.map((j) => j.referencedColumn)
|
|
934
|
+
.filter((j) => !!j);
|
|
935
|
+
const hasAllJoinColumns = joinColumns.length > 0 &&
|
|
936
|
+
joinColumns.every((column) => column.getEntityValue(entity[key], false));
|
|
937
|
+
if (hasAllJoinColumns) {
|
|
938
|
+
paths.push(path);
|
|
939
|
+
continue;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
if (relation.relationType === "one-to-many" ||
|
|
943
|
+
relation.relationType === "many-to-many") {
|
|
944
|
+
throw new Error(`Cannot query across ${relation.relationType} for property ${path}`);
|
|
945
|
+
}
|
|
946
|
+
// For any other case, if the `entity[key]` contains all of the primary keys we can do a
|
|
947
|
+
// lookup via these. We don't need to look up via any other values 'cause these are
|
|
948
|
+
// the unique primary keys.
|
|
949
|
+
// This handles the situation where someone passes the model & we don't need to make
|
|
950
|
+
// a HUGE where.
|
|
951
|
+
const primaryColumns = relation.inverseEntityMetadata.primaryColumns;
|
|
952
|
+
const hasAllPrimaryKeys = primaryColumns.length > 0 &&
|
|
953
|
+
primaryColumns.every((column) => column.getEntityValue(entity[key], false));
|
|
954
|
+
if (hasAllPrimaryKeys) {
|
|
955
|
+
const subPaths = primaryColumns.map((column) => `${path}.${column.propertyPath}`);
|
|
956
|
+
paths.push(...subPaths);
|
|
957
|
+
continue;
|
|
958
|
+
}
|
|
959
|
+
// If nothing else, just return every property that's being passed to us.
|
|
960
|
+
const subPaths = this.createPropertyPath(relation.inverseEntityMetadata, entity[key]).map((p) => `${path}.${p}`);
|
|
961
|
+
paths.push(...subPaths);
|
|
962
|
+
continue;
|
|
963
|
+
}
|
|
964
|
+
paths.push(path);
|
|
965
|
+
}
|
|
966
|
+
return paths;
|
|
967
|
+
}
|
|
968
|
+
*getPredicates(where) {
|
|
969
|
+
if (this.expressionMap.mainAlias.hasMetadata) {
|
|
970
|
+
const propertyPaths = this.createPropertyPath(this.expressionMap.mainAlias.metadata, where);
|
|
971
|
+
for (const propertyPath of propertyPaths) {
|
|
972
|
+
const [alias, aliasPropertyPath, columns] = this.findColumnsForPropertyPath(propertyPath);
|
|
973
|
+
for (const column of columns) {
|
|
974
|
+
let containedWhere = where;
|
|
975
|
+
for (const part of aliasPropertyPath) {
|
|
976
|
+
if (!containedWhere || !(part in containedWhere)) {
|
|
977
|
+
containedWhere = {};
|
|
978
|
+
break;
|
|
979
|
+
}
|
|
980
|
+
containedWhere = containedWhere[part];
|
|
981
|
+
}
|
|
982
|
+
// Use the correct alias & the property path from the column
|
|
983
|
+
const aliasPath = this.expressionMap
|
|
984
|
+
.aliasNamePrefixingEnabled
|
|
985
|
+
? `${alias.name}.${column.propertyPath}`
|
|
986
|
+
: column.propertyPath;
|
|
987
|
+
const parameterValue = column.getEntityValue(containedWhere, true);
|
|
988
|
+
yield [aliasPath, parameterValue];
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
for (const key of Object.keys(where)) {
|
|
994
|
+
const parameterValue = where[key];
|
|
995
|
+
const aliasPath = this.expressionMap.aliasNamePrefixingEnabled
|
|
996
|
+
? `${this.alias}.${key}`
|
|
997
|
+
: key;
|
|
998
|
+
yield [aliasPath, parameterValue];
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
getWherePredicateCondition(aliasPath, parameterValue) {
|
|
1003
|
+
if (InstanceChecker_1.InstanceChecker.isFindOperator(parameterValue)) {
|
|
1004
|
+
const parameters = [];
|
|
1005
|
+
if (parameterValue.useParameter) {
|
|
1006
|
+
if (parameterValue.objectLiteralParameters) {
|
|
1007
|
+
this.setParameters(parameterValue.objectLiteralParameters);
|
|
1008
|
+
}
|
|
1009
|
+
else if (parameterValue.multipleParameters) {
|
|
1010
|
+
for (const v of parameterValue.value) {
|
|
1011
|
+
parameters.push(this.createParameter(v));
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
else {
|
|
1015
|
+
parameters.push(this.createParameter(parameterValue.value));
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
if (parameterValue.type === "raw") {
|
|
1019
|
+
if (parameterValue.getSql) {
|
|
1020
|
+
return parameterValue.getSql(aliasPath);
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
return {
|
|
1024
|
+
operator: "equal",
|
|
1025
|
+
parameters: [aliasPath, parameterValue.value],
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
else if (parameterValue.type === "not") {
|
|
1030
|
+
if (parameterValue.child) {
|
|
1031
|
+
return {
|
|
1032
|
+
operator: parameterValue.type,
|
|
1033
|
+
condition: this.getWherePredicateCondition(aliasPath, parameterValue.child),
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
else {
|
|
1037
|
+
return {
|
|
1038
|
+
operator: "notEqual",
|
|
1039
|
+
parameters: [aliasPath, ...parameters],
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
else if (parameterValue.type === "and") {
|
|
1044
|
+
const values = parameterValue.value;
|
|
1045
|
+
return {
|
|
1046
|
+
operator: parameterValue.type,
|
|
1047
|
+
parameters: values.map((operator) => this.createWhereConditionExpression(this.getWherePredicateCondition(aliasPath, operator))),
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
1050
|
+
else if (parameterValue.type === "or") {
|
|
1051
|
+
const values = parameterValue.value;
|
|
1052
|
+
return {
|
|
1053
|
+
operator: parameterValue.type,
|
|
1054
|
+
parameters: values.map((operator) => this.createWhereConditionExpression(this.getWherePredicateCondition(aliasPath, operator))),
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
else {
|
|
1058
|
+
return {
|
|
1059
|
+
operator: parameterValue.type,
|
|
1060
|
+
parameters: [aliasPath, ...parameters],
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
// } else if (parameterValue === null) {
|
|
1064
|
+
// return {
|
|
1065
|
+
// operator: "isNull",
|
|
1066
|
+
// parameters: [
|
|
1067
|
+
// aliasPath,
|
|
1068
|
+
// ]
|
|
1069
|
+
// };
|
|
1070
|
+
}
|
|
1071
|
+
else {
|
|
1072
|
+
return {
|
|
1073
|
+
operator: "equal",
|
|
1074
|
+
parameters: [aliasPath, this.createParameter(parameterValue)],
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
getWhereCondition(where) {
|
|
1079
|
+
if (typeof where === "string") {
|
|
1080
|
+
return where;
|
|
1081
|
+
}
|
|
1082
|
+
if (InstanceChecker_1.InstanceChecker.isBrackets(where)) {
|
|
1083
|
+
const whereQueryBuilder = this.createQueryBuilder();
|
|
1084
|
+
whereQueryBuilder.parentQueryBuilder = this;
|
|
1085
|
+
whereQueryBuilder.expressionMap.mainAlias =
|
|
1086
|
+
this.expressionMap.mainAlias;
|
|
1087
|
+
whereQueryBuilder.expressionMap.aliasNamePrefixingEnabled =
|
|
1088
|
+
this.expressionMap.aliasNamePrefixingEnabled;
|
|
1089
|
+
whereQueryBuilder.expressionMap.parameters =
|
|
1090
|
+
this.expressionMap.parameters;
|
|
1091
|
+
whereQueryBuilder.expressionMap.nativeParameters =
|
|
1092
|
+
this.expressionMap.nativeParameters;
|
|
1093
|
+
whereQueryBuilder.expressionMap.wheres = [];
|
|
1094
|
+
where.whereFactory(whereQueryBuilder);
|
|
1095
|
+
return {
|
|
1096
|
+
operator: InstanceChecker_1.InstanceChecker.isNotBrackets(where)
|
|
1097
|
+
? "not"
|
|
1098
|
+
: "brackets",
|
|
1099
|
+
condition: whereQueryBuilder.expressionMap.wheres,
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
if (typeof where === "function") {
|
|
1103
|
+
return where(this);
|
|
1104
|
+
}
|
|
1105
|
+
const wheres = Array.isArray(where) ? where : [where];
|
|
1106
|
+
const clauses = [];
|
|
1107
|
+
for (const where of wheres) {
|
|
1108
|
+
const conditions = [];
|
|
1109
|
+
// Filter the conditions and set up the parameter values
|
|
1110
|
+
for (const [aliasPath, parameterValue] of this.getPredicates(where)) {
|
|
1111
|
+
conditions.push({
|
|
1112
|
+
type: "and",
|
|
1113
|
+
condition: this.getWherePredicateCondition(aliasPath, parameterValue),
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
clauses.push({ type: "or", condition: conditions });
|
|
1117
|
+
}
|
|
1118
|
+
if (clauses.length === 1) {
|
|
1119
|
+
return clauses[0].condition;
|
|
1120
|
+
}
|
|
1121
|
+
return clauses;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Creates a query builder used to execute sql queries inside this query builder.
|
|
1125
|
+
*/
|
|
1126
|
+
obtainQueryRunner() {
|
|
1127
|
+
return this.queryRunner || this.connection.createQueryRunner();
|
|
1128
|
+
}
|
|
1129
|
+
hasCommonTableExpressions() {
|
|
1130
|
+
return this.expressionMap.commonTableExpressions.length > 0;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
exports.QueryBuilder = QueryBuilder;
|
|
1134
|
+
/**
|
|
1135
|
+
* Contains all registered query builder classes.
|
|
1136
|
+
*/
|
|
1137
|
+
QueryBuilder.queryBuilderRegistry = {};
|
|
1138
|
+
|
|
1139
|
+
//# sourceMappingURL=QueryBuilder.js.map
|