better-convex 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregate/index.d.ts +1 -3
- package/dist/auth/http/index.d.ts +1 -1
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/index.js +6 -5
- package/dist/auth/nextjs/index.d.ts +2 -2
- package/dist/auth/nextjs/index.js +2 -2
- package/dist/{caller-factory-D3OuR1eI.js → caller-factory-4uND4vnj.js} +2 -2
- package/dist/cli.mjs +413 -5
- package/dist/{codegen-Cz1idI3-.mjs → codegen-BS36cYTH.mjs} +88 -5
- package/dist/{create-schema-orm-69VF4CFV.js → create-schema-orm-DtuyK2RB.js} +1 -1
- package/dist/crpc/index.d.ts +2 -2
- package/dist/crpc/index.js +3 -3
- package/dist/customFunctions-C_i_0joT.js +167 -0
- package/dist/{http-types-BCf2wCgp.d.ts → http-types-BsnDV7Je.d.ts} +1 -1
- package/dist/orm/index.d.ts +4 -3
- package/dist/orm/index.js +707 -4
- package/dist/{procedure-caller-CcjtUFvL.d.ts → procedure-caller-Cj_lgUev.d.ts} +4 -19
- package/dist/rsc/index.d.ts +3 -3
- package/dist/rsc/index.js +4 -4
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +4 -3
- package/dist/{types-CIBGEYXq.d.ts → types-DZFvhoPJ.d.ts} +1 -1
- package/dist/{customFunctions-CZnCwoR3.js → validators-B7oIJCAp.js} +67 -165
- package/dist/validators-BDrWGp4M.d.ts +88 -0
- package/dist/watcher.mjs +1 -1
- package/dist/{where-clause-compiler-CRP-i1Qa.d.ts → where-clause-compiler-HUa2223D.d.ts} +106 -2
- package/package.json +1 -1
- /package/dist/{create-schema-BdZOL6ns.js → create-schema-DE9ZtH8n.js} +0 -0
- /package/dist/{error-Be4OcwwD.js → error-C7AOPlv2.js} +0 -0
- /package/dist/{meta-utils-DDVYp9Xf.js → meta-utils-C9_6WIzj.js} +0 -0
- /package/dist/{query-context-DGExXZIV.d.ts → query-context-BMXt2TKe.d.ts} +0 -0
- /package/dist/{query-context-BDSis9rT.js → query-context-yQVARct0.js} +0 -0
- /package/dist/{query-options-B0c1b6pZ.js → query-options-Bjo6j5cC.js} +0 -0
- /package/dist/{transformer-Dh0w2py0.js → transformer-BsX4RWes.js} +0 -0
- /package/dist/{types-DgwvxKbT.d.ts → types-DarApWtO.d.ts} +0 -0
- /package/dist/{types-DwGkkq2s.d.ts → types-kgwiK-xe.d.ts} +0 -0
|
@@ -150,6 +150,26 @@ const GENERATED_SERVER_RUNTIME_PROCEDURES = [
|
|
|
150
150
|
internal: true,
|
|
151
151
|
type: "mutation"
|
|
152
152
|
},
|
|
153
|
+
{
|
|
154
|
+
exportName: "migrationRun",
|
|
155
|
+
internal: true,
|
|
156
|
+
type: "mutation"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
exportName: "migrationRunChunk",
|
|
160
|
+
internal: true,
|
|
161
|
+
type: "mutation"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
exportName: "migrationStatus",
|
|
165
|
+
internal: true,
|
|
166
|
+
type: "mutation"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
exportName: "migrationCancel",
|
|
170
|
+
internal: true,
|
|
171
|
+
type: "mutation"
|
|
172
|
+
},
|
|
153
173
|
{
|
|
154
174
|
exportName: "resetChunk",
|
|
155
175
|
internal: true,
|
|
@@ -239,6 +259,9 @@ function getGeneratedServerOutputFile(functionsDir) {
|
|
|
239
259
|
function getGeneratedAuthOutputFile(functionsDir) {
|
|
240
260
|
return path.join(functionsDir, GENERATED_DIR, "auth.ts");
|
|
241
261
|
}
|
|
262
|
+
function getGeneratedMigrationsHelperOutputFile(functionsDir) {
|
|
263
|
+
return path.join(functionsDir, GENERATED_DIR, "migrations.gen.ts");
|
|
264
|
+
}
|
|
242
265
|
function getLegacyGeneratedOutputFile(functionsDir) {
|
|
243
266
|
return path.join(functionsDir, "generated.ts");
|
|
244
267
|
}
|
|
@@ -269,6 +292,10 @@ export type OrmCtx<Ctx = QueryCtx> = Ctx;
|
|
|
269
292
|
export const orm = {} as Record<string, unknown>;
|
|
270
293
|
export const scheduledMutationBatch = undefined as unknown;
|
|
271
294
|
export const scheduledDelete = undefined as unknown;
|
|
295
|
+
export const migrationRun = undefined as unknown;
|
|
296
|
+
export const migrationRunChunk = undefined as unknown;
|
|
297
|
+
export const migrationStatus = undefined as unknown;
|
|
298
|
+
export const migrationCancel = undefined as unknown;
|
|
272
299
|
export const initCRPC = baseInitCRPC;
|
|
273
300
|
|
|
274
301
|
export function withOrm<Ctx>(ctx: Ctx): Ctx {
|
|
@@ -291,14 +318,24 @@ export const getAuth = () => ({} as Record<string, unknown>);
|
|
|
291
318
|
export const auth = {} as Record<string, unknown>;
|
|
292
319
|
`;
|
|
293
320
|
}
|
|
321
|
+
function emitGeneratedMigrationsPlaceholderFile() {
|
|
322
|
+
return `// biome-ignore-all format: generated
|
|
323
|
+
// This file is auto-generated by better-convex
|
|
324
|
+
// Do not edit manually. Run \`better-convex codegen\` to regenerate.
|
|
325
|
+
|
|
326
|
+
export { defineMigration } from 'better-convex/orm';
|
|
327
|
+
`;
|
|
328
|
+
}
|
|
294
329
|
function ensureGeneratedSupportPlaceholders(functionsDir, options) {
|
|
295
330
|
const serverOutputFile = getGeneratedServerOutputFile(functionsDir);
|
|
296
331
|
const authOutputFile = getGeneratedAuthOutputFile(functionsDir);
|
|
332
|
+
const migrationsHelperOutputFile = getGeneratedMigrationsHelperOutputFile(functionsDir);
|
|
297
333
|
const generatedDir = path.dirname(serverOutputFile);
|
|
298
334
|
fs.mkdirSync(generatedDir, { recursive: true });
|
|
299
335
|
const includeAuth = options?.includeAuth ?? true;
|
|
300
336
|
if (!fs.existsSync(serverOutputFile)) fs.writeFileSync(serverOutputFile, emitGeneratedServerPlaceholderFile());
|
|
301
337
|
if (includeAuth && !fs.existsSync(authOutputFile)) fs.writeFileSync(authOutputFile, emitGeneratedAuthPlaceholderFile());
|
|
338
|
+
if (!fs.existsSync(migrationsHelperOutputFile)) fs.writeFileSync(migrationsHelperOutputFile, emitGeneratedMigrationsPlaceholderFile());
|
|
302
339
|
}
|
|
303
340
|
function emitGeneratedRuntimePlaceholderFile(moduleName) {
|
|
304
341
|
const { callerExportName, handlerExportName } = getModuleRuntimeExportNames(moduleName);
|
|
@@ -331,16 +368,18 @@ function listGeneratedRuntimeFiles(functionsDir) {
|
|
|
331
368
|
if (!fs.existsSync(generatedDir)) return [];
|
|
332
369
|
return listFilesRecursive(generatedDir).filter((file) => file.endsWith(".runtime.ts")).map((file) => path.join(generatedDir, file));
|
|
333
370
|
}
|
|
334
|
-
function emitGeneratedServerFile(outputFile, functionsDir, hasRelationsExport, hasTriggersExport) {
|
|
371
|
+
function emitGeneratedServerFile(outputFile, functionsDir, hasRelationsExport, hasTriggersExport, hasMigrationsManifest) {
|
|
335
372
|
const asSingleQuotedImport = (importPath) => `'${importPath.replaceAll("'", "\\'")}'`;
|
|
336
373
|
const serverTypesImportPath = getServerTypesImportPath(outputFile, functionsDir);
|
|
337
374
|
const dataModelImportPath = getDataModelImportPath(outputFile, functionsDir);
|
|
338
375
|
const runtimeApiImportPath = getRuntimeApiImportPath(outputFile, functionsDir);
|
|
339
376
|
const schemaImportPath = getSchemaImportPath(outputFile, functionsDir);
|
|
377
|
+
const migrationsManifestImportPath = getModuleImportPath(outputFile, functionsDir, "migrations/manifest");
|
|
340
378
|
const serverTypesImportLiteral = asSingleQuotedImport(serverTypesImportPath);
|
|
341
379
|
const dataModelImportLiteral = asSingleQuotedImport(dataModelImportPath);
|
|
342
380
|
const runtimeApiImportLiteral = asSingleQuotedImport(runtimeApiImportPath);
|
|
343
381
|
const schemaImportLiteral = asSingleQuotedImport(schemaImportPath);
|
|
382
|
+
const migrationsManifestImportLiteral = asSingleQuotedImport(migrationsManifestImportPath);
|
|
344
383
|
if (!hasRelationsExport) return `// biome-ignore-all format: generated
|
|
345
384
|
// This file is auto-generated by better-convex
|
|
346
385
|
// Do not edit manually. Run \`better-convex codegen\` to regenerate.
|
|
@@ -360,6 +399,8 @@ export type GenericCtx = QueryCtx | MutationCtx | ActionCtx;
|
|
|
360
399
|
export const initCRPC = baseInitCRPC.dataModel<DataModel>();
|
|
361
400
|
`;
|
|
362
401
|
const ormFunctionsAccessor = getAccessPath("(internal as unknown as Record<string, any>)", getModuleNameFromOutputFile(outputFile, functionsDir).split("/").filter(Boolean));
|
|
402
|
+
const schemaNamedImports = hasTriggersExport ? "relations, triggers" : "relations";
|
|
403
|
+
const triggersConfigLine = hasTriggersExport ? " triggers,\n" : "";
|
|
363
404
|
return `// biome-ignore-all format: generated
|
|
364
405
|
// This file is auto-generated by better-convex
|
|
365
406
|
// Do not edit manually. Run \`better-convex codegen\` to regenerate.
|
|
@@ -374,14 +415,15 @@ import type {
|
|
|
374
415
|
QueryCtx as ServerQueryCtx,
|
|
375
416
|
} from ${serverTypesImportLiteral};
|
|
376
417
|
import { internalMutation } from ${serverTypesImportLiteral};
|
|
377
|
-
import schema, { ${
|
|
418
|
+
import schema, { ${schemaNamedImports} } from ${schemaImportLiteral};
|
|
419
|
+
${hasMigrationsManifest ? `import { migrations } from ${migrationsManifestImportLiteral};\n` : ""}
|
|
378
420
|
|
|
379
421
|
const ormFunctions = ${ormFunctionsAccessor} as OrmFunctions;
|
|
380
422
|
|
|
381
423
|
export const orm = createOrm({
|
|
382
424
|
schema: relations,
|
|
383
|
-
${
|
|
384
|
-
internalMutation,
|
|
425
|
+
${triggersConfigLine} ormFunctions,
|
|
426
|
+
${hasMigrationsManifest ? " migrations,\n" : ""} internalMutation,
|
|
385
427
|
});
|
|
386
428
|
|
|
387
429
|
export type OrmCtx<Ctx extends ServerQueryCtx | ServerMutationCtx = ServerQueryCtx> = GenericOrmCtx<Ctx, typeof relations>;
|
|
@@ -405,6 +447,10 @@ export const {
|
|
|
405
447
|
aggregateBackfill,
|
|
406
448
|
aggregateBackfillChunk,
|
|
407
449
|
aggregateBackfillStatus,
|
|
450
|
+
migrationRun,
|
|
451
|
+
migrationRunChunk,
|
|
452
|
+
migrationStatus,
|
|
453
|
+
migrationCancel,
|
|
408
454
|
resetChunk,
|
|
409
455
|
reset,
|
|
410
456
|
} = orm.api();
|
|
@@ -500,6 +546,32 @@ export const {
|
|
|
500
546
|
} = authRuntime;
|
|
501
547
|
`;
|
|
502
548
|
}
|
|
549
|
+
function emitGeneratedMigrationsFile(outputFile, functionsDir, hasRelationsExport) {
|
|
550
|
+
const asSingleQuotedImport = (importPath) => `'${importPath.replaceAll("'", "\\'")}'`;
|
|
551
|
+
const schemaImportLiteral = asSingleQuotedImport(getSchemaImportPath(outputFile, functionsDir));
|
|
552
|
+
if (!hasRelationsExport) return `// biome-ignore-all format: generated
|
|
553
|
+
// This file is auto-generated by better-convex
|
|
554
|
+
// Do not edit manually. Run \`better-convex codegen\` to regenerate.
|
|
555
|
+
|
|
556
|
+
export { defineMigration } from 'better-convex/orm';
|
|
557
|
+
`;
|
|
558
|
+
return `// biome-ignore-all format: generated
|
|
559
|
+
// This file is auto-generated by better-convex
|
|
560
|
+
// Do not edit manually. Run \`better-convex codegen\` to regenerate.
|
|
561
|
+
|
|
562
|
+
import {
|
|
563
|
+
defineMigration as baseDefineMigration,
|
|
564
|
+
type MigrationDefinition,
|
|
565
|
+
} from 'better-convex/orm';
|
|
566
|
+
import { relations } from ${schemaImportLiteral};
|
|
567
|
+
|
|
568
|
+
export function defineMigration(
|
|
569
|
+
migration: MigrationDefinition<typeof relations>
|
|
570
|
+
): MigrationDefinition<typeof relations> {
|
|
571
|
+
return baseDefineMigration<typeof relations>(migration);
|
|
572
|
+
}
|
|
573
|
+
`;
|
|
574
|
+
}
|
|
503
575
|
function emitGeneratedModuleRuntimeFile(outputFile, functionsDir, moduleName, procedureEntries) {
|
|
504
576
|
const { callerExportName, handlerExportName } = getModuleRuntimeExportNames(moduleName);
|
|
505
577
|
const runtimeApiImportPath = getRuntimeApiImportPath(outputFile, functionsDir);
|
|
@@ -787,6 +859,10 @@ async function generateMeta(outputDir, options) {
|
|
|
787
859
|
const { functionsDir, outputFile } = getConvexConfig(outputDir);
|
|
788
860
|
const serverOutputFile = getGeneratedServerOutputFile(functionsDir);
|
|
789
861
|
const authOutputFile = getGeneratedAuthOutputFile(functionsDir);
|
|
862
|
+
const migrationsHelperOutputFile = getGeneratedMigrationsHelperOutputFile(functionsDir);
|
|
863
|
+
const legacyGeneratedMigrationsOutputFile = path.join(functionsDir, GENERATED_DIR, "migrations.ts");
|
|
864
|
+
const legacyGeneratedMigrationsRuntimeOutputFile = path.join(functionsDir, GENERATED_DIR, "migrations.runtime.ts");
|
|
865
|
+
const legacyGeneratedMigrationsUnderscoreOutputFile = path.join(functionsDir, GENERATED_DIR, "_migrations.ts");
|
|
790
866
|
const generatedAuthModuleName = getModuleNameFromOutputFile(authOutputFile, functionsDir);
|
|
791
867
|
const debug = options?.debug ?? false;
|
|
792
868
|
const silent = options?.silent ?? false;
|
|
@@ -808,6 +884,7 @@ async function generateMeta(outputDir, options) {
|
|
|
808
884
|
};
|
|
809
885
|
const hasRelationsExport = hasNamedExport(path.join(functionsDir, "schema.ts"), "relations");
|
|
810
886
|
const hasTriggersExport = hasNamedExport(path.join(functionsDir, "schema.ts"), "triggers");
|
|
887
|
+
const hasMigrationsManifest = fs.existsSync(path.join(functionsDir, "migrations", "manifest.ts"));
|
|
811
888
|
if (hasTriggersExport && !hasRelationsExport) throw new Error("Codegen error: schema.ts exports 'triggers' but is missing 'relations'. Export `relations` and define triggers via `defineTriggers(relations, { ... })`.");
|
|
812
889
|
ensureGeneratedSupportPlaceholders(functionsDir, { includeAuth: generateAuth });
|
|
813
890
|
if (generateApi) {
|
|
@@ -904,10 +981,15 @@ ${optionalTypeExports}
|
|
|
904
981
|
if (!fs.existsSync(outputDirname)) fs.mkdirSync(outputDirname, { recursive: true });
|
|
905
982
|
fs.writeFileSync(outputFile, output);
|
|
906
983
|
} else fs.rmSync(outputFile, { force: true });
|
|
907
|
-
const serverOutput = emitGeneratedServerFile(serverOutputFile, functionsDir, hasRelationsExport, hasTriggersExport);
|
|
984
|
+
const serverOutput = emitGeneratedServerFile(serverOutputFile, functionsDir, hasRelationsExport, hasTriggersExport, hasMigrationsManifest);
|
|
908
985
|
const generatedOutputDirname = path.dirname(serverOutputFile);
|
|
909
986
|
if (!fs.existsSync(generatedOutputDirname)) fs.mkdirSync(generatedOutputDirname, { recursive: true });
|
|
910
987
|
fs.writeFileSync(serverOutputFile, serverOutput);
|
|
988
|
+
const migrationsOutput = emitGeneratedMigrationsFile(migrationsHelperOutputFile, functionsDir, hasRelationsExport);
|
|
989
|
+
fs.writeFileSync(migrationsHelperOutputFile, migrationsOutput);
|
|
990
|
+
fs.rmSync(legacyGeneratedMigrationsOutputFile, { force: true });
|
|
991
|
+
fs.rmSync(legacyGeneratedMigrationsRuntimeOutputFile, { force: true });
|
|
992
|
+
fs.rmSync(legacyGeneratedMigrationsUnderscoreOutputFile, { force: true });
|
|
911
993
|
if (generateAuth) {
|
|
912
994
|
const authOutput = emitGeneratedAuthFile(authOutputFile, functionsDir, hasRelationsExport, authContract);
|
|
913
995
|
fs.writeFileSync(authOutputFile, authOutput);
|
|
@@ -957,6 +1039,7 @@ ${optionalTypeExports}
|
|
|
957
1039
|
if (generateApi) console.info(`\n✅ Generated ${outputFile}`);
|
|
958
1040
|
else console.info(`\n🧹 Removed ${outputFile}`);
|
|
959
1041
|
console.info(`✅ Generated ${serverOutputFile}`);
|
|
1042
|
+
console.info(`✅ Generated ${migrationsHelperOutputFile}`);
|
|
960
1043
|
if (generateAuth) console.info(`✅ Generated ${authOutputFile}`);
|
|
961
1044
|
else console.info(`🧹 Removed ${authOutputFile}`);
|
|
962
1045
|
for (const runtimeOutputFile of runtimeOutputFiles) console.info(`✅ Generated ${runtimeOutputFile}`);
|
package/dist/crpc/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as identityTransformer, G as DataTransformerOptions, H as CombinedDataTransformer, J as dateWireCodec, K as WireCodec, Q as getTransformer, U as DATE_CODEC_TAG, W as DataTransformer, X as defaultCRPCTransformer, Y as decodeWire, Z as encodeWire, a as HttpProcedureCall, c as InferHttpInput, i as HttpErrorCode, l as InferHttpOutput, n as HttpClientError, o as HttpRouteInfo, q as createTaggedTransformer, r as HttpClientFromRouter, s as HttpRouteMap, t as HttpClient, u as isHttpClientError } from "../http-types-
|
|
2
|
-
import { C as PaginatedFnMeta, D as VanillaMutation, E as VanillaCRPCClient, O as VanillaQuery, S as Meta, T as VanillaAction, _ as ExtractPaginatedItem, a as ConvexInfiniteQueryMeta, b as InfiniteQueryInput, c as ConvexMutationKey, d as ConvexQueryMeta, f as ConvexQueryOptions, g as DecorateQuery, h as DecorateMutation, i as ConvexActionOptions, l as ConvexQueryHookOptions, m as DecorateInfiniteQuery, n as CRPCClient, o as ConvexInfiniteQueryOptions, p as DecorateAction, r as ConvexActionKey, s as ConvexInfiniteQueryOptionsWithRef, t as AuthType, u as ConvexQueryKey, v as FUNC_REF_SYMBOL, w as PaginationOpts, x as InfiniteQueryOptsParam, y as FnMeta } from "../types-
|
|
1
|
+
import { $ as identityTransformer, G as DataTransformerOptions, H as CombinedDataTransformer, J as dateWireCodec, K as WireCodec, Q as getTransformer, U as DATE_CODEC_TAG, W as DataTransformer, X as defaultCRPCTransformer, Y as decodeWire, Z as encodeWire, a as HttpProcedureCall, c as InferHttpInput, i as HttpErrorCode, l as InferHttpOutput, n as HttpClientError, o as HttpRouteInfo, q as createTaggedTransformer, r as HttpClientFromRouter, s as HttpRouteMap, t as HttpClient, u as isHttpClientError } from "../http-types-BsnDV7Je.js";
|
|
2
|
+
import { C as PaginatedFnMeta, D as VanillaMutation, E as VanillaCRPCClient, O as VanillaQuery, S as Meta, T as VanillaAction, _ as ExtractPaginatedItem, a as ConvexInfiniteQueryMeta, b as InfiniteQueryInput, c as ConvexMutationKey, d as ConvexQueryMeta, f as ConvexQueryOptions, g as DecorateQuery, h as DecorateMutation, i as ConvexActionOptions, l as ConvexQueryHookOptions, m as DecorateInfiniteQuery, n as CRPCClient, o as ConvexInfiniteQueryOptions, p as DecorateAction, r as ConvexActionKey, s as ConvexInfiniteQueryOptionsWithRef, t as AuthType, u as ConvexQueryKey, v as FUNC_REF_SYMBOL, w as PaginationOpts, x as InfiniteQueryOptsParam, y as FnMeta } from "../types-DZFvhoPJ.js";
|
|
3
3
|
import { FunctionArgs, FunctionReference } from "convex/server";
|
|
4
4
|
|
|
5
5
|
//#region src/crpc/error.d.ts
|
package/dist/crpc/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as isCRPCErrorCode, i as isCRPCError, n as defaultIsUnauthorized, r as isCRPCClientError, t as CRPCClientError } from "../error-
|
|
2
|
-
import { a as defaultCRPCTransformer, c as identityTransformer, i as decodeWire, n as createTaggedTransformer, o as encodeWire, r as dateWireCodec, s as getTransformer, t as DATE_CODEC_TAG } from "../transformer-
|
|
3
|
-
import { n as convexInfiniteQueryOptions, r as convexQuery, t as convexAction } from "../query-options-
|
|
1
|
+
import { a as isCRPCErrorCode, i as isCRPCError, n as defaultIsUnauthorized, r as isCRPCClientError, t as CRPCClientError } from "../error-C7AOPlv2.js";
|
|
2
|
+
import { a as defaultCRPCTransformer, c as identityTransformer, i as decodeWire, n as createTaggedTransformer, o as encodeWire, r as dateWireCodec, s as getTransformer, t as DATE_CODEC_TAG } from "../transformer-BsX4RWes.js";
|
|
3
|
+
import { n as convexInfiniteQueryOptions, r as convexQuery, t as convexAction } from "../query-options-Bjo6j5cC.js";
|
|
4
4
|
|
|
5
5
|
//#region src/crpc/http-types.ts
|
|
6
6
|
/** HTTP client error */
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { c as omit, l as pick, t as addFieldsToValidator } from "./validators-B7oIJCAp.js";
|
|
2
|
+
|
|
3
|
+
//#region src/server/context-utils.ts
|
|
4
|
+
const isQueryCtx = (ctx) => "db" in ctx;
|
|
5
|
+
const isMutationCtx = (ctx) => "db" in ctx && "scheduler" in ctx;
|
|
6
|
+
const isActionCtx = (ctx) => "runAction" in ctx;
|
|
7
|
+
const isRunMutationCtx = (ctx) => "runMutation" in ctx;
|
|
8
|
+
const requireQueryCtx = (ctx) => {
|
|
9
|
+
if (!isQueryCtx(ctx)) throw new Error("Query context required");
|
|
10
|
+
return ctx;
|
|
11
|
+
};
|
|
12
|
+
const requireMutationCtx = (ctx) => {
|
|
13
|
+
if (!isMutationCtx(ctx)) throw new Error("Mutation context required");
|
|
14
|
+
return ctx;
|
|
15
|
+
};
|
|
16
|
+
const requireActionCtx = (ctx) => {
|
|
17
|
+
if (!isActionCtx(ctx)) throw new Error("Action context required");
|
|
18
|
+
return ctx;
|
|
19
|
+
};
|
|
20
|
+
const requireRunMutationCtx = (ctx) => {
|
|
21
|
+
if (!isRunMutationCtx(ctx)) throw new Error("Mutation or action context required");
|
|
22
|
+
return ctx;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/internal/upstream/server/customFunctions.ts
|
|
27
|
+
/**
|
|
28
|
+
* A helper for defining a Customization when your mod doesn't need to add or remove
|
|
29
|
+
* anything from args.
|
|
30
|
+
* @param modifyCtx A function that defines how to modify the ctx.
|
|
31
|
+
* @returns A ctx delta to be applied to the original ctx.
|
|
32
|
+
*/
|
|
33
|
+
function customCtx(modifyCtx) {
|
|
34
|
+
return {
|
|
35
|
+
args: {},
|
|
36
|
+
input: async (ctx, _, extra) => ({
|
|
37
|
+
ctx: await modifyCtx(ctx, extra),
|
|
38
|
+
args: {}
|
|
39
|
+
})
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A Customization that doesn't add or remove any context or args.
|
|
44
|
+
*/
|
|
45
|
+
const NoOp = {
|
|
46
|
+
args: {},
|
|
47
|
+
input() {
|
|
48
|
+
return {
|
|
49
|
+
args: {},
|
|
50
|
+
ctx: {}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* customMutation helps define custom behavior on top of `mutation`
|
|
56
|
+
* or `internalMutation` by passing a function that modifies the ctx and args.
|
|
57
|
+
*
|
|
58
|
+
* Example usage:
|
|
59
|
+
* ```js
|
|
60
|
+
* const myMutationBuilder = customMutation(mutation, {
|
|
61
|
+
* args: { sessionId: v.id("sessions") },
|
|
62
|
+
* input: async (ctx, args) => {
|
|
63
|
+
* const user = await getUserOrNull(ctx);
|
|
64
|
+
* const session = await db.get(sessionId);
|
|
65
|
+
* const db = wrapDatabaseReader({ user }, ctx.db, rlsRules);
|
|
66
|
+
* return {
|
|
67
|
+
* ctx: { db, user, session },
|
|
68
|
+
* args: {},
|
|
69
|
+
* onSuccess: ({ result }) => {
|
|
70
|
+
* // Optional callback that runs after the function executes
|
|
71
|
+
* // Has access to resources created during input processing
|
|
72
|
+
* console.log(`User ${user.name} returned:`, result);
|
|
73
|
+
* }
|
|
74
|
+
* };
|
|
75
|
+
* },
|
|
76
|
+
* });
|
|
77
|
+
*
|
|
78
|
+
* // Using the custom builder
|
|
79
|
+
* export const setSomeData = myMutationBuilder({
|
|
80
|
+
* args: { someArg: v.string() },
|
|
81
|
+
* handler: async (ctx, args) => {
|
|
82
|
+
* const { db, user, session, scheduler } = ctx;
|
|
83
|
+
* const { someArg } = args;
|
|
84
|
+
* // ...
|
|
85
|
+
* }
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* Simple usage only modifying ctx:
|
|
90
|
+
* ```js
|
|
91
|
+
* const myUserMutation = customMutation(
|
|
92
|
+
* mutation,
|
|
93
|
+
* customCtx(async (ctx) => {
|
|
94
|
+
* return {
|
|
95
|
+
* // Throws an exception if the user isn't logged in
|
|
96
|
+
* user: await getUserByTokenIdentifier(ctx),
|
|
97
|
+
* };
|
|
98
|
+
* })
|
|
99
|
+
* );
|
|
100
|
+
*
|
|
101
|
+
* // Using it
|
|
102
|
+
* export const setMyName = myUserMutation({
|
|
103
|
+
* args: { name: v.string() },
|
|
104
|
+
* handler: async (ctx, args) => {
|
|
105
|
+
* await ctx.db.patch(ctx.user._id, { name: args.name });
|
|
106
|
+
* },
|
|
107
|
+
* });
|
|
108
|
+
*
|
|
109
|
+
* @param mutation The mutation to be modified. Usually `mutation` or `internalMutation`
|
|
110
|
+
* from `_generated/server`.
|
|
111
|
+
* @param customization The modifier to be applied to the mutation, changing ctx and args.
|
|
112
|
+
* @returns A new mutation builder to define queries with modified ctx and args.
|
|
113
|
+
*/
|
|
114
|
+
function customMutation(mutation, customization) {
|
|
115
|
+
return customFnBuilder(mutation, customization);
|
|
116
|
+
}
|
|
117
|
+
function customFnBuilder(builder, customization) {
|
|
118
|
+
const customInput = customization.input ?? NoOp.input;
|
|
119
|
+
const inputArgs = customization.args ?? NoOp.args;
|
|
120
|
+
return function customBuilder(fn) {
|
|
121
|
+
const { args, handler = fn, returns, ...extra } = fn;
|
|
122
|
+
if (args) return builder({
|
|
123
|
+
args: addFieldsToValidator(args, inputArgs),
|
|
124
|
+
returns,
|
|
125
|
+
handler: async (ctx, allArgs) => {
|
|
126
|
+
const added = await customInput(ctx, pick(allArgs, Object.keys(inputArgs)), extra);
|
|
127
|
+
const args = omit(allArgs, Object.keys(inputArgs));
|
|
128
|
+
const result = await handler({
|
|
129
|
+
...ctx,
|
|
130
|
+
...added.ctx
|
|
131
|
+
}, {
|
|
132
|
+
...args,
|
|
133
|
+
...added.args
|
|
134
|
+
});
|
|
135
|
+
if (added.onSuccess) await added.onSuccess({
|
|
136
|
+
ctx,
|
|
137
|
+
args,
|
|
138
|
+
result
|
|
139
|
+
});
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
if (Object.keys(inputArgs).length > 0) throw new Error("If you're using a custom function with arguments for the input customization, you must declare the arguments for the function too.");
|
|
144
|
+
return builder({
|
|
145
|
+
returns: fn.returns,
|
|
146
|
+
handler: async (ctx, args) => {
|
|
147
|
+
const added = await customInput(ctx, args, extra);
|
|
148
|
+
const result = await handler({
|
|
149
|
+
...ctx,
|
|
150
|
+
...added.ctx
|
|
151
|
+
}, {
|
|
152
|
+
...args,
|
|
153
|
+
...added.args
|
|
154
|
+
});
|
|
155
|
+
if (added.onSuccess) await added.onSuccess({
|
|
156
|
+
ctx,
|
|
157
|
+
args,
|
|
158
|
+
result
|
|
159
|
+
});
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
export { isMutationCtx as a, requireActionCtx as c, requireRunMutationCtx as d, isActionCtx as i, requireMutationCtx as l, customCtx as n, isQueryCtx as o, customMutation as r, isRunMutationCtx as s, NoOp as t, requireQueryCtx as u };
|
package/dist/orm/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
1
|
+
import { i as pretendRequired, n as deprecated, r as pretend } from "../validators-BDrWGp4M.js";
|
|
2
|
+
import { $ as DatabaseWithQuery, $n as FilterOperators, $r as Columns, $t as defineRelations, A as MigrationRunArgs, An as index, Ar as and, At as ConvexCustomBuilderInitial, B as MigrationMigrateOne, Bn as ConvexUniqueConstraintBuilderOn, Br as isFieldReference, Bt as ConvexBigIntBuilderInitial, C as OrmBeforeResult, Cn as ConvexSearchIndexBuilder, Cr as unsetToken, Ct as ConvexIdBuilderInitial, D as OrmTriggers, Dn as ConvexVectorIndexBuilderOn, Dr as FilterExpression, Dt as ConvexDateMode, E as OrmTriggerContext, En as ConvexVectorIndexBuilder, Er as FieldReference, Et as ConvexDateBuilderInitial, F as MigrationDirection, Fn as ConvexCheckBuilder, Fr as fieldRef, Ft as bytes, G as MigrationStep, Gn as AggregateConfig, Gr as lte, Gt as ExtractTablesWithRelations, H as MigrationRunStatus, Hn as check, Hr as isNull, Ht as CountBackfillChunkArgs, I as MigrationDoc, In as ConvexCheckConfig, Ir as gt, It as ConvexBooleanBuilder, J as buildMigrationPlan, Jn as BuildQueryResult, Jr as notBetween, Jt as RelationsBuilder, K as MigrationTableName, Kn as AggregateFieldValue, Kr as ne, Kt as ManyConfig, L as MigrationDocContext, Ln as ConvexForeignKeyBuilder, Lr as gte, Lt as ConvexBooleanBuilderInitial, M as MigrationStatusArgs, Mn as searchIndex, Mr as contains, Mt as json, N as MigrationAppliedState, Nn as uniqueIndex, Nr as endsWith, Nt as ConvexBytesBuilder, O as defineTriggers, On as ConvexVectorIndexConfig, Or as LogicalExpression, Ot as date, P as MigrationDefinition, Pn as vectorIndex, Pr as eq, Pt as ConvexBytesBuilderInitial, Q as DatabaseWithMutations, Qn as DBQueryConfig, Qr as Brand, Qt as TablesRelationalConfig, R as MigrationDriftIssue, Rn as ConvexForeignKeyConfig, Rr as ilike, Rt as boolean, S as scheduledDeleteFactory, Sn as ConvexRankIndexBuilderOn, Sr as VectorSearchProvider, St as ConvexIdBuilder, T as OrmTriggerChange, Tn as ConvexSearchIndexConfig, Tr as ExpressionVisitor, Tt as ConvexDateBuilder, U as MigrationSet, Un as foreignKey, Ur as like, Ut as CountBackfillKickoffArgs, V as MigrationPlan, Vn as ConvexUniqueConstraintConfig, Vr as isNotNull, Vt as bigint, W as MigrationStateMap, Wn as unique, Wr as lt, Wt as CountBackfillStatusArgs, X as defineMigrationSet, Xn as CountConfig, Xr as or, Xt as RelationsBuilderColumnConfig, Y as defineMigration, Yn as BuildRelationResult, Yr as notInArray, Yt as RelationsBuilderColumnBase, Z as detectMigrationDrift, Zn as CountResult, Zr as startsWith, Zt as TableRelationalConfig, _ as OrmWriterCtx, _n as ConvexAggregateIndexBuilder, _r as ReturningAll, _t as ConvexTextBuilderInitial, a as TableConfigResult, ai as ColumnBuilderRuntimeConfig, an as OrmLifecycleChange, ar as MutationExecuteConfig, at as extractRelationsConfig, b as scheduledMutationBatchFactory, bn as ConvexIndexBuilderOn, br as UpdateSet, bt as ConvexNumberBuilderInitial, c as OrmNotFoundError, ci as ColumnDataType, cn as convexTable, cr as MutationPaginateConfig, ct as vector, d as GenericOrmCtx, di as IsPrimaryKey, dn as RlsPolicyConfig, dr as MutationReturning, dt as ConvexTimestampMode, ei as TableName, en as defineRelationsPart, er as GetColumnData, et as OrmReader, f as OrmApiResult, fi as IsUnique, fn as RlsPolicyToOption, fr as MutationRunMode, ft as timestamp, g as OrmReaderCtx, gn as rlsRole, gr as PredicateWhereIndexConfig, gt as ConvexTextBuilder, h as OrmFunctions, hn as RlsRoleConfig, hr as PaginatedResult, ht as textEnum, i as desc, ii as ColumnBuilderBaseConfig, ir as InsertValue, it as EdgeMetadata, j as MigrationRunChunkArgs, jn as rankIndex, jr as between, jt as custom, k as MigrationCancelArgs, kn as aggregateIndex, kr as UnaryExpression, kt as ConvexCustomBuilder, l as CreateOrmOptions, li as DrizzleEntity, ln as deletion, lr as MutationPaginatedResult, lt as ConvexTimestampBuilder, m as OrmClientWithApi, mn as RlsRole, mr as OrderDirection, mt as ConvexTextEnumBuilderInitial, n as defineSchema, ni as AnyColumn, nn as ConvexDeletionConfig, nr as InferModelFromColumns, nt as RlsContext, o as getTableColumns, oi as ColumnBuilderTypeConfig, on as OrmLifecycleOperation, or as MutationExecuteResult, ot as ConvexVectorBuilder, p as OrmClientBase, pi as NotNull, pn as rlsPolicy, pr as OrderByClause, pt as ConvexTextEnumBuilder, q as MigrationWriteMode, qn as AggregateResult, qr as not, qt as OneConfig, r as asc, ri as ColumnBuilder, rn as ConvexTable, rr as InferSelectModel, rt as RlsMode, s as getTableConfig, si as ColumnBuilderWithTableName, sn as TableConfig, sr as MutationExecutionMode, st as ConvexVectorBuilderInitial, t as WhereClauseResult, ti as SystemFields, tn as ConvexDeletionBuilder, tr as InferInsertModel, tt as OrmWriter, u as GenericOrm, ui as HasDefault, un as RlsPolicy, ur as MutationResult, ut as ConvexTimestampBuilderInitial, v as createOrm, vn as ConvexAggregateIndexBuilderOn, vr as ReturningResult, vt as text, w as OrmTableTriggers, wn as ConvexSearchIndexBuilderOn, wr as BinaryExpression, wt as id, x as ScheduledDeleteArgs, xn as ConvexRankIndexBuilder, xr as VectorQueryConfig, xt as integer, y as ScheduledMutationBatchArgs, yn as ConvexIndexBuilder, yr as ReturningSelection, yt as ConvexNumberBuilder, z as MigrationManifestEntry, zn as ConvexUniqueConstraintBuilder, zr as inArray, zt as ConvexBigIntBuilder } from "../where-clause-compiler-HUa2223D.js";
|
|
3
|
+
import { a as QueryCtxWithPreferredOrmQueryTable, i as QueryCtxWithOrmQueryTable, n as LookupByIdResultByCtx, o as getByIdWithOrmQueryFallback, r as QueryCtxWithOptionalOrmQueryTable, t as DocByCtx } from "../query-context-BMXt2TKe.js";
|
|
3
4
|
import { DefineSchemaOptions, GenericSchema, SchemaDefinition } from "convex/server";
|
|
4
|
-
export { type AggregateConfig, type AggregateFieldValue, type AggregateResult, type AnyColumn, type BinaryExpression, Brand, type BuildQueryResult, type BuildRelationResult, type ColumnBuilder, type ColumnBuilderBaseConfig, type ColumnBuilderRuntimeConfig, type ColumnBuilderTypeConfig, type ColumnBuilderWithTableName, type ColumnDataType, Columns, type ConvexAggregateIndexBuilder, type ConvexAggregateIndexBuilderOn, type ConvexBigIntBuilder, type ConvexBigIntBuilderInitial, type ConvexBooleanBuilder, type ConvexBooleanBuilderInitial, type ConvexBytesBuilder, type ConvexBytesBuilderInitial, type ConvexCheckBuilder, type ConvexCheckConfig, type ConvexCustomBuilder, type ConvexCustomBuilderInitial, type ConvexDateBuilder, type ConvexDateBuilderInitial, type ConvexDateMode, type ConvexDeletionBuilder, type ConvexDeletionConfig, type ConvexForeignKeyBuilder, type ConvexForeignKeyConfig, type ConvexIdBuilder, type ConvexIdBuilderInitial, type ConvexIndexBuilder, type ConvexIndexBuilderOn, type ConvexNumberBuilder, type ConvexNumberBuilderInitial, type ConvexRankIndexBuilder, type ConvexRankIndexBuilderOn, type ConvexSearchIndexBuilder, type ConvexSearchIndexBuilderOn, type ConvexSearchIndexConfig, type ConvexTable, type ConvexTextBuilder, type ConvexTextBuilderInitial, type ConvexTextEnumBuilder, type ConvexTextEnumBuilderInitial, type ConvexTimestampBuilder, type ConvexTimestampBuilderInitial, type ConvexTimestampMode, type ConvexUniqueConstraintBuilder, type ConvexUniqueConstraintBuilderOn, type ConvexUniqueConstraintConfig, type ConvexVectorBuilder, type ConvexVectorBuilderInitial, type ConvexVectorIndexBuilder, type ConvexVectorIndexBuilderOn, type ConvexVectorIndexConfig, type CountBackfillChunkArgs, type CountBackfillKickoffArgs, type CountBackfillStatusArgs, type CountConfig, type CountResult, type CreateOrmOptions, type DBQueryConfig, type DatabaseWithMutations, type DatabaseWithQuery, type DefineSchemaOptions, type DocByCtx, type DrizzleEntity, type EdgeMetadata, type ExpressionVisitor, type ExtractTablesWithRelations, type FieldReference, type FilterExpression, type FilterOperators, type GenericOrm, type GenericOrmCtx, type GenericSchema, type GetColumnData, type HasDefault, type InferInsertModel, type InferModelFromColumns, type InferSelectModel, type InsertValue, type IsPrimaryKey, type IsUnique, type LogicalExpression, type LookupByIdResultByCtx, type ManyConfig, type MutationExecuteConfig, type MutationExecuteResult, type MutationExecutionMode, type MutationPaginateConfig, type MutationPaginatedResult, type MutationResult, type MutationReturning, type MutationRunMode, type NotNull, type OneConfig, type OrderByClause, type OrderDirection, type OrmApiResult, type OrmBeforeResult, type OrmClientBase, type OrmClientWithApi, type OrmFunctions, type OrmLifecycleChange, type OrmLifecycleOperation, OrmNotFoundError, type OrmReader, type OrmReaderCtx, type OrmTableTriggers, type OrmTriggerChange, type OrmTriggerContext, type OrmTriggers, type OrmWriter, type OrmWriterCtx, type PaginatedResult, type PredicateWhereIndexConfig, type QueryCtxWithOptionalOrmQueryTable, type QueryCtxWithOrmQueryTable, type QueryCtxWithPreferredOrmQueryTable, type RelationsBuilder, type RelationsBuilderColumnBase, type RelationsBuilderColumnConfig, type ReturningAll, type ReturningResult, type ReturningSelection, type RlsContext, type RlsMode, RlsPolicy, type RlsPolicyConfig, type RlsPolicyToOption, RlsRole, type RlsRoleConfig, type ScheduledDeleteArgs, type ScheduledMutationBatchArgs, type SchemaDefinition, type SystemFields, type TableConfig, type TableConfigResult, TableName, type TableRelationalConfig, type TablesRelationalConfig, type UnaryExpression, type UpdateSet, type VectorQueryConfig, type VectorSearchProvider, type WhereClauseResult, aggregateIndex, and, asc, between, bigint, boolean, bytes, check, contains, convexTable, createOrm, custom, date, defineRelations, defineRelationsPart, defineSchema, defineTriggers, deletion, desc, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getByIdWithOrmQueryFallback, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, or, rankIndex, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|
|
5
|
+
export { type AggregateConfig, type AggregateFieldValue, type AggregateResult, type AnyColumn, type BinaryExpression, Brand, type BuildQueryResult, type BuildRelationResult, type ColumnBuilder, type ColumnBuilderBaseConfig, type ColumnBuilderRuntimeConfig, type ColumnBuilderTypeConfig, type ColumnBuilderWithTableName, type ColumnDataType, Columns, type ConvexAggregateIndexBuilder, type ConvexAggregateIndexBuilderOn, type ConvexBigIntBuilder, type ConvexBigIntBuilderInitial, type ConvexBooleanBuilder, type ConvexBooleanBuilderInitial, type ConvexBytesBuilder, type ConvexBytesBuilderInitial, type ConvexCheckBuilder, type ConvexCheckConfig, type ConvexCustomBuilder, type ConvexCustomBuilderInitial, type ConvexDateBuilder, type ConvexDateBuilderInitial, type ConvexDateMode, type ConvexDeletionBuilder, type ConvexDeletionConfig, type ConvexForeignKeyBuilder, type ConvexForeignKeyConfig, type ConvexIdBuilder, type ConvexIdBuilderInitial, type ConvexIndexBuilder, type ConvexIndexBuilderOn, type ConvexNumberBuilder, type ConvexNumberBuilderInitial, type ConvexRankIndexBuilder, type ConvexRankIndexBuilderOn, type ConvexSearchIndexBuilder, type ConvexSearchIndexBuilderOn, type ConvexSearchIndexConfig, type ConvexTable, type ConvexTextBuilder, type ConvexTextBuilderInitial, type ConvexTextEnumBuilder, type ConvexTextEnumBuilderInitial, type ConvexTimestampBuilder, type ConvexTimestampBuilderInitial, type ConvexTimestampMode, type ConvexUniqueConstraintBuilder, type ConvexUniqueConstraintBuilderOn, type ConvexUniqueConstraintConfig, type ConvexVectorBuilder, type ConvexVectorBuilderInitial, type ConvexVectorIndexBuilder, type ConvexVectorIndexBuilderOn, type ConvexVectorIndexConfig, type CountBackfillChunkArgs, type CountBackfillKickoffArgs, type CountBackfillStatusArgs, type CountConfig, type CountResult, type CreateOrmOptions, type DBQueryConfig, type DatabaseWithMutations, type DatabaseWithQuery, type DefineSchemaOptions, type DocByCtx, type DrizzleEntity, type EdgeMetadata, type ExpressionVisitor, type ExtractTablesWithRelations, type FieldReference, type FilterExpression, type FilterOperators, type GenericOrm, type GenericOrmCtx, type GenericSchema, type GetColumnData, type HasDefault, type InferInsertModel, type InferModelFromColumns, type InferSelectModel, type InsertValue, type IsPrimaryKey, type IsUnique, type LogicalExpression, type LookupByIdResultByCtx, type ManyConfig, type MigrationAppliedState, type MigrationCancelArgs, type MigrationDefinition, type MigrationDirection, type MigrationDoc, type MigrationDocContext, type MigrationDriftIssue, type MigrationManifestEntry, type MigrationMigrateOne, type MigrationPlan, type MigrationRunArgs, type MigrationRunChunkArgs, type MigrationRunStatus, type MigrationSet, type MigrationStateMap, type MigrationStatusArgs, type MigrationStep, type MigrationTableName, type MigrationWriteMode, type MutationExecuteConfig, type MutationExecuteResult, type MutationExecutionMode, type MutationPaginateConfig, type MutationPaginatedResult, type MutationResult, type MutationReturning, type MutationRunMode, type NotNull, type OneConfig, type OrderByClause, type OrderDirection, type OrmApiResult, type OrmBeforeResult, type OrmClientBase, type OrmClientWithApi, type OrmFunctions, type OrmLifecycleChange, type OrmLifecycleOperation, OrmNotFoundError, type OrmReader, type OrmReaderCtx, type OrmTableTriggers, type OrmTriggerChange, type OrmTriggerContext, type OrmTriggers, type OrmWriter, type OrmWriterCtx, type PaginatedResult, type PredicateWhereIndexConfig, type QueryCtxWithOptionalOrmQueryTable, type QueryCtxWithOrmQueryTable, type QueryCtxWithPreferredOrmQueryTable, type RelationsBuilder, type RelationsBuilderColumnBase, type RelationsBuilderColumnConfig, type ReturningAll, type ReturningResult, type ReturningSelection, type RlsContext, type RlsMode, RlsPolicy, type RlsPolicyConfig, type RlsPolicyToOption, RlsRole, type RlsRoleConfig, type ScheduledDeleteArgs, type ScheduledMutationBatchArgs, type SchemaDefinition, type SystemFields, type TableConfig, type TableConfigResult, TableName, type TableRelationalConfig, type TablesRelationalConfig, type UnaryExpression, type UpdateSet, type VectorQueryConfig, type VectorSearchProvider, type WhereClauseResult, aggregateIndex, and, asc, between, bigint, boolean, buildMigrationPlan, bytes, check, contains, convexTable, createOrm, custom, date, defineMigration, defineMigrationSet, defineRelations, defineRelationsPart, defineSchema, defineTriggers, deletion, deprecated, desc, detectMigrationDrift, endsWith, eq, extractRelationsConfig, fieldRef, foreignKey, getByIdWithOrmQueryFallback, getTableColumns, getTableConfig, gt, gte, id, ilike, inArray, index, integer, isFieldReference, isNotNull, isNull, json, like, lt, lte, ne, not, notBetween, notInArray, or, pretend, pretendRequired, rankIndex, rlsPolicy, rlsRole, scheduledDeleteFactory, scheduledMutationBatchFactory, searchIndex, startsWith, text, textEnum, timestamp, unique, uniqueIndex, unsetToken, vector, vectorIndex };
|