diff --git a/db/migrations/902-rework_clauses.sql b/db/migrations/902-rework_clauses.sql index 099c59bf..85611459 100644 --- a/db/migrations/902-rework_clauses.sql +++ b/db/migrations/902-rework_clauses.sql @@ -3,6 +3,7 @@ CREATE TABLE clause_v2 ( id text NOT NULL PRIMARY KEY ,key text NOT NULL ,value text NOT NULL + ,position int ,udap_id text ,text text NOT NULL ); diff --git a/packages/backend/src/tmp.ts b/packages/backend/src/tmp.ts index 6b11a666..c5772b36 100644 --- a/packages/backend/src/tmp.ts +++ b/packages/backend/src/tmp.ts @@ -1,5 +1,6 @@ import { db } from "./db/db"; import { v4 } from "uuid"; +import { groupBy } from "pastable"; export const initClauseV2 = async () => { const nbClausesV2 = await db.clause_v2.count(); @@ -7,16 +8,22 @@ export const initClauseV2 = async () => { const clauses = await db.clause.findMany(); - for (const clause of clauses) { - await db.clause_v2.create({ - data: { - id: v4(), - key: clause.key, - text: clause.text, - value: clause.value, - udap_id: clause.udap_id, - }, - }); + const grouped = groupBy(clauses, (clause) => `${clause.udap_id}-${clause.key}`); + + for (const clausesToAdd of Object.values(grouped)) { + for (let i = 0; i < clausesToAdd.length; i++) { + const clause = clausesToAdd[i]!; + await db.clause_v2.create({ + data: { + id: v4(), + key: clause.key, + text: clause.text, + value: clause.value, + position: i, + udap_id: clause.udap_id, + }, + }); + } } return "done"; diff --git a/packages/electric-client/prisma/schema.prisma b/packages/electric-client/prisma/schema.prisma index c9f446e1..6fa911b2 100644 --- a/packages/electric-client/prisma/schema.prisma +++ b/packages/electric-client/prisma/schema.prisma @@ -124,9 +124,10 @@ model service_instructeurs { } model clause_v2 { - id String @id - key String - value String - udap_id String? - text String + id String @id + key String + value String + position Int? + udap_id String? + text String } diff --git a/packages/electric-client/src/generated/client/index.ts b/packages/electric-client/src/generated/client/index.ts index 7309176e..d98678e8 100644 --- a/packages/electric-client/src/generated/client/index.ts +++ b/packages/electric-client/src/generated/client/index.ts @@ -15,7 +15,7 @@ import pgMigrations from './pg-migrations'; export const ClauseScalarFieldEnumSchema = z.enum(['key','value','udap_id','text','hidden']); -export const Clause_v2ScalarFieldEnumSchema = z.enum(['id','key','value','udap_id','text']); +export const Clause_v2ScalarFieldEnumSchema = z.enum(['id','key','value','position','udap_id','text']); export const DelegationScalarFieldEnumSchema = z.enum(['createdBy','delegatedTo']); @@ -58,6 +58,7 @@ export const Clause_v2Schema = z.object({ id: z.string(), key: z.string(), value: z.string(), + position: z.number().int().gte(-2147483648).lte(2147483647).nullable(), udap_id: z.string().nullable(), text: z.string(), }) @@ -176,6 +177,7 @@ export const Clause_v2SelectSchema: z.ZodType = z.object id: z.boolean().optional(), key: z.boolean().optional(), value: z.boolean().optional(), + position: z.boolean().optional(), udap_id: z.boolean().optional(), text: z.boolean().optional(), }).strict() @@ -382,6 +384,7 @@ export const Clause_v2WhereInputSchema: z.ZodType = id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), key: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), value: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + position: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), udap_id: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), text: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), }).strict(); @@ -390,6 +393,7 @@ export const Clause_v2OrderByWithRelationInputSchema: z.ZodType SortOrderSchema).optional(), key: z.lazy(() => SortOrderSchema).optional(), value: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), udap_id: z.lazy(() => SortOrderSchema).optional(), text: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -402,11 +406,14 @@ export const Clause_v2OrderByWithAggregationInputSchema: z.ZodType SortOrderSchema).optional(), key: z.lazy(() => SortOrderSchema).optional(), value: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), udap_id: z.lazy(() => SortOrderSchema).optional(), text: z.lazy(() => SortOrderSchema).optional(), _count: z.lazy(() => Clause_v2CountOrderByAggregateInputSchema).optional(), + _avg: z.lazy(() => Clause_v2AvgOrderByAggregateInputSchema).optional(), _max: z.lazy(() => Clause_v2MaxOrderByAggregateInputSchema).optional(), - _min: z.lazy(() => Clause_v2MinOrderByAggregateInputSchema).optional() + _min: z.lazy(() => Clause_v2MinOrderByAggregateInputSchema).optional(), + _sum: z.lazy(() => Clause_v2SumOrderByAggregateInputSchema).optional() }).strict(); export const Clause_v2ScalarWhereWithAggregatesInputSchema: z.ZodType = z.object({ @@ -416,6 +423,7 @@ export const Clause_v2ScalarWhereWithAggregatesInputSchema: z.ZodType StringWithAggregatesFilterSchema),z.string() ]).optional(), key: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), value: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + position: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), udap_id: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), text: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), }).strict(); @@ -805,6 +813,7 @@ export const Clause_v2CreateInputSchema: z.ZodType id: z.string(), key: z.string(), value: z.string(), + position: z.number().int().gte(-2147483648).lte(2147483647).optional().nullable(), udap_id: z.string().optional().nullable(), text: z.string() }).strict(); @@ -813,6 +822,7 @@ export const Clause_v2UncheckedCreateInputSchema: z.ZodType id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), key: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), value: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + position: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), text: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); @@ -829,6 +840,7 @@ export const Clause_v2UncheckedUpdateInputSchema: z.ZodType StringFieldUpdateOperationsInputSchema) ]).optional(), key: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), value: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + position: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), text: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); @@ -837,6 +849,7 @@ export const Clause_v2CreateManyInputSchema: z.ZodType StringFieldUpdateOperationsInputSchema) ]).optional(), key: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), value: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + position: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), text: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); @@ -853,6 +867,7 @@ export const Clause_v2UncheckedUpdateManyInputSchema: z.ZodType StringFieldUpdateOperationsInputSchema) ]).optional(), key: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), value: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + position: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), text: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); @@ -1365,6 +1380,17 @@ export const BoolNullableWithAggregatesFilterSchema: z.ZodType NestedBoolNullableFilterSchema).optional() }).strict(); +export const IntNullableFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntNullableFilterSchema) ]).optional().nullable(), +}).strict(); + export const StringNullableFilterSchema: z.ZodType = z.object({ equals: z.string().optional().nullable(), in: z.string().array().optional().nullable(), @@ -1384,14 +1410,20 @@ export const Clause_v2CountOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), key: z.lazy(() => SortOrderSchema).optional(), value: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), udap_id: z.lazy(() => SortOrderSchema).optional(), text: z.lazy(() => SortOrderSchema).optional() }).strict(); +export const Clause_v2AvgOrderByAggregateInputSchema: z.ZodType = z.object({ + position: z.lazy(() => SortOrderSchema).optional() +}).strict(); + export const Clause_v2MaxOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), key: z.lazy(() => SortOrderSchema).optional(), value: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), udap_id: z.lazy(() => SortOrderSchema).optional(), text: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -1400,10 +1432,31 @@ export const Clause_v2MinOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), key: z.lazy(() => SortOrderSchema).optional(), value: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), udap_id: z.lazy(() => SortOrderSchema).optional(), text: z.lazy(() => SortOrderSchema).optional() }).strict(); +export const Clause_v2SumOrderByAggregateInputSchema: z.ZodType = z.object({ + position: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const IntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedIntNullableFilterSchema).optional() +}).strict(); + export const StringNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.string().optional().nullable(), in: z.string().array().optional().nullable(), @@ -1469,17 +1522,6 @@ export const DateTimeFilterSchema: z.ZodType = z.object({ not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeFilterSchema) ]).optional(), }).strict(); -export const IntNullableFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntNullableFilterSchema) ]).optional().nullable(), -}).strict(); - export const ReportCountOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), title: z.lazy(() => SortOrderSchema).optional(), @@ -1588,22 +1630,6 @@ export const DateTimeWithAggregatesFilterSchema: z.ZodType NestedDateTimeFilterSchema).optional() }).strict(); -export const IntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), - _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _max: z.lazy(() => NestedIntNullableFilterSchema).optional() -}).strict(); - export const IntFilterSchema: z.ZodType = z.object({ equals: z.number().optional(), in: z.number().array().optional(), @@ -1775,6 +1801,14 @@ export const NullableBoolFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.number().optional().nullable(), + increment: z.number().optional(), + decrement: z.number().optional(), + multiply: z.number().optional(), + divide: z.number().optional() +}).strict(); + export const NullableStringFieldUpdateOperationsInputSchema: z.ZodType = z.object({ set: z.string().optional().nullable() }).strict(); @@ -1821,14 +1855,6 @@ export const DateTimeFieldUpdateOperationsInputSchema: z.ZodType = z.object({ - set: z.number().optional().nullable(), - increment: z.number().optional(), - decrement: z.number().optional(), - multiply: z.number().optional(), - divide: z.number().optional() -}).strict(); - export const UserUpdateOneRequiredWithoutReportNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => UserCreateWithoutReportInputSchema),z.lazy(() => UserUncheckedCreateWithoutReportInputSchema) ]).optional(), connectOrCreate: z.lazy(() => UserCreateOrConnectWithoutReportInputSchema).optional(), @@ -2107,6 +2133,33 @@ export const NestedStringNullableFilterSchema: z.ZodType NestedStringNullableFilterSchema) ]).optional().nullable(), }).strict(); +export const NestedIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedIntNullableFilterSchema).optional() +}).strict(); + +export const NestedFloatNullableFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedFloatNullableFilterSchema) ]).optional().nullable(), +}).strict(); + export const NestedStringNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.string().optional().nullable(), in: z.string().array().optional().nullable(), @@ -2174,33 +2227,6 @@ export const NestedDateTimeWithAggregatesFilterSchema: z.ZodType NestedDateTimeFilterSchema).optional() }).strict(); -export const NestedIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), - _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _max: z.lazy(() => NestedIntNullableFilterSchema).optional() -}).strict(); - -export const NestedFloatNullableFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedFloatNullableFilterSchema) ]).optional().nullable(), -}).strict(); - export const NestedIntWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.number().optional(), in: z.number().array().optional(), @@ -3601,6 +3627,10 @@ export const tableSchemas = { "value", "TEXT" ], + [ + "position", + "INT4" + ], [ "udap_id", "TEXT" diff --git a/packages/electric-client/src/generated/client/migrations.ts b/packages/electric-client/src/generated/client/migrations.ts index 720ae3a1..a72a1516 100644 --- a/packages/electric-client/src/generated/client/migrations.ts +++ b/packages/electric-client/src/generated/client/migrations.ts @@ -135,16 +135,16 @@ export default [ }, { "statements": [ - "CREATE TABLE \"clause_v2\" (\n \"id\" TEXT NOT NULL,\n \"key\" TEXT NOT NULL,\n \"value\" TEXT NOT NULL,\n \"udap_id\" TEXT,\n \"text\" TEXT NOT NULL,\n CONSTRAINT \"clause_v2_pkey\" PRIMARY KEY (\"id\")\n) WITHOUT ROWID;\n", + "CREATE TABLE \"clause_v2\" (\n \"id\" TEXT NOT NULL,\n \"key\" TEXT NOT NULL,\n \"value\" TEXT NOT NULL,\n \"position\" INTEGER,\n \"udap_id\" TEXT,\n \"text\" TEXT NOT NULL,\n CONSTRAINT \"clause_v2_pkey\" PRIMARY KEY (\"id\")\n) WITHOUT ROWID;\n", "INSERT OR IGNORE INTO _electric_trigger_settings (namespace, tablename, flag) VALUES ('main', 'clause_v2', 1);", "DROP TRIGGER IF EXISTS update_ensure_main_clause_v2_primarykey;", "CREATE TRIGGER update_ensure_main_clause_v2_primarykey\n BEFORE UPDATE ON \"main\".\"clause_v2\"\nBEGIN\n SELECT\n CASE\n WHEN old.\"id\" != new.\"id\" THEN\n \t\tRAISE (ABORT, 'cannot change the value of column id as it belongs to the primary key')\n END;\nEND;", "DROP TRIGGER IF EXISTS insert_main_clause_v2_into_oplog;", - "CREATE TRIGGER insert_main_clause_v2_into_oplog\n AFTER INSERT ON \"main\".\"clause_v2\"\n WHEN 1 = (SELECT flag from _electric_trigger_settings WHERE namespace = 'main' AND tablename = 'clause_v2')\nBEGIN\n INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp)\n VALUES ('main', 'clause_v2', 'INSERT', json_patch('{}', json_object('id', new.\"id\")), json_object('id', new.\"id\", 'key', new.\"key\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"), NULL, NULL);\nEND;", + "CREATE TRIGGER insert_main_clause_v2_into_oplog\n AFTER INSERT ON \"main\".\"clause_v2\"\n WHEN 1 = (SELECT flag from _electric_trigger_settings WHERE namespace = 'main' AND tablename = 'clause_v2')\nBEGIN\n INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp)\n VALUES ('main', 'clause_v2', 'INSERT', json_patch('{}', json_object('id', new.\"id\")), json_object('id', new.\"id\", 'key', new.\"key\", 'position', new.\"position\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"), NULL, NULL);\nEND;", "DROP TRIGGER IF EXISTS update_main_clause_v2_into_oplog;", - "CREATE TRIGGER update_main_clause_v2_into_oplog\n AFTER UPDATE ON \"main\".\"clause_v2\"\n WHEN 1 = (SELECT flag from _electric_trigger_settings WHERE namespace = 'main' AND tablename = 'clause_v2')\nBEGIN\n INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp)\n VALUES ('main', 'clause_v2', 'UPDATE', json_patch('{}', json_object('id', new.\"id\")), json_object('id', new.\"id\", 'key', new.\"key\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"), json_object('id', old.\"id\", 'key', old.\"key\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"), NULL);\nEND;", + "CREATE TRIGGER update_main_clause_v2_into_oplog\n AFTER UPDATE ON \"main\".\"clause_v2\"\n WHEN 1 = (SELECT flag from _electric_trigger_settings WHERE namespace = 'main' AND tablename = 'clause_v2')\nBEGIN\n INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp)\n VALUES ('main', 'clause_v2', 'UPDATE', json_patch('{}', json_object('id', new.\"id\")), json_object('id', new.\"id\", 'key', new.\"key\", 'position', new.\"position\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"), json_object('id', old.\"id\", 'key', old.\"key\", 'position', old.\"position\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"), NULL);\nEND;", "DROP TRIGGER IF EXISTS delete_main_clause_v2_into_oplog;", - "CREATE TRIGGER delete_main_clause_v2_into_oplog\n AFTER DELETE ON \"main\".\"clause_v2\"\n WHEN 1 = (SELECT flag from _electric_trigger_settings WHERE namespace = 'main' AND tablename = 'clause_v2')\nBEGIN\n INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp)\n VALUES ('main', 'clause_v2', 'DELETE', json_patch('{}', json_object('id', old.\"id\")), NULL, json_object('id', old.\"id\", 'key', old.\"key\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"), NULL);\nEND;" + "CREATE TRIGGER delete_main_clause_v2_into_oplog\n AFTER DELETE ON \"main\".\"clause_v2\"\n WHEN 1 = (SELECT flag from _electric_trigger_settings WHERE namespace = 'main' AND tablename = 'clause_v2')\nBEGIN\n INSERT INTO _electric_oplog (namespace, tablename, optype, primaryKey, newRow, oldRow, timestamp)\n VALUES ('main', 'clause_v2', 'DELETE', json_patch('{}', json_object('id', old.\"id\")), NULL, json_object('id', old.\"id\", 'key', old.\"key\", 'position', old.\"position\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"), NULL);\nEND;" ], "version": "902" } diff --git a/packages/electric-client/src/generated/client/pg-migrations.ts b/packages/electric-client/src/generated/client/pg-migrations.ts index ddbe24c5..dfba45ec 100644 --- a/packages/electric-client/src/generated/client/pg-migrations.ts +++ b/packages/electric-client/src/generated/client/pg-migrations.ts @@ -179,19 +179,19 @@ export default [ }, { "statements": [ - "CREATE TABLE clause_v2 (\n id text NOT NULL,\n key text NOT NULL,\n value text NOT NULL,\n udap_id text,\n text text NOT NULL,\n CONSTRAINT clause_v2_pkey PRIMARY KEY (id)\n)", + "CREATE TABLE clause_v2 (\n id text NOT NULL,\n key text NOT NULL,\n value text NOT NULL,\n \"position\" integer,\n udap_id text,\n text text NOT NULL,\n CONSTRAINT clause_v2_pkey PRIMARY KEY (id)\n)", "INSERT INTO \"public\".\"_electric_trigger_settings\" (\"namespace\", \"tablename\", \"flag\")\n VALUES ('public', 'clause_v2', 1)\n ON CONFLICT DO NOTHING;", "DROP TRIGGER IF EXISTS update_ensure_public_clause_v2_primarykey ON \"public\".\"clause_v2\";", "CREATE OR REPLACE FUNCTION update_ensure_public_clause_v2_primarykey_function()\nRETURNS TRIGGER AS $$\nBEGIN\n IF OLD.\"id\" IS DISTINCT FROM NEW.\"id\" THEN\n RAISE EXCEPTION 'Cannot change the value of column id as it belongs to the primary key';\n END IF;\n RETURN NEW;\nEND;\n$$ LANGUAGE plpgsql;", "CREATE TRIGGER update_ensure_public_clause_v2_primarykey\n BEFORE UPDATE ON \"public\".\"clause_v2\"\n FOR EACH ROW\n EXECUTE FUNCTION update_ensure_public_clause_v2_primarykey_function();", "DROP TRIGGER IF EXISTS insert_public_clause_v2_into_oplog ON \"public\".\"clause_v2\";", - " CREATE OR REPLACE FUNCTION insert_public_clause_v2_into_oplog_function()\n RETURNS TRIGGER AS $$\n BEGIN\n DECLARE\n flag_value INTEGER;\n BEGIN\n -- Get the flag value from _electric_trigger_settings\n SELECT flag INTO flag_value FROM \"public\"._electric_trigger_settings WHERE namespace = 'public' AND tablename = 'clause_v2';\n\n IF flag_value = 1 THEN\n -- Insert into _electric_oplog\n INSERT INTO \"public\"._electric_oplog (namespace, tablename, optype, \"primaryKey\", \"newRow\", \"oldRow\", timestamp)\n VALUES (\n 'public',\n 'clause_v2',\n 'INSERT',\n json_strip_nulls(json_build_object('id', new.\"id\")),\n jsonb_build_object('id', new.\"id\", 'key', new.\"key\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"),\n NULL,\n NULL\n );\n END IF;\n\n RETURN NEW;\n END;\n END;\n $$ LANGUAGE plpgsql;", + " CREATE OR REPLACE FUNCTION insert_public_clause_v2_into_oplog_function()\n RETURNS TRIGGER AS $$\n BEGIN\n DECLARE\n flag_value INTEGER;\n BEGIN\n -- Get the flag value from _electric_trigger_settings\n SELECT flag INTO flag_value FROM \"public\"._electric_trigger_settings WHERE namespace = 'public' AND tablename = 'clause_v2';\n\n IF flag_value = 1 THEN\n -- Insert into _electric_oplog\n INSERT INTO \"public\"._electric_oplog (namespace, tablename, optype, \"primaryKey\", \"newRow\", \"oldRow\", timestamp)\n VALUES (\n 'public',\n 'clause_v2',\n 'INSERT',\n json_strip_nulls(json_build_object('id', new.\"id\")),\n jsonb_build_object('id', new.\"id\", 'key', new.\"key\", 'position', new.\"position\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"),\n NULL,\n NULL\n );\n END IF;\n\n RETURN NEW;\n END;\n END;\n $$ LANGUAGE plpgsql;", "CREATE TRIGGER insert_public_clause_v2_into_oplog\n AFTER INSERT ON \"public\".\"clause_v2\"\n FOR EACH ROW\n EXECUTE FUNCTION insert_public_clause_v2_into_oplog_function();", "DROP TRIGGER IF EXISTS update_public_clause_v2_into_oplog ON \"public\".\"clause_v2\";", - " CREATE OR REPLACE FUNCTION update_public_clause_v2_into_oplog_function()\n RETURNS TRIGGER AS $$\n BEGIN\n DECLARE\n flag_value INTEGER;\n BEGIN\n -- Get the flag value from _electric_trigger_settings\n SELECT flag INTO flag_value FROM \"public\"._electric_trigger_settings WHERE namespace = 'public' AND tablename = 'clause_v2';\n\n IF flag_value = 1 THEN\n -- Insert into _electric_oplog\n INSERT INTO \"public\"._electric_oplog (namespace, tablename, optype, \"primaryKey\", \"newRow\", \"oldRow\", timestamp)\n VALUES (\n 'public',\n 'clause_v2',\n 'UPDATE',\n json_strip_nulls(json_build_object('id', new.\"id\")),\n jsonb_build_object('id', new.\"id\", 'key', new.\"key\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"),\n jsonb_build_object('id', old.\"id\", 'key', old.\"key\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"),\n NULL\n );\n END IF;\n\n RETURN NEW;\n END;\n END;\n $$ LANGUAGE plpgsql;", + " CREATE OR REPLACE FUNCTION update_public_clause_v2_into_oplog_function()\n RETURNS TRIGGER AS $$\n BEGIN\n DECLARE\n flag_value INTEGER;\n BEGIN\n -- Get the flag value from _electric_trigger_settings\n SELECT flag INTO flag_value FROM \"public\"._electric_trigger_settings WHERE namespace = 'public' AND tablename = 'clause_v2';\n\n IF flag_value = 1 THEN\n -- Insert into _electric_oplog\n INSERT INTO \"public\"._electric_oplog (namespace, tablename, optype, \"primaryKey\", \"newRow\", \"oldRow\", timestamp)\n VALUES (\n 'public',\n 'clause_v2',\n 'UPDATE',\n json_strip_nulls(json_build_object('id', new.\"id\")),\n jsonb_build_object('id', new.\"id\", 'key', new.\"key\", 'position', new.\"position\", 'text', new.\"text\", 'udap_id', new.\"udap_id\", 'value', new.\"value\"),\n jsonb_build_object('id', old.\"id\", 'key', old.\"key\", 'position', old.\"position\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"),\n NULL\n );\n END IF;\n\n RETURN NEW;\n END;\n END;\n $$ LANGUAGE plpgsql;", "CREATE TRIGGER update_public_clause_v2_into_oplog\n AFTER UPDATE ON \"public\".\"clause_v2\"\n FOR EACH ROW\n EXECUTE FUNCTION update_public_clause_v2_into_oplog_function();", "DROP TRIGGER IF EXISTS delete_public_clause_v2_into_oplog ON \"public\".\"clause_v2\";", - " CREATE OR REPLACE FUNCTION delete_public_clause_v2_into_oplog_function()\n RETURNS TRIGGER AS $$\n BEGIN\n DECLARE\n flag_value INTEGER;\n BEGIN\n -- Get the flag value from _electric_trigger_settings\n SELECT flag INTO flag_value FROM \"public\"._electric_trigger_settings WHERE namespace = 'public' AND tablename = 'clause_v2';\n\n IF flag_value = 1 THEN\n -- Insert into _electric_oplog\n INSERT INTO \"public\"._electric_oplog (namespace, tablename, optype, \"primaryKey\", \"newRow\", \"oldRow\", timestamp)\n VALUES (\n 'public',\n 'clause_v2',\n 'DELETE',\n json_strip_nulls(json_build_object('id', old.\"id\")),\n NULL,\n jsonb_build_object('id', old.\"id\", 'key', old.\"key\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"),\n NULL\n );\n END IF;\n\n RETURN NEW;\n END;\n END;\n $$ LANGUAGE plpgsql;", + " CREATE OR REPLACE FUNCTION delete_public_clause_v2_into_oplog_function()\n RETURNS TRIGGER AS $$\n BEGIN\n DECLARE\n flag_value INTEGER;\n BEGIN\n -- Get the flag value from _electric_trigger_settings\n SELECT flag INTO flag_value FROM \"public\"._electric_trigger_settings WHERE namespace = 'public' AND tablename = 'clause_v2';\n\n IF flag_value = 1 THEN\n -- Insert into _electric_oplog\n INSERT INTO \"public\"._electric_oplog (namespace, tablename, optype, \"primaryKey\", \"newRow\", \"oldRow\", timestamp)\n VALUES (\n 'public',\n 'clause_v2',\n 'DELETE',\n json_strip_nulls(json_build_object('id', old.\"id\")),\n NULL,\n jsonb_build_object('id', old.\"id\", 'key', old.\"key\", 'position', old.\"position\", 'text', old.\"text\", 'udap_id', old.\"udap_id\", 'value', old.\"value\"),\n NULL\n );\n END IF;\n\n RETURN NEW;\n END;\n END;\n $$ LANGUAGE plpgsql;", "CREATE TRIGGER delete_public_clause_v2_into_oplog\n AFTER DELETE ON \"public\".\"clause_v2\"\n FOR EACH ROW\n EXECUTE FUNCTION delete_public_clause_v2_into_oplog_function();" ], "version": "902" diff --git a/packages/electric-client/src/generated/client/prismaClient.d.ts b/packages/electric-client/src/generated/client/prismaClient.d.ts index 3c8504d4..4a14a404 100644 --- a/packages/electric-client/src/generated/client/prismaClient.d.ts +++ b/packages/electric-client/src/generated/client/prismaClient.d.ts @@ -37,6 +37,10 @@ export type Clause_v2Payload @@ -2491,14 +2495,25 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject export type AggregateClause_v2 = { _count: Clause_v2CountAggregateOutputType | null + _avg: Clause_v2AvgAggregateOutputType | null + _sum: Clause_v2SumAggregateOutputType | null _min: Clause_v2MinAggregateOutputType | null _max: Clause_v2MaxAggregateOutputType | null } + export type Clause_v2AvgAggregateOutputType = { + position: number | null + } + + export type Clause_v2SumAggregateOutputType = { + position: number | null + } + export type Clause_v2MinAggregateOutputType = { id: string | null key: string | null value: string | null + position: number | null udap_id: string | null text: string | null } @@ -2507,6 +2522,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id: string | null key: string | null value: string | null + position: number | null udap_id: string | null text: string | null } @@ -2515,16 +2531,26 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id: number key: number value: number + position: number udap_id: number text: number _all: number } + export type Clause_v2AvgAggregateInputType = { + position?: true + } + + export type Clause_v2SumAggregateInputType = { + position?: true + } + export type Clause_v2MinAggregateInputType = { id?: true key?: true value?: true + position?: true udap_id?: true text?: true } @@ -2533,6 +2559,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: true key?: true value?: true + position?: true udap_id?: true text?: true } @@ -2541,6 +2568,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: true key?: true value?: true + position?: true udap_id?: true text?: true _all?: true @@ -2581,6 +2609,18 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject * Count returned Clause_v2s **/ _count?: true | Clause_v2CountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: Clause_v2AvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: Clause_v2SumAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * @@ -2614,6 +2654,8 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject take?: number skip?: number _count?: Clause_v2CountAggregateInputType | true + _avg?: Clause_v2AvgAggregateInputType + _sum?: Clause_v2SumAggregateInputType _min?: Clause_v2MinAggregateInputType _max?: Clause_v2MaxAggregateInputType } @@ -2623,9 +2665,12 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id: string key: string value: string + position: number | null udap_id: string | null text: string _count: Clause_v2CountAggregateOutputType | null + _avg: Clause_v2AvgAggregateOutputType | null + _sum: Clause_v2SumAggregateOutputType | null _min: Clause_v2MinAggregateOutputType | null _max: Clause_v2MaxAggregateOutputType | null } @@ -2648,6 +2693,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: boolean key?: boolean value?: boolean + position?: boolean udap_id?: boolean text?: boolean }, ExtArgs["result"]["clause_v2"]> @@ -2656,6 +2702,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: boolean key?: boolean value?: boolean + position?: boolean udap_id?: boolean text?: boolean } @@ -8317,6 +8364,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id: 'id', key: 'key', value: 'value', + position: 'position', udap_id: 'udap_id', text: 'text' }; @@ -8480,6 +8528,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: StringFilter | string key?: StringFilter | string value?: StringFilter | string + position?: IntNullableFilter | number | null udap_id?: StringNullableFilter | string | null text?: StringFilter | string } @@ -8488,6 +8537,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: SortOrder key?: SortOrder value?: SortOrder + position?: SortOrderInput | SortOrder udap_id?: SortOrderInput | SortOrder text?: SortOrder } @@ -8500,11 +8550,14 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: SortOrder key?: SortOrder value?: SortOrder + position?: SortOrderInput | SortOrder udap_id?: SortOrderInput | SortOrder text?: SortOrder _count?: Clause_v2CountOrderByAggregateInput + _avg?: Clause_v2AvgOrderByAggregateInput _max?: Clause_v2MaxOrderByAggregateInput _min?: Clause_v2MinOrderByAggregateInput + _sum?: Clause_v2SumOrderByAggregateInput } export type Clause_v2ScalarWhereWithAggregatesInput = { @@ -8514,6 +8567,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: StringWithAggregatesFilter | string key?: StringWithAggregatesFilter | string value?: StringWithAggregatesFilter | string + position?: IntNullableWithAggregatesFilter | number | null udap_id?: StringNullableWithAggregatesFilter | string | null text?: StringWithAggregatesFilter | string } @@ -8903,6 +8957,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id: string key: string value: string + position?: number | null udap_id?: string | null text: string } @@ -8911,6 +8966,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id: string key: string value: string + position?: number | null udap_id?: string | null text: string } @@ -8919,6 +8975,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: StringFieldUpdateOperationsInput | string key?: StringFieldUpdateOperationsInput | string value?: StringFieldUpdateOperationsInput | string + position?: NullableIntFieldUpdateOperationsInput | number | null udap_id?: NullableStringFieldUpdateOperationsInput | string | null text?: StringFieldUpdateOperationsInput | string } @@ -8927,6 +8984,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: StringFieldUpdateOperationsInput | string key?: StringFieldUpdateOperationsInput | string value?: StringFieldUpdateOperationsInput | string + position?: NullableIntFieldUpdateOperationsInput | number | null udap_id?: NullableStringFieldUpdateOperationsInput | string | null text?: StringFieldUpdateOperationsInput | string } @@ -8935,6 +8993,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id: string key: string value: string + position?: number | null udap_id?: string | null text: string } @@ -8943,6 +9002,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: StringFieldUpdateOperationsInput | string key?: StringFieldUpdateOperationsInput | string value?: StringFieldUpdateOperationsInput | string + position?: NullableIntFieldUpdateOperationsInput | number | null udap_id?: NullableStringFieldUpdateOperationsInput | string | null text?: StringFieldUpdateOperationsInput | string } @@ -8951,6 +9011,7 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: StringFieldUpdateOperationsInput | string key?: StringFieldUpdateOperationsInput | string value?: StringFieldUpdateOperationsInput | string + position?: NullableIntFieldUpdateOperationsInput | number | null udap_id?: NullableStringFieldUpdateOperationsInput | string | null text?: StringFieldUpdateOperationsInput | string } @@ -9469,6 +9530,17 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject _max?: NestedBoolNullableFilter } + export type IntNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableFilter | number | null + } + export type StringNullableFilter = { equals?: string | null in?: Enumerable | string | null @@ -9488,14 +9560,20 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: SortOrder key?: SortOrder value?: SortOrder + position?: SortOrder udap_id?: SortOrder text?: SortOrder } + export type Clause_v2AvgOrderByAggregateInput = { + position?: SortOrder + } + export type Clause_v2MaxOrderByAggregateInput = { id?: SortOrder key?: SortOrder value?: SortOrder + position?: SortOrder udap_id?: SortOrder text?: SortOrder } @@ -9504,10 +9582,31 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject id?: SortOrder key?: SortOrder value?: SortOrder + position?: SortOrder udap_id?: SortOrder text?: SortOrder } + export type Clause_v2SumOrderByAggregateInput = { + position?: SortOrder + } + + export type IntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + export type StringNullableWithAggregatesFilter = { equals?: string | null in?: Enumerable | string | null @@ -9573,17 +9672,6 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject not?: NestedDateTimeFilter | Date | string } - export type IntNullableFilter = { - equals?: number | null - in?: Enumerable | number | null - notIn?: Enumerable | number | null - lt?: number - lte?: number - gt?: number - gte?: number - not?: NestedIntNullableFilter | number | null - } - export type ReportCountOrderByAggregateInput = { id?: SortOrder title?: SortOrder @@ -9692,22 +9780,6 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject _max?: NestedDateTimeFilter } - export type IntNullableWithAggregatesFilter = { - equals?: number | null - in?: Enumerable | number | null - notIn?: Enumerable | number | null - lt?: number - lte?: number - gt?: number - gte?: number - not?: NestedIntNullableWithAggregatesFilter | number | null - _count?: NestedIntNullableFilter - _avg?: NestedFloatNullableFilter - _sum?: NestedIntNullableFilter - _min?: NestedIntNullableFilter - _max?: NestedIntNullableFilter - } - export type IntFilter = { equals?: number in?: Enumerable | number @@ -9879,6 +9951,14 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject set?: boolean | null } + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + export type NullableStringFieldUpdateOperationsInput = { set?: string | null } @@ -9925,14 +10005,6 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject set?: Date | string } - export type NullableIntFieldUpdateOperationsInput = { - set?: number | null - increment?: number - decrement?: number - multiply?: number - divide?: number - } - export type UserUpdateOneRequiredWithoutReportNestedInput = { create?: XOR connectOrCreate?: UserCreateOrConnectWithoutReportInput @@ -10211,6 +10283,33 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject not?: NestedStringNullableFilter | string | null } + export type NestedIntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + + export type NestedFloatNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableFilter | number | null + } + export type NestedStringNullableWithAggregatesFilter = { equals?: string | null in?: Enumerable | string | null @@ -10278,33 +10377,6 @@ export type InputJsonValue = null | string | number | boolean | InputJsonObject _max?: NestedDateTimeFilter } - export type NestedIntNullableWithAggregatesFilter = { - equals?: number | null - in?: Enumerable | number | null - notIn?: Enumerable | number | null - lt?: number - lte?: number - gt?: number - gte?: number - not?: NestedIntNullableWithAggregatesFilter | number | null - _count?: NestedIntNullableFilter - _avg?: NestedFloatNullableFilter - _sum?: NestedIntNullableFilter - _min?: NestedIntNullableFilter - _max?: NestedIntNullableFilter - } - - export type NestedFloatNullableFilter = { - equals?: number | null - in?: Enumerable | number | null - notIn?: Enumerable | number | null - lt?: number - lte?: number - gt?: number - gte?: number - not?: NestedFloatNullableFilter | number | null - } - export type NestedIntWithAggregatesFilter = { equals?: number in?: Enumerable | number diff --git a/packages/electric-client/src/generated/typebox/clause_v2.ts b/packages/electric-client/src/generated/typebox/clause_v2.ts index 2661453a..4cbb381d 100644 --- a/packages/electric-client/src/generated/typebox/clause_v2.ts +++ b/packages/electric-client/src/generated/typebox/clause_v2.ts @@ -4,6 +4,7 @@ export const clause_v2 = Type.Object({ id: Type.String(), key: Type.String(), value: Type.String(), + position: Type.Optional(Type.Number()), udap_id: Type.Optional(Type.String()), text: Type.String(), }); diff --git a/packages/electric-client/src/generated/typebox/clause_v2Input.ts b/packages/electric-client/src/generated/typebox/clause_v2Input.ts index 816c4c51..09c23d9f 100644 --- a/packages/electric-client/src/generated/typebox/clause_v2Input.ts +++ b/packages/electric-client/src/generated/typebox/clause_v2Input.ts @@ -4,6 +4,7 @@ export const clause_v2Input = Type.Object({ id: Type.String(), key: Type.String(), value: Type.String(), + position: Type.Optional(Type.Number()), udap_id: Type.Optional(Type.String()), text: Type.String(), });