@event-driven-io/emmett-postgresql 0.12.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 (133) hide show
  1. package/dist/chunk-3P346ME6.mjs +2 -0
  2. package/dist/chunk-3P346ME6.mjs.map +1 -0
  3. package/dist/chunk-4ZQCCOS3.js +12 -0
  4. package/dist/chunk-4ZQCCOS3.js.map +1 -0
  5. package/dist/chunk-5Z7GAHAZ.mjs +94 -0
  6. package/dist/chunk-5Z7GAHAZ.mjs.map +1 -0
  7. package/dist/chunk-7K6TUMXZ.mjs +4 -0
  8. package/dist/chunk-7K6TUMXZ.mjs.map +1 -0
  9. package/dist/chunk-ABNBEUC6.mjs +2 -0
  10. package/dist/chunk-ABNBEUC6.mjs.map +1 -0
  11. package/dist/chunk-C6E7NEXU.js +2 -0
  12. package/dist/chunk-C6E7NEXU.js.map +1 -0
  13. package/dist/chunk-DRZRZGSJ.mjs +264 -0
  14. package/dist/chunk-DRZRZGSJ.mjs.map +1 -0
  15. package/dist/chunk-FYXDBZNT.mjs +12 -0
  16. package/dist/chunk-FYXDBZNT.mjs.map +1 -0
  17. package/dist/chunk-GR4YFDV5.mjs +1 -0
  18. package/dist/chunk-GR4YFDV5.mjs.map +1 -0
  19. package/dist/chunk-HIATDE4Q.mjs +1 -0
  20. package/dist/chunk-HIATDE4Q.mjs.map +1 -0
  21. package/dist/chunk-HUB7W7J3.js +1 -0
  22. package/dist/chunk-HUB7W7J3.js.map +1 -0
  23. package/dist/chunk-IX2XL3S5.mjs +2 -0
  24. package/dist/chunk-IX2XL3S5.mjs.map +1 -0
  25. package/dist/chunk-IZW7N6BP.js +2 -0
  26. package/dist/chunk-IZW7N6BP.js.map +1 -0
  27. package/dist/chunk-K5K3ETWI.mjs +2 -0
  28. package/dist/chunk-K5K3ETWI.mjs.map +1 -0
  29. package/dist/chunk-MERDQHBQ.js +1 -0
  30. package/dist/chunk-MERDQHBQ.js.map +1 -0
  31. package/dist/chunk-MLVVMWHF.mjs +2 -0
  32. package/dist/chunk-MLVVMWHF.mjs.map +1 -0
  33. package/dist/chunk-N46ZM26V.js +94 -0
  34. package/dist/chunk-N46ZM26V.js.map +1 -0
  35. package/dist/chunk-QQC5YC26.mjs +2 -0
  36. package/dist/chunk-QQC5YC26.mjs.map +1 -0
  37. package/dist/chunk-SS2LQM3B.js +2 -0
  38. package/dist/chunk-SS2LQM3B.js.map +1 -0
  39. package/dist/chunk-T5F5ZRBR.js +2 -0
  40. package/dist/chunk-T5F5ZRBR.js.map +1 -0
  41. package/dist/chunk-TMR7LHTX.js +4 -0
  42. package/dist/chunk-TMR7LHTX.js.map +1 -0
  43. package/dist/chunk-VP4QNFWT.js +2 -0
  44. package/dist/chunk-VP4QNFWT.js.map +1 -0
  45. package/dist/chunk-XRWQWEAF.js +2 -0
  46. package/dist/chunk-XRWQWEAF.js.map +1 -0
  47. package/dist/chunk-Z67RDRQW.js +264 -0
  48. package/dist/chunk-Z67RDRQW.js.map +1 -0
  49. package/dist/connections/client.d.mts +9 -0
  50. package/dist/connections/client.d.ts +9 -0
  51. package/dist/connections/client.js +2 -0
  52. package/dist/connections/client.js.map +1 -0
  53. package/dist/connections/client.mjs +2 -0
  54. package/dist/connections/client.mjs.map +1 -0
  55. package/dist/connections/index.d.mts +3 -0
  56. package/dist/connections/index.d.ts +3 -0
  57. package/dist/connections/index.js +2 -0
  58. package/dist/connections/index.js.map +1 -0
  59. package/dist/connections/index.mjs +2 -0
  60. package/dist/connections/index.mjs.map +1 -0
  61. package/dist/connections/pool.d.mts +7 -0
  62. package/dist/connections/pool.d.ts +7 -0
  63. package/dist/connections/pool.js +2 -0
  64. package/dist/connections/pool.js.map +1 -0
  65. package/dist/connections/pool.mjs +2 -0
  66. package/dist/connections/pool.mjs.map +1 -0
  67. package/dist/eventStore/index.d.mts +9 -0
  68. package/dist/eventStore/index.d.ts +9 -0
  69. package/dist/eventStore/index.js +2 -0
  70. package/dist/eventStore/index.js.map +1 -0
  71. package/dist/eventStore/index.mjs +2 -0
  72. package/dist/eventStore/index.mjs.map +1 -0
  73. package/dist/eventStore/postgreSQLEventStore.d.mts +6 -0
  74. package/dist/eventStore/postgreSQLEventStore.d.ts +6 -0
  75. package/dist/eventStore/postgreSQLEventStore.js +2 -0
  76. package/dist/eventStore/postgreSQLEventStore.js.map +1 -0
  77. package/dist/eventStore/postgreSQLEventStore.mjs +2 -0
  78. package/dist/eventStore/postgreSQLEventStore.mjs.map +1 -0
  79. package/dist/eventStore/schema/appendToStream.d.mts +18 -0
  80. package/dist/eventStore/schema/appendToStream.d.ts +18 -0
  81. package/dist/eventStore/schema/appendToStream.js +2 -0
  82. package/dist/eventStore/schema/appendToStream.js.map +1 -0
  83. package/dist/eventStore/schema/appendToStream.mjs +2 -0
  84. package/dist/eventStore/schema/appendToStream.mjs.map +1 -0
  85. package/dist/eventStore/schema/index.d.mts +12 -0
  86. package/dist/eventStore/schema/index.d.ts +12 -0
  87. package/dist/eventStore/schema/index.js +2 -0
  88. package/dist/eventStore/schema/index.js.map +1 -0
  89. package/dist/eventStore/schema/index.mjs +2 -0
  90. package/dist/eventStore/schema/index.mjs.map +1 -0
  91. package/dist/eventStore/schema/readStream.d.mts +8 -0
  92. package/dist/eventStore/schema/readStream.d.ts +8 -0
  93. package/dist/eventStore/schema/readStream.js +2 -0
  94. package/dist/eventStore/schema/readStream.js.map +1 -0
  95. package/dist/eventStore/schema/readStream.mjs +2 -0
  96. package/dist/eventStore/schema/readStream.mjs.map +1 -0
  97. package/dist/eventStore/schema/tables.d.mts +16 -0
  98. package/dist/eventStore/schema/tables.d.ts +16 -0
  99. package/dist/eventStore/schema/tables.js +2 -0
  100. package/dist/eventStore/schema/tables.js.map +1 -0
  101. package/dist/eventStore/schema/tables.mjs +2 -0
  102. package/dist/eventStore/schema/tables.mjs.map +1 -0
  103. package/dist/eventStore/schema/typing.d.mts +31 -0
  104. package/dist/eventStore/schema/typing.d.ts +31 -0
  105. package/dist/eventStore/schema/typing.js +2 -0
  106. package/dist/eventStore/schema/typing.js.map +1 -0
  107. package/dist/eventStore/schema/typing.mjs +2 -0
  108. package/dist/eventStore/schema/typing.mjs.map +1 -0
  109. package/dist/execute/index.d.mts +22 -0
  110. package/dist/execute/index.d.ts +22 -0
  111. package/dist/execute/index.js +2 -0
  112. package/dist/execute/index.js.map +1 -0
  113. package/dist/execute/index.mjs +2 -0
  114. package/dist/execute/index.mjs.map +1 -0
  115. package/dist/index.d.mts +12 -0
  116. package/dist/index.d.ts +12 -0
  117. package/dist/index.js +2 -0
  118. package/dist/index.js.map +1 -0
  119. package/dist/index.mjs +2 -0
  120. package/dist/index.mjs.map +1 -0
  121. package/dist/sql/index.d.mts +14 -0
  122. package/dist/sql/index.d.ts +14 -0
  123. package/dist/sql/index.js +2 -0
  124. package/dist/sql/index.js.map +1 -0
  125. package/dist/sql/index.mjs +2 -0
  126. package/dist/sql/index.mjs.map +1 -0
  127. package/dist/sql/schema.d.mts +2 -0
  128. package/dist/sql/schema.d.ts +2 -0
  129. package/dist/sql/schema.js +2 -0
  130. package/dist/sql/schema.js.map +1 -0
  131. package/dist/sql/schema.mjs +2 -0
  132. package/dist/sql/schema.mjs.map +1 -0
  133. package/package.json +61 -0
@@ -0,0 +1,2 @@
1
+ import{a}from"../../chunk-7K6TUMXZ.mjs";import"../../chunk-ABNBEUC6.mjs";import"../../chunk-FYXDBZNT.mjs";import"../../chunk-MLVVMWHF.mjs";export{a as readStream};
2
+ //# sourceMappingURL=readStream.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,16 @@
1
+ import { SQL } from '../../sql/index.mjs';
2
+ import 'pg';
3
+
4
+ declare const streamsTableSQL: SQL;
5
+ declare const eventsTableSQL: SQL;
6
+ declare const subscriptionsTableSQL: SQL;
7
+ declare const sanitizeNameSQL: SQL;
8
+ declare const addTablePartitions: SQL;
9
+ declare const addEventsPartitions: SQL;
10
+ declare const addModuleSQL: SQL;
11
+ declare const addTenantSQL: SQL;
12
+ declare const addModuleForAllTenantsSQL: SQL;
13
+ declare const addTenantForAllModulesSQL: SQL;
14
+ declare const addDefaultPartition: SQL;
15
+
16
+ export { addDefaultPartition, addEventsPartitions, addModuleForAllTenantsSQL, addModuleSQL, addTablePartitions, addTenantForAllModulesSQL, addTenantSQL, eventsTableSQL, sanitizeNameSQL, streamsTableSQL, subscriptionsTableSQL };
@@ -0,0 +1,16 @@
1
+ import { SQL } from '../../sql/index.js';
2
+ import 'pg';
3
+
4
+ declare const streamsTableSQL: SQL;
5
+ declare const eventsTableSQL: SQL;
6
+ declare const subscriptionsTableSQL: SQL;
7
+ declare const sanitizeNameSQL: SQL;
8
+ declare const addTablePartitions: SQL;
9
+ declare const addEventsPartitions: SQL;
10
+ declare const addModuleSQL: SQL;
11
+ declare const addTenantSQL: SQL;
12
+ declare const addModuleForAllTenantsSQL: SQL;
13
+ declare const addTenantForAllModulesSQL: SQL;
14
+ declare const addDefaultPartition: SQL;
15
+
16
+ export { addDefaultPartition, addEventsPartitions, addModuleForAllTenantsSQL, addModuleSQL, addTablePartitions, addTenantForAllModulesSQL, addTenantSQL, eventsTableSQL, sanitizeNameSQL, streamsTableSQL, subscriptionsTableSQL };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ67RDRQWjs = require('../../chunk-Z67RDRQW.js');require('../../chunk-SS2LQM3B.js');require('../../chunk-4ZQCCOS3.js');require('../../chunk-IZW7N6BP.js');exports.addDefaultPartition = _chunkZ67RDRQWjs.k; exports.addEventsPartitions = _chunkZ67RDRQWjs.f; exports.addModuleForAllTenantsSQL = _chunkZ67RDRQWjs.i; exports.addModuleSQL = _chunkZ67RDRQWjs.g; exports.addTablePartitions = _chunkZ67RDRQWjs.e; exports.addTenantForAllModulesSQL = _chunkZ67RDRQWjs.j; exports.addTenantSQL = _chunkZ67RDRQWjs.h; exports.eventsTableSQL = _chunkZ67RDRQWjs.b; exports.sanitizeNameSQL = _chunkZ67RDRQWjs.d; exports.streamsTableSQL = _chunkZ67RDRQWjs.a; exports.subscriptionsTableSQL = _chunkZ67RDRQWjs.c;
2
+ //# sourceMappingURL=tables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f,g,h,i,j,k}from"../../chunk-DRZRZGSJ.mjs";import"../../chunk-ABNBEUC6.mjs";import"../../chunk-FYXDBZNT.mjs";import"../../chunk-MLVVMWHF.mjs";export{k as addDefaultPartition,f as addEventsPartitions,i as addModuleForAllTenantsSQL,g as addModuleSQL,e as addTablePartitions,j as addTenantForAllModulesSQL,h as addTenantSQL,b as eventsTableSQL,d as sanitizeNameSQL,a as streamsTableSQL,c as subscriptionsTableSQL};
2
+ //# sourceMappingURL=tables.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,31 @@
1
+ declare const emmettPrefix = "emt";
2
+ declare const globalTag = "global";
3
+ declare const defaultTag = "emt:default";
4
+ declare const globalNames: {
5
+ module: string;
6
+ tenant: string;
7
+ };
8
+ declare const streamsTable: {
9
+ name: string;
10
+ columns: {
11
+ partition: {
12
+ name: string;
13
+ };
14
+ isArchived: {
15
+ name: string;
16
+ };
17
+ };
18
+ };
19
+ declare const eventsTable: {
20
+ name: string;
21
+ columns: {
22
+ partition: {
23
+ name: string;
24
+ };
25
+ isArchived: {
26
+ name: string;
27
+ };
28
+ };
29
+ };
30
+
31
+ export { defaultTag, emmettPrefix, eventsTable, globalNames, globalTag, streamsTable };
@@ -0,0 +1,31 @@
1
+ declare const emmettPrefix = "emt";
2
+ declare const globalTag = "global";
3
+ declare const defaultTag = "emt:default";
4
+ declare const globalNames: {
5
+ module: string;
6
+ tenant: string;
7
+ };
8
+ declare const streamsTable: {
9
+ name: string;
10
+ columns: {
11
+ partition: {
12
+ name: string;
13
+ };
14
+ isArchived: {
15
+ name: string;
16
+ };
17
+ };
18
+ };
19
+ declare const eventsTable: {
20
+ name: string;
21
+ columns: {
22
+ partition: {
23
+ name: string;
24
+ };
25
+ isArchived: {
26
+ name: string;
27
+ };
28
+ };
29
+ };
30
+
31
+ export { defaultTag, emmettPrefix, eventsTable, globalNames, globalTag, streamsTable };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSS2LQM3Bjs = require('../../chunk-SS2LQM3B.js');exports.defaultTag = _chunkSS2LQM3Bjs.c; exports.emmettPrefix = _chunkSS2LQM3Bjs.a; exports.eventsTable = _chunkSS2LQM3Bjs.f; exports.globalNames = _chunkSS2LQM3Bjs.d; exports.globalTag = _chunkSS2LQM3Bjs.b; exports.streamsTable = _chunkSS2LQM3Bjs.e;
2
+ //# sourceMappingURL=typing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f}from"../../chunk-ABNBEUC6.mjs";export{c as defaultTag,a as emmettPrefix,f as eventsTable,d as globalNames,b as globalTag,e as streamsTable};
2
+ //# sourceMappingURL=typing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,22 @@
1
+ import pg from 'pg';
2
+ import { SQL } from '../sql/index.mjs';
3
+
4
+ declare const execute: <Result = void>(pool: pg.Pool, handle: (client: pg.PoolClient) => Promise<Result>) => Promise<Result>;
5
+ declare const executeInTransaction: <Result = void>(pool: pg.Pool, handle: (client: pg.PoolClient) => Promise<{
6
+ success: boolean;
7
+ result: Result;
8
+ }>) => Promise<Result>;
9
+ declare const executeSQL: <Result extends pg.QueryResultRow = pg.QueryResultRow>(poolOrClient: pg.Pool | pg.PoolClient, sql: SQL) => Promise<pg.QueryResult<Result>>;
10
+ declare const executeSQLInTransaction: <Result extends pg.QueryResultRow = pg.QueryResultRow>(pool: pg.Pool, sql: SQL) => Promise<pg.QueryResult<Result>>;
11
+ declare const executeSQLBatchInTransaction: <Result extends pg.QueryResultRow = pg.QueryResultRow>(pool: pg.Pool, ...sqls: SQL[]) => Promise<undefined>;
12
+ declare const firstOrNull: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result | null>;
13
+ declare const first: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result>;
14
+ declare const singleOrNull: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result | null>;
15
+ declare const single: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result>;
16
+ declare const mapRow: <Result extends pg.QueryResultRow = pg.QueryResultRow, Mapped = unknown>(getResult: Promise<pg.QueryResult<Result>>, map: (row: Result) => Mapped) => Promise<Mapped[]>;
17
+ type ExistsSQLQueryResult = {
18
+ exists: boolean;
19
+ };
20
+ declare const exists: (pool: pg.Pool, sql: SQL) => Promise<boolean>;
21
+
22
+ export { type ExistsSQLQueryResult, execute, executeInTransaction, executeSQL, executeSQLBatchInTransaction, executeSQLInTransaction, exists, first, firstOrNull, mapRow, single, singleOrNull };
@@ -0,0 +1,22 @@
1
+ import pg from 'pg';
2
+ import { SQL } from '../sql/index.js';
3
+
4
+ declare const execute: <Result = void>(pool: pg.Pool, handle: (client: pg.PoolClient) => Promise<Result>) => Promise<Result>;
5
+ declare const executeInTransaction: <Result = void>(pool: pg.Pool, handle: (client: pg.PoolClient) => Promise<{
6
+ success: boolean;
7
+ result: Result;
8
+ }>) => Promise<Result>;
9
+ declare const executeSQL: <Result extends pg.QueryResultRow = pg.QueryResultRow>(poolOrClient: pg.Pool | pg.PoolClient, sql: SQL) => Promise<pg.QueryResult<Result>>;
10
+ declare const executeSQLInTransaction: <Result extends pg.QueryResultRow = pg.QueryResultRow>(pool: pg.Pool, sql: SQL) => Promise<pg.QueryResult<Result>>;
11
+ declare const executeSQLBatchInTransaction: <Result extends pg.QueryResultRow = pg.QueryResultRow>(pool: pg.Pool, ...sqls: SQL[]) => Promise<undefined>;
12
+ declare const firstOrNull: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result | null>;
13
+ declare const first: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result>;
14
+ declare const singleOrNull: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result | null>;
15
+ declare const single: <Result extends pg.QueryResultRow = pg.QueryResultRow>(getResult: Promise<pg.QueryResult<Result>>) => Promise<Result>;
16
+ declare const mapRow: <Result extends pg.QueryResultRow = pg.QueryResultRow, Mapped = unknown>(getResult: Promise<pg.QueryResult<Result>>, map: (row: Result) => Mapped) => Promise<Mapped[]>;
17
+ type ExistsSQLQueryResult = {
18
+ exists: boolean;
19
+ };
20
+ declare const exists: (pool: pg.Pool, sql: SQL) => Promise<boolean>;
21
+
22
+ export { type ExistsSQLQueryResult, execute, executeInTransaction, executeSQL, executeSQLBatchInTransaction, executeSQLInTransaction, exists, first, firstOrNull, mapRow, single, singleOrNull };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIZW7N6BPjs = require('../chunk-IZW7N6BP.js');exports.execute = _chunkIZW7N6BPjs.g; exports.executeInTransaction = _chunkIZW7N6BPjs.h; exports.executeSQL = _chunkIZW7N6BPjs.i; exports.executeSQLBatchInTransaction = _chunkIZW7N6BPjs.k; exports.executeSQLInTransaction = _chunkIZW7N6BPjs.j; exports.exists = _chunkIZW7N6BPjs.q; exports.first = _chunkIZW7N6BPjs.m; exports.firstOrNull = _chunkIZW7N6BPjs.l; exports.mapRow = _chunkIZW7N6BPjs.p; exports.single = _chunkIZW7N6BPjs.o; exports.singleOrNull = _chunkIZW7N6BPjs.n;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{g as a,h as b,i as c,j as d,k as e,l as f,m as g,n as h,o as i,p as j,q as k}from"../chunk-MLVVMWHF.mjs";export{a as execute,b as executeInTransaction,c as executeSQL,e as executeSQLBatchInTransaction,d as executeSQLInTransaction,k as exists,g as first,f as firstOrNull,j as mapRow,i as single,h as singleOrNull};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,12 @@
1
+ export { PostgresClient, postgresClient } from './connections/client.mjs';
2
+ export { endAllPools, endPool, getPool } from './connections/pool.mjs';
3
+ export { getPostgreSQLEventStore } from './eventStore/postgreSQLEventStore.mjs';
4
+ export { createEventStoreSchema, schemaSQL } from './eventStore/schema/index.mjs';
5
+ export { ExistsSQLQueryResult, execute, executeInTransaction, executeSQL, executeSQLBatchInTransaction, executeSQLInTransaction, exists, first, firstOrNull, mapRow, single, singleOrNull } from './execute/index.mjs';
6
+ export { SQL, functionExists, functionExistsSQL, rawSQL, sql, tableExists, tableExistsSQL } from './sql/index.mjs';
7
+ export { appendEventsSQL, appendToStream } from './eventStore/schema/appendToStream.mjs';
8
+ export { readStream } from './eventStore/schema/readStream.mjs';
9
+ export { addDefaultPartition, addEventsPartitions, addModuleForAllTenantsSQL, addModuleSQL, addTablePartitions, addTenantForAllModulesSQL, addTenantSQL, eventsTableSQL, sanitizeNameSQL, streamsTableSQL, subscriptionsTableSQL } from './eventStore/schema/tables.mjs';
10
+ export { defaultTag, emmettPrefix, eventsTable, globalNames, globalTag, streamsTable } from './eventStore/schema/typing.mjs';
11
+ import 'pg';
12
+ import '@event-driven-io/emmett';
@@ -0,0 +1,12 @@
1
+ export { PostgresClient, postgresClient } from './connections/client.js';
2
+ export { endAllPools, endPool, getPool } from './connections/pool.js';
3
+ export { getPostgreSQLEventStore } from './eventStore/postgreSQLEventStore.js';
4
+ export { createEventStoreSchema, schemaSQL } from './eventStore/schema/index.js';
5
+ export { ExistsSQLQueryResult, execute, executeInTransaction, executeSQL, executeSQLBatchInTransaction, executeSQLInTransaction, exists, first, firstOrNull, mapRow, single, singleOrNull } from './execute/index.js';
6
+ export { SQL, functionExists, functionExistsSQL, rawSQL, sql, tableExists, tableExistsSQL } from './sql/index.js';
7
+ export { appendEventsSQL, appendToStream } from './eventStore/schema/appendToStream.js';
8
+ export { readStream } from './eventStore/schema/readStream.js';
9
+ export { addDefaultPartition, addEventsPartitions, addModuleForAllTenantsSQL, addModuleSQL, addTablePartitions, addTenantForAllModulesSQL, addTenantSQL, eventsTableSQL, sanitizeNameSQL, streamsTableSQL, subscriptionsTableSQL } from './eventStore/schema/tables.js';
10
+ export { defaultTag, emmettPrefix, eventsTable, globalNames, globalTag, streamsTable } from './eventStore/schema/typing.js';
11
+ import 'pg';
12
+ import '@event-driven-io/emmett';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-HUB7W7J3.js');var _chunkC6E7NEXUjs = require('./chunk-C6E7NEXU.js');var _chunkVP4QNFWTjs = require('./chunk-VP4QNFWT.js');require('./chunk-MERDQHBQ.js');var _chunkXRWQWEAFjs = require('./chunk-XRWQWEAF.js');var _chunkT5F5ZRBRjs = require('./chunk-T5F5ZRBR.js');var _chunkN46ZM26Vjs = require('./chunk-N46ZM26V.js');var _chunkTMR7LHTXjs = require('./chunk-TMR7LHTX.js');var _chunkZ67RDRQWjs = require('./chunk-Z67RDRQW.js');var _chunkSS2LQM3Bjs = require('./chunk-SS2LQM3B.js');var _chunk4ZQCCOS3js = require('./chunk-4ZQCCOS3.js');var _chunkIZW7N6BPjs = require('./chunk-IZW7N6BP.js');exports.addDefaultPartition = _chunkZ67RDRQWjs.k; exports.addEventsPartitions = _chunkZ67RDRQWjs.f; exports.addModuleForAllTenantsSQL = _chunkZ67RDRQWjs.i; exports.addModuleSQL = _chunkZ67RDRQWjs.g; exports.addTablePartitions = _chunkZ67RDRQWjs.e; exports.addTenantForAllModulesSQL = _chunkZ67RDRQWjs.j; exports.addTenantSQL = _chunkZ67RDRQWjs.h; exports.appendEventsSQL = _chunkN46ZM26Vjs.a; exports.appendToStream = _chunkN46ZM26Vjs.b; exports.createEventStoreSchema = _chunkT5F5ZRBRjs.b; exports.defaultTag = _chunkSS2LQM3Bjs.c; exports.emmettPrefix = _chunkSS2LQM3Bjs.a; exports.endAllPools = _chunkVP4QNFWTjs.c; exports.endPool = _chunkVP4QNFWTjs.b; exports.eventsTable = _chunkSS2LQM3Bjs.f; exports.eventsTableSQL = _chunkZ67RDRQWjs.b; exports.execute = _chunkIZW7N6BPjs.g; exports.executeInTransaction = _chunkIZW7N6BPjs.h; exports.executeSQL = _chunkIZW7N6BPjs.i; exports.executeSQLBatchInTransaction = _chunkIZW7N6BPjs.k; exports.executeSQLInTransaction = _chunkIZW7N6BPjs.j; exports.exists = _chunkIZW7N6BPjs.q; exports.first = _chunkIZW7N6BPjs.m; exports.firstOrNull = _chunkIZW7N6BPjs.l; exports.functionExists = _chunk4ZQCCOS3js.d; exports.functionExistsSQL = _chunk4ZQCCOS3js.c; exports.getPool = _chunkVP4QNFWTjs.a; exports.getPostgreSQLEventStore = _chunkXRWQWEAFjs.a; exports.globalNames = _chunkSS2LQM3Bjs.d; exports.globalTag = _chunkSS2LQM3Bjs.b; exports.mapRow = _chunkIZW7N6BPjs.p; exports.postgresClient = _chunkC6E7NEXUjs.a; exports.rawSQL = _chunk4ZQCCOS3js.f; exports.readStream = _chunkTMR7LHTXjs.a; exports.sanitizeNameSQL = _chunkZ67RDRQWjs.d; exports.schemaSQL = _chunkT5F5ZRBRjs.a; exports.single = _chunkIZW7N6BPjs.o; exports.singleOrNull = _chunkIZW7N6BPjs.n; exports.sql = _chunk4ZQCCOS3js.e; exports.streamsTable = _chunkSS2LQM3Bjs.e; exports.streamsTableSQL = _chunkZ67RDRQWjs.a; exports.subscriptionsTableSQL = _chunkZ67RDRQWjs.c; exports.tableExists = _chunk4ZQCCOS3js.b; exports.tableExistsSQL = _chunk4ZQCCOS3js.a;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import"./chunk-GR4YFDV5.mjs";import{a as f}from"./chunk-QQC5YC26.mjs";import{a as o,b as r,c as e}from"./chunk-IX2XL3S5.mjs";import"./chunk-HIATDE4Q.mjs";import{a as R}from"./chunk-3P346ME6.mjs";import{a as P,b as Q}from"./chunk-K5K3ETWI.mjs";import{a as B,b as C}from"./chunk-5Z7GAHAZ.mjs";import{a as O}from"./chunk-7K6TUMXZ.mjs";import{a as D,b as E,c as F,d as G,e as H,f as I,g as J,h as K,i as L,j as M,k as N}from"./chunk-DRZRZGSJ.mjs";import{a as u,b as v,c as w,d as y,e as z,f as A}from"./chunk-ABNBEUC6.mjs";import{a as j,b as k,c as l,d as n,e as q,f as s}from"./chunk-FYXDBZNT.mjs";import{g as m,h as p,i as t,j as x,k as a,l as b,m as c,n as d,o as g,p as h,q as i}from"./chunk-MLVVMWHF.mjs";export{N as addDefaultPartition,I as addEventsPartitions,L as addModuleForAllTenantsSQL,J as addModuleSQL,H as addTablePartitions,M as addTenantForAllModulesSQL,K as addTenantSQL,B as appendEventsSQL,C as appendToStream,Q as createEventStoreSchema,w as defaultTag,u as emmettPrefix,e as endAllPools,r as endPool,A as eventsTable,E as eventsTableSQL,m as execute,p as executeInTransaction,t as executeSQL,a as executeSQLBatchInTransaction,x as executeSQLInTransaction,i as exists,c as first,b as firstOrNull,n as functionExists,l as functionExistsSQL,o as getPool,R as getPostgreSQLEventStore,y as globalNames,v as globalTag,h as mapRow,f as postgresClient,s as rawSQL,O as readStream,G as sanitizeNameSQL,P as schemaSQL,g as single,d as singleOrNull,q as sql,z as streamsTable,D as streamsTableSQL,F as subscriptionsTableSQL,k as tableExists,j as tableExistsSQL};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,14 @@
1
+ import pg from 'pg';
2
+
3
+ declare const tableExistsSQL: (tableName: string) => SQL;
4
+ declare const tableExists: (pool: pg.Pool, tableName: string) => Promise<boolean>;
5
+ declare const functionExistsSQL: (functionName: string) => SQL;
6
+ declare const functionExists: (pool: pg.Pool, functionName: string) => Promise<boolean>;
7
+
8
+ type SQL = string & {
9
+ __brand: 'sql';
10
+ };
11
+ declare const sql: (sqlQuery: string, ...params: unknown[]) => SQL;
12
+ declare const rawSQL: (sqlQuery: string) => SQL;
13
+
14
+ export { type SQL, functionExists, functionExistsSQL, rawSQL, sql, tableExists, tableExistsSQL };
@@ -0,0 +1,14 @@
1
+ import pg from 'pg';
2
+
3
+ declare const tableExistsSQL: (tableName: string) => SQL;
4
+ declare const tableExists: (pool: pg.Pool, tableName: string) => Promise<boolean>;
5
+ declare const functionExistsSQL: (functionName: string) => SQL;
6
+ declare const functionExists: (pool: pg.Pool, functionName: string) => Promise<boolean>;
7
+
8
+ type SQL = string & {
9
+ __brand: 'sql';
10
+ };
11
+ declare const sql: (sqlQuery: string, ...params: unknown[]) => SQL;
12
+ declare const rawSQL: (sqlQuery: string) => SQL;
13
+
14
+ export { type SQL, functionExists, functionExistsSQL, rawSQL, sql, tableExists, tableExistsSQL };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4ZQCCOS3js = require('../chunk-4ZQCCOS3.js');require('../chunk-IZW7N6BP.js');exports.functionExists = _chunk4ZQCCOS3js.d; exports.functionExistsSQL = _chunk4ZQCCOS3js.c; exports.rawSQL = _chunk4ZQCCOS3js.f; exports.sql = _chunk4ZQCCOS3js.e; exports.tableExists = _chunk4ZQCCOS3js.b; exports.tableExistsSQL = _chunk4ZQCCOS3js.a;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d,e,f}from"../chunk-FYXDBZNT.mjs";import"../chunk-MLVVMWHF.mjs";export{d as functionExists,c as functionExistsSQL,f as rawSQL,e as sql,b as tableExists,a as tableExistsSQL};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ import 'pg';
2
+ export { functionExists, functionExistsSQL, tableExists, tableExistsSQL } from './index.mjs';
@@ -0,0 +1,2 @@
1
+ import 'pg';
2
+ export { functionExists, functionExistsSQL, tableExists, tableExistsSQL } from './index.js';
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4ZQCCOS3js = require('../chunk-4ZQCCOS3.js');require('../chunk-IZW7N6BP.js');exports.functionExists = _chunk4ZQCCOS3js.d; exports.functionExistsSQL = _chunk4ZQCCOS3js.c; exports.tableExists = _chunk4ZQCCOS3js.b; exports.tableExistsSQL = _chunk4ZQCCOS3js.a;
2
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{a,b,c,d}from"../chunk-FYXDBZNT.mjs";import"../chunk-MLVVMWHF.mjs";export{d as functionExists,c as functionExistsSQL,b as tableExists,a as tableExistsSQL};
2
+ //# sourceMappingURL=schema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@event-driven-io/emmett-postgresql",
3
+ "version": "0.12.0",
4
+ "description": "Emmett - PostgreSQL - Event Sourcing development made simple",
5
+ "scripts": {
6
+ "build": "tsup",
7
+ "build:ts": "tsc",
8
+ "build:ts:watch": "tsc --watch",
9
+ "test": "run-s test:unit test:int test:e2e",
10
+ "test:unit": "glob -c \"node --import tsx --test\" **/*.unit.spec.ts",
11
+ "test:int": "glob -c \"node --import tsx --test\" **/*.int.spec.ts",
12
+ "test:e2e": "glob -c \"node --import tsx --test\" **/*.e2e.spec.ts",
13
+ "test:watch": "node --import tsx --test --watch",
14
+ "test:unit:watch": "glob -c \"node --import tsx --test --watch\" **/*.unit.spec.ts",
15
+ "test:int:watch": "glob -c \"node --import tsx --test --watch\" **/*.int.spec.ts",
16
+ "test:e2e:watch": "glob -c \"node --import tsx --test --watch\" **/*.e2e.spec.ts"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/event-driven-io/emmett.git"
21
+ },
22
+ "keywords": [
23
+ "Event Sourcing"
24
+ ],
25
+ "author": "Oskar Dudycz",
26
+ "bugs": {
27
+ "url": "https://github.com/event-driven-io/emmett/issues"
28
+ },
29
+ "homepage": "https://event-driven-io.github.io/emmett/",
30
+ "exports": {
31
+ ".": {
32
+ "import": {
33
+ "types": "./dist/index.d.mts",
34
+ "default": "./dist/index.mjs"
35
+ },
36
+ "require": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./dist/index.js"
39
+ }
40
+ }
41
+ },
42
+ "main": "./dist/index.js",
43
+ "module": "./dist/index.mjs",
44
+ "types": "./dist/index.d.ts",
45
+ "files": [
46
+ "dist"
47
+ ],
48
+ "dependencies": {
49
+ "@testcontainers/postgresql": "^10.10.3"
50
+ },
51
+ "devDependencies": {
52
+ "@event-driven-io/emmett-testcontainers": "^0.5.0"
53
+ },
54
+ "peerDependencies": {
55
+ "@event-driven-io/emmett": "0.12.0",
56
+ "@types/pg": "^8.11.6",
57
+ "@types/pg-format": "^1.0.5",
58
+ "pg": "^8.12.0",
59
+ "pg-format": "^1.0.4"
60
+ }
61
+ }