@eventualize/postgres-storage-adapter 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/EvDbPostgresPrismaClientFactory.d.ts +5 -1
  2. package/dist/EvDbPostgresPrismaClientFactory.js +10 -3
  3. package/dist/EvDbPostgresPrismaClientFactory.js.map +1 -1
  4. package/dist/generated/prisma/internal/class.js +6 -5
  5. package/dist/generated/prisma/internal/class.js.map +1 -1
  6. package/dist/generated/prisma/internal/prismaNamespace.d.ts +2 -2
  7. package/dist/generated/prisma/internal/prismaNamespace.js +4 -4
  8. package/dist/generated/prisma/internal/prismaNamespaceBrowser.d.ts +6 -6
  9. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js +8 -8
  10. package/dist/generated/prisma/internal/prismaNamespaceBrowser.js.map +1 -1
  11. package/package.json +18 -4
  12. package/prisma/migrations/20251211113311_change_outbox_payload_to_json/migration.sql +0 -62
  13. package/prisma/migrations/migration_lock.toml +0 -3
  14. package/prisma/schema.prisma +0 -61
  15. package/prisma.config.d.ts +0 -3
  16. package/prisma.config.js +0 -14
  17. package/prisma.config.js.map +0 -1
  18. package/prisma.config.ts +0 -14
  19. package/src/EvDbPostgresPrismaClientFactory.ts +0 -12
  20. package/src/generated/prisma/browser.ts +0 -34
  21. package/src/generated/prisma/client.ts +0 -56
  22. package/src/generated/prisma/commonInputTypes.ts +0 -459
  23. package/src/generated/prisma/enums.ts +0 -15
  24. package/src/generated/prisma/internal/class.ts +0 -210
  25. package/src/generated/prisma/internal/prismaNamespace.ts +0 -1029
  26. package/src/generated/prisma/internal/prismaNamespaceBrowser.ts +0 -169
  27. package/src/generated/prisma/models/events.ts +0 -1339
  28. package/src/generated/prisma/models/outbox.ts +0 -1420
  29. package/src/generated/prisma/models/snapshot.ts +0 -1246
  30. package/src/generated/prisma/models.ts +0 -14
  31. package/tsconfig.json +0 -19
@@ -1,3 +1,7 @@
1
1
  export default class EvDbPostgresPrismaClientFactory {
2
- static create(): import("./generated/prisma/internal/class.js").PrismaClient<never, import("./generated/prisma/internal/prismaNamespace.js").GlobalOmitConfig | undefined, import("@prisma/client/runtime/client").DefaultArgs>;
2
+ /**
3
+ * Creates a Prisma client configured for PostgreSQL.
4
+ * @param connectionString - Optional connection string. Falls back to POSTGRES_CONNECTION env var if not provided.
5
+ */
6
+ static create(connectionString?: string): import("./generated/prisma/internal/class.js").PrismaClient<never, import("./generated/prisma/internal/prismaNamespace.js").GlobalOmitConfig | undefined, import("@prisma/client/runtime/client").DefaultArgs>;
3
7
  }
@@ -1,9 +1,16 @@
1
1
  import { PrismaPg } from '@prisma/adapter-pg';
2
2
  import { PrismaClient } from './generated/prisma/client.js';
3
3
  export default class EvDbPostgresPrismaClientFactory {
4
- static create() {
5
- const connectionString = `${process.env.POSTGRES_URL}`;
6
- const adapter = new PrismaPg({ connectionString });
4
+ /**
5
+ * Creates a Prisma client configured for PostgreSQL.
6
+ * @param connectionString - Optional connection string. Falls back to POSTGRES_CONNECTION env var if not provided.
7
+ */
8
+ static create(connectionString) {
9
+ const connStr = connectionString ?? process.env.POSTGRES_CONNECTION;
10
+ if (!connStr) {
11
+ throw new Error('PostgreSQL connection string not provided and POSTGRES_CONNECTION env var is not set');
12
+ }
13
+ const adapter = new PrismaPg({ connectionString: connStr });
7
14
  return new PrismaClient({ adapter });
8
15
  }
9
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EvDbPostgresPrismaClientFactory.js","sourceRoot":"","sources":["../src/EvDbPostgresPrismaClientFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,+BAA+B;IACzC,MAAM,CAAC,MAAM;QAChB,MAAM,gBAAgB,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAA;QACtD,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAA;QAClD,OAAO,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IACxC,CAAC;CACJ"}
1
+ {"version":3,"file":"EvDbPostgresPrismaClientFactory.js","sourceRoot":"","sources":["../src/EvDbPostgresPrismaClientFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,+BAA+B;IAChD;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,gBAAyB;QAC1C,MAAM,OAAO,GAAG,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QACpE,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC5G,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,CAAA;QAC3D,OAAO,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IACxC,CAAC;CACJ"}
@@ -12,8 +12,8 @@
12
12
  import * as runtime from "@prisma/client/runtime/client";
13
13
  const config = {
14
14
  "previewFeatures": [],
15
- "clientVersion": "7.1.0",
16
- "engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
15
+ "clientVersion": "7.3.0",
16
+ "engineVersion": "9d6ad21cbbceab97458517b147a6a09ff43aa735",
17
17
  "activeProvider": "postgresql",
18
18
  "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\n/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.\nmodel events {\n id String @db.Uuid\n stream_type String @db.VarChar(150)\n stream_id String @db.VarChar(150)\n offset BigInt\n event_type String @db.VarChar(150)\n telemetry_context Json? @db.Json\n captured_by String @db.VarChar(150)\n captured_at DateTime @db.Timestamptz(6)\n stored_at DateTime @default(now()) @db.Timestamptz(6)\n payload Json @db.Json\n\n @@id([stream_type, stream_id, offset])\n @@index([stream_type, stream_id, offset], map: \"ix_event_7ae7ea3b165349e09b3fe6d66a69fd72\")\n @@index([stored_at], map: \"ix_event_stored_at_7ae7ea3b165349e09b3fe6d66a69fd72\")\n}\n\n/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.\nmodel outbox {\n id String @db.Uuid\n stream_type String @db.VarChar(150)\n stream_id String @db.VarChar(150)\n offset BigInt\n event_type String @db.VarChar(150)\n channel String @db.VarChar(150)\n message_type String @db.VarChar(150)\n serialize_type String @db.VarChar(150)\n telemetry_context Bytes?\n captured_by String @db.VarChar(150)\n captured_at DateTime @db.Timestamptz(6)\n stored_at DateTime @default(now()) @db.Timestamptz(6)\n payload Json @db.Json\n\n @@id([captured_at, stream_type, stream_id, offset, channel, message_type])\n @@index([stream_type, stream_id, offset, channel, message_type], map: \"ix_outbox_7ae7ea3b165349e09b3fe6d66a69fd72\")\n @@index([stored_at, channel, message_type, offset], map: \"ix_storedat_outbox_captured_at_7ae7ea3b165349e09b3fe6d66a69fd72\")\n}\n\n/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.\nmodel snapshot {\n id String @db.Uuid\n stream_type String @db.VarChar(150)\n stream_id String @db.VarChar(150)\n view_name String @db.VarChar(150)\n offset BigInt\n state Json @db.Json\n stored_at DateTime @default(now()) @db.Timestamptz(6)\n\n @@id([stream_type, stream_id, view_name, offset])\n @@index([stream_type, stream_id, view_name, stored_at], map: \"ix_snapshot_earlier_stored_at_7ae7ea3b165349e09b3fe6d66a69fd72\")\n}\n",
19
19
  "runtimeDataModel": {
@@ -29,11 +29,12 @@ async function decodeBase64AsWasm(wasmBase64) {
29
29
  return new WebAssembly.Module(wasmArray);
30
30
  }
31
31
  config.compilerWasm = {
32
- getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"),
32
+ getRuntime: async () => await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.mjs"),
33
33
  getQueryCompilerWasmModule: async () => {
34
- const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.mjs");
34
+ const { wasm } = await import("@prisma/client/runtime/query_compiler_fast_bg.postgresql.wasm-base64.mjs");
35
35
  return await decodeBase64AsWasm(wasm);
36
- }
36
+ },
37
+ importName: "./query_compiler_fast_bg.js"
37
38
  };
38
39
  export function getPrismaClientClass() {
39
40
  return runtime.getPrismaClient(config);
@@ -1 +1 @@
1
- {"version":3,"file":"class.js","sourceRoot":"","sources":["../../../../src/generated/prisma/internal/class.ts"],"names":[],"mappings":"AACA,qEAAqE;AACrE,oBAAoB;AACpB,wCAAwC;AACxC,eAAe;AACf;;;;;;GAMG;AAEH,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAA;AAIxD,MAAM,MAAM,GAAkC;IAC5C,iBAAiB,EAAE,EAAE;IACrB,eAAe,EAAE,OAAO;IACxB,eAAe,EAAE,0CAA0C;IAC3D,gBAAgB,EAAE,YAAY;IAC9B,cAAc,EAAE,moFAAmoF;IACnpF,kBAAkB,EAAE;QAClB,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,EAAE;KACZ;CACF,CAAA;AAED,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,ykEAAykE,CAAC,CAAA;AAE/mE,KAAK,UAAU,kBAAkB,CAAC,UAAkB;IAClD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAA;IAC9C,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IACnD,OAAO,IAA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CAAC,CAAA;AAC1C,CAAC;AAED,MAAM,CAAC,YAAY,GAAG;IACpB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,8DAA8D,CAAC;IAEpG,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,0EAA0E,CAAC,CAAA;QACzG,OAAO,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;IAED,UAAU,EAAE,6BAA6B;CAC1C,CAAA;AAkKD,MAAM,UAAU,oBAAoB;IAClC,OAAO,OAAO,CAAC,eAAe,CAAC,MAAM,CAAuC,CAAA;AAC9E,CAAC"}
@@ -46,8 +46,8 @@ export type PrismaVersion = {
46
46
  engine: string;
47
47
  };
48
48
  /**
49
- * Prisma Client JS version: 7.1.0
50
- * Query Engine version: ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba
49
+ * Prisma Client JS version: 7.3.0
50
+ * Query Engine version: 9d6ad21cbbceab97458517b147a6a09ff43aa735
51
51
  */
52
52
  export declare const prismaVersion: PrismaVersion;
53
53
  /**
@@ -36,12 +36,12 @@ export const Sql = runtime.Sql;
36
36
  export const Decimal = runtime.Decimal;
37
37
  export const getExtensionContext = runtime.Extensions.getExtensionContext;
38
38
  /**
39
- * Prisma Client JS version: 7.1.0
40
- * Query Engine version: ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba
39
+ * Prisma Client JS version: 7.3.0
40
+ * Query Engine version: 9d6ad21cbbceab97458517b147a6a09ff43aa735
41
41
  */
42
42
  export const prismaVersion = {
43
- client: "7.1.0",
44
- engine: "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba"
43
+ client: "7.3.0",
44
+ engine: "9d6ad21cbbceab97458517b147a6a09ff43aa735"
45
45
  };
46
46
  export const NullTypes = {
47
47
  DbNull: runtime.NullTypes.DbNull,
@@ -83,12 +83,12 @@ export declare const SortOrder: {
83
83
  };
84
84
  export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder];
85
85
  export declare const NullableJsonNullValueInput: {
86
- readonly DbNull: "DbNull";
87
- readonly JsonNull: "JsonNull";
86
+ readonly DbNull: import("@prisma/client-runtime-utils").DbNullClass;
87
+ readonly JsonNull: import("@prisma/client-runtime-utils").JsonNullClass;
88
88
  };
89
89
  export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput];
90
90
  export declare const JsonNullValueInput: {
91
- readonly JsonNull: "JsonNull";
91
+ readonly JsonNull: import("@prisma/client-runtime-utils").JsonNullClass;
92
92
  };
93
93
  export type JsonNullValueInput = (typeof JsonNullValueInput)[keyof typeof JsonNullValueInput];
94
94
  export declare const QueryMode: {
@@ -97,9 +97,9 @@ export declare const QueryMode: {
97
97
  };
98
98
  export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode];
99
99
  export declare const JsonNullValueFilter: {
100
- readonly DbNull: "DbNull";
101
- readonly JsonNull: "JsonNull";
102
- readonly AnyNull: "AnyNull";
100
+ readonly DbNull: import("@prisma/client-runtime-utils").DbNullClass;
101
+ readonly JsonNull: import("@prisma/client-runtime-utils").JsonNullClass;
102
+ readonly AnyNull: import("@prisma/client-runtime-utils").AnyNullClass;
103
103
  };
104
104
  export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter];
105
105
  export declare const NullsOrder: {
@@ -46,12 +46,12 @@ export const ModelName = {
46
46
  /*
47
47
  * Enums
48
48
  */
49
- export const TransactionIsolationLevel = {
49
+ export const TransactionIsolationLevel = runtime.makeStrictEnum({
50
50
  ReadUncommitted: 'ReadUncommitted',
51
51
  ReadCommitted: 'ReadCommitted',
52
52
  RepeatableRead: 'RepeatableRead',
53
53
  Serializable: 'Serializable'
54
- };
54
+ });
55
55
  export const EventsScalarFieldEnum = {
56
56
  id: 'id',
57
57
  stream_type: 'stream_type',
@@ -93,20 +93,20 @@ export const SortOrder = {
93
93
  desc: 'desc'
94
94
  };
95
95
  export const NullableJsonNullValueInput = {
96
- DbNull: 'DbNull',
97
- JsonNull: 'JsonNull'
96
+ DbNull: DbNull,
97
+ JsonNull: JsonNull
98
98
  };
99
99
  export const JsonNullValueInput = {
100
- JsonNull: 'JsonNull'
100
+ JsonNull: JsonNull
101
101
  };
102
102
  export const QueryMode = {
103
103
  default: 'default',
104
104
  insensitive: 'insensitive'
105
105
  };
106
106
  export const JsonNullValueFilter = {
107
- DbNull: 'DbNull',
108
- JsonNull: 'JsonNull',
109
- AnyNull: 'AnyNull'
107
+ DbNull: DbNull,
108
+ JsonNull: JsonNull,
109
+ AnyNull: AnyNull
110
110
  };
111
111
  export const NullsOrder = {
112
112
  first: 'first',
@@ -1 +1 @@
1
- {"version":3,"file":"prismaNamespaceBrowser.js","sourceRoot":"","sources":["../../../../src/generated/prisma/internal/prismaNamespaceBrowser.ts"],"names":[],"mappings":"AACA,qEAAqE;AACrE,oBAAoB;AACpB,wCAAwC;AACxC,eAAe;AACf;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,OAAO,MAAM,sCAAsC,CAAA;AAK/D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAGtC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,MAAwD;IAClF,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,QAA4D;IACxF,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,OAA0D;CACtF,CAAA;AACD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAGtC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;I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AAM,0BAA0B,GAAG;IACxC,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACZ,CAAA;AAKV,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,QAAQ,EAAE,UAAU;CACZ,CAAA;AAKV,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CAClB,CAAA;AAKV,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAA;AAKV,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAA"}
1
+ {"version":3,"file":"prismaNamespaceBrowser.js","sourceRoot":"","sources":["../../../../src/generated/prisma/internal/prismaNamespaceBrowser.ts"],"names":[],"mappings":"AACA,qEAAqE;AACrE,oBAAoB;AACpB,wCAAwC;AACxC,eAAe;AACf;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,OAAO,MAAM,sCAAsC,CAAA;AAK/D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAGtC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,MAAwD;IAClF,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,QAA4D;IACxF,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,OAA0D;CACtF,CAAA;AACD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAGtC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAA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AAI,EAAE,MAAM;CACJ,CAAA;AAKV,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;CACV,CAAA;AAKV,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,QAAQ,EAAE,QAAQ;CACV,CAAA;AAKV,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CAClB,CAAA;AAKV,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,OAAO;CACR,CAAA;AAKV,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@eventualize/postgres-storage-adapter",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/outsidenote/eventualize-js",
8
+ "directory": "packages/postgres-storage-adapter"
9
+ },
5
10
  "main": "dist/index.js",
6
11
  "types": "dist/index.d.ts",
7
12
  "exports": {
@@ -9,7 +14,13 @@
9
14
  "import": "./dist/index.js",
10
15
  "types": "./dist/index.d.ts"
11
16
  },
12
- "./*": "./dist/*.js"
17
+ "./*": {
18
+ "import": "./dist/*.js",
19
+ "types": "./dist/*.d.ts"
20
+ }
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
13
24
  },
14
25
  "scripts": {
15
26
  "build": "tsc --build",
@@ -20,12 +31,15 @@
20
31
  "license": "ISC",
21
32
  "type": "module",
22
33
  "dependencies": {
23
- "@eventualize/relational-storage-adapter": "^1.0.0",
34
+ "@eventualize/relational-storage-adapter": "^2.0.0",
24
35
  "@prisma/adapter-pg": "^7.1.0"
25
36
  },
26
37
  "devDependencies": {
27
38
  "@prisma/client": "^7.1.0",
28
39
  "dotenv": "^17.2.3",
29
40
  "prisma": "^7.1.0"
30
- }
41
+ },
42
+ "files": [
43
+ "dist"
44
+ ]
31
45
  }
@@ -1,62 +0,0 @@
1
- -- CreateTable
2
- CREATE TABLE "events" (
3
- "id" UUID NOT NULL,
4
- "stream_type" VARCHAR(150) NOT NULL,
5
- "stream_id" VARCHAR(150) NOT NULL,
6
- "offset" BIGINT NOT NULL,
7
- "event_type" VARCHAR(150) NOT NULL,
8
- "telemetry_context" JSON,
9
- "captured_by" VARCHAR(150) NOT NULL,
10
- "captured_at" TIMESTAMPTZ(6) NOT NULL,
11
- "stored_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
- "payload" JSON NOT NULL,
13
-
14
- CONSTRAINT "events_pkey" PRIMARY KEY ("stream_type","stream_id","offset")
15
- );
16
-
17
- -- CreateTable
18
- CREATE TABLE "outbox" (
19
- "id" UUID NOT NULL,
20
- "stream_type" VARCHAR(150) NOT NULL,
21
- "stream_id" VARCHAR(150) NOT NULL,
22
- "offset" BIGINT NOT NULL,
23
- "event_type" VARCHAR(150) NOT NULL,
24
- "channel" VARCHAR(150) NOT NULL,
25
- "message_type" VARCHAR(150) NOT NULL,
26
- "serialize_type" VARCHAR(150) NOT NULL,
27
- "telemetry_context" BYTEA,
28
- "captured_by" VARCHAR(150) NOT NULL,
29
- "captured_at" TIMESTAMPTZ(6) NOT NULL,
30
- "stored_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
31
- "payload" JSON NOT NULL,
32
-
33
- CONSTRAINT "outbox_pkey" PRIMARY KEY ("captured_at","stream_type","stream_id","offset","channel","message_type")
34
- );
35
-
36
- -- CreateTable
37
- CREATE TABLE "snapshot" (
38
- "id" UUID NOT NULL,
39
- "stream_type" VARCHAR(150) NOT NULL,
40
- "stream_id" VARCHAR(150) NOT NULL,
41
- "view_name" VARCHAR(150) NOT NULL,
42
- "offset" BIGINT NOT NULL,
43
- "state" JSON NOT NULL,
44
- "stored_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
45
-
46
- CONSTRAINT "snapshot_pkey" PRIMARY KEY ("stream_type","stream_id","view_name","offset")
47
- );
48
-
49
- -- CreateIndex
50
- CREATE INDEX "ix_event_7ae7ea3b165349e09b3fe6d66a69fd72" ON "events"("stream_type", "stream_id", "offset");
51
-
52
- -- CreateIndex
53
- CREATE INDEX "ix_event_stored_at_7ae7ea3b165349e09b3fe6d66a69fd72" ON "events"("stored_at");
54
-
55
- -- CreateIndex
56
- CREATE INDEX "ix_outbox_7ae7ea3b165349e09b3fe6d66a69fd72" ON "outbox"("stream_type", "stream_id", "offset", "channel", "message_type");
57
-
58
- -- CreateIndex
59
- CREATE INDEX "ix_storedat_outbox_captured_at_7ae7ea3b165349e09b3fe6d66a69fd72" ON "outbox"("stored_at", "channel", "message_type", "offset");
60
-
61
- -- CreateIndex
62
- CREATE INDEX "ix_snapshot_earlier_stored_at_7ae7ea3b165349e09b3fe6d66a69fd72" ON "snapshot"("stream_type", "stream_id", "view_name", "stored_at");
@@ -1,3 +0,0 @@
1
- # Please do not edit this file manually
2
- # It should be added in your version-control system (e.g., Git)
3
- provider = "postgresql"
@@ -1,61 +0,0 @@
1
- generator client {
2
- provider = "prisma-client"
3
- output = "../src/generated/prisma"
4
- }
5
-
6
- datasource db {
7
- provider = "postgresql"
8
- }
9
-
10
- /// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
11
- model events {
12
- id String @db.Uuid
13
- stream_type String @db.VarChar(150)
14
- stream_id String @db.VarChar(150)
15
- offset BigInt
16
- event_type String @db.VarChar(150)
17
- telemetry_context Json? @db.Json
18
- captured_by String @db.VarChar(150)
19
- captured_at DateTime @db.Timestamptz(6)
20
- stored_at DateTime @default(now()) @db.Timestamptz(6)
21
- payload Json @db.Json
22
-
23
- @@id([stream_type, stream_id, offset])
24
- @@index([stream_type, stream_id, offset], map: "ix_event_7ae7ea3b165349e09b3fe6d66a69fd72")
25
- @@index([stored_at], map: "ix_event_stored_at_7ae7ea3b165349e09b3fe6d66a69fd72")
26
- }
27
-
28
- /// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
29
- model outbox {
30
- id String @db.Uuid
31
- stream_type String @db.VarChar(150)
32
- stream_id String @db.VarChar(150)
33
- offset BigInt
34
- event_type String @db.VarChar(150)
35
- channel String @db.VarChar(150)
36
- message_type String @db.VarChar(150)
37
- serialize_type String @db.VarChar(150)
38
- telemetry_context Bytes?
39
- captured_by String @db.VarChar(150)
40
- captured_at DateTime @db.Timestamptz(6)
41
- stored_at DateTime @default(now()) @db.Timestamptz(6)
42
- payload Json @db.Json
43
-
44
- @@id([captured_at, stream_type, stream_id, offset, channel, message_type])
45
- @@index([stream_type, stream_id, offset, channel, message_type], map: "ix_outbox_7ae7ea3b165349e09b3fe6d66a69fd72")
46
- @@index([stored_at, channel, message_type, offset], map: "ix_storedat_outbox_captured_at_7ae7ea3b165349e09b3fe6d66a69fd72")
47
- }
48
-
49
- /// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
50
- model snapshot {
51
- id String @db.Uuid
52
- stream_type String @db.VarChar(150)
53
- stream_id String @db.VarChar(150)
54
- view_name String @db.VarChar(150)
55
- offset BigInt
56
- state Json @db.Json
57
- stored_at DateTime @default(now()) @db.Timestamptz(6)
58
-
59
- @@id([stream_type, stream_id, view_name, offset])
60
- @@index([stream_type, stream_id, view_name, stored_at], map: "ix_snapshot_earlier_stored_at_7ae7ea3b165349e09b3fe6d66a69fd72")
61
- }
@@ -1,3 +0,0 @@
1
- import "dotenv/config";
2
- declare const _default: import("@prisma/config").PrismaConfigInternal;
3
- export default _default;
package/prisma.config.js DELETED
@@ -1,14 +0,0 @@
1
- // This file was generated by Prisma and assumes you have installed the following:
2
- // npm install --save-dev prisma dotenv
3
- import "dotenv/config";
4
- import { defineConfig, env } from "prisma/config";
5
- export default defineConfig({
6
- schema: "prisma/schema.prisma",
7
- migrations: {
8
- path: "prisma/migrations",
9
- },
10
- datasource: {
11
- url: env("POSTGRES_URL"),
12
- },
13
- });
14
- //# sourceMappingURL=prisma.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prisma.config.js","sourceRoot":"","sources":["prisma.config.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,uCAAuC;AACvC,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAElD,eAAe,YAAY,CAAC;IAC1B,MAAM,EAAE,sBAAsB;IAC9B,UAAU,EAAE;QACV,IAAI,EAAE,mBAAmB;KAC1B;IACD,UAAU,EAAE;QACV,GAAG,EAAE,GAAG,CAAC,cAAc,CAAC;KACzB;CACF,CAAC,CAAC"}
package/prisma.config.ts DELETED
@@ -1,14 +0,0 @@
1
- // This file was generated by Prisma and assumes you have installed the following:
2
- // npm install --save-dev prisma dotenv
3
- import "dotenv/config";
4
- import { defineConfig, env } from "prisma/config";
5
-
6
- export default defineConfig({
7
- schema: "prisma/schema.prisma",
8
- migrations: {
9
- path: "prisma/migrations",
10
- },
11
- datasource: {
12
- url: env("POSTGRES_URL"),
13
- },
14
- });
@@ -1,12 +0,0 @@
1
- import { PrismaPg } from '@prisma/adapter-pg';
2
-
3
-
4
- import { PrismaClient } from './generated/prisma/client.js';
5
-
6
- export default class EvDbPostgresPrismaClientFactory {
7
- public static create() {
8
- const connectionString = `${process.env.POSTGRES_URL}`
9
- const adapter = new PrismaPg({ connectionString })
10
- return new PrismaClient({ adapter })
11
- }
12
- }
@@ -1,34 +0,0 @@
1
-
2
- /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
- /* eslint-disable */
4
- // biome-ignore-all lint: generated file
5
- // @ts-nocheck
6
- /*
7
- * This file should be your main import to use Prisma-related types and utilities in a browser.
8
- * Use it to get access to models, enums, and input types.
9
- *
10
- * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
11
- * See `client.ts` for the standard, server-side entry point.
12
- *
13
- * 🟢 You can import this file directly.
14
- */
15
-
16
- import * as Prisma from './internal/prismaNamespaceBrowser.js'
17
- export { Prisma }
18
- export * as $Enums from './enums.js'
19
- export * from './enums.js';
20
- /**
21
- * Model events
22
- * This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
23
- */
24
- export type events = Prisma.eventsModel
25
- /**
26
- * Model outbox
27
- * This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
28
- */
29
- export type outbox = Prisma.outboxModel
30
- /**
31
- * Model snapshot
32
- * This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
33
- */
34
- export type snapshot = Prisma.snapshotModel
@@ -1,56 +0,0 @@
1
-
2
- /* !!! This is code generated by Prisma. Do not edit directly. !!! */
3
- /* eslint-disable */
4
- // biome-ignore-all lint: generated file
5
- // @ts-nocheck
6
- /*
7
- * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
8
- * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
9
- *
10
- * 🟢 You can import this file directly.
11
- */
12
-
13
- import * as process from 'node:process'
14
- import * as path from 'node:path'
15
- import { fileURLToPath } from 'node:url'
16
- globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
17
-
18
- import * as runtime from "@prisma/client/runtime/client"
19
- import * as $Enums from "./enums.js"
20
- import * as $Class from "./internal/class.js"
21
- import * as Prisma from "./internal/prismaNamespace.js"
22
-
23
- export * as $Enums from './enums.js'
24
- export * from "./enums.js"
25
- /**
26
- * ## Prisma Client
27
- *
28
- * Type-safe database client for TypeScript
29
- * @example
30
- * ```
31
- * const prisma = new PrismaClient()
32
- * // Fetch zero or more Events
33
- * const events = await prisma.events.findMany()
34
- * ```
35
- *
36
- * Read more in our [docs](https://pris.ly/d/client).
37
- */
38
- export const PrismaClient = $Class.getPrismaClientClass()
39
- export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
40
- export { Prisma }
41
-
42
- /**
43
- * Model events
44
- * This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
45
- */
46
- export type events = Prisma.eventsModel
47
- /**
48
- * Model outbox
49
- * This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
50
- */
51
- export type outbox = Prisma.outboxModel
52
- /**
53
- * Model snapshot
54
- * This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
55
- */
56
- export type snapshot = Prisma.snapshotModel