@nagi-js/postgres 0.1.1-rc.21 → 0.1.1-rc.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -3
- package/dist/index.js +493 -335
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import {
|
|
2
|
+
import { Store, Millis } from '@nagi-js/core';
|
|
3
3
|
|
|
4
4
|
interface Migration {
|
|
5
5
|
readonly id: string;
|
|
@@ -14,14 +14,23 @@ declare function migrate<DB>(db: Kysely<DB>, opts?: MigrateOpts): Promise<{
|
|
|
14
14
|
skipped: readonly string[];
|
|
15
15
|
}>;
|
|
16
16
|
|
|
17
|
+
interface StreamListener {
|
|
18
|
+
listen(channel: string, onNotify: (payload: string) => void): Promise<() => void | Promise<void>>;
|
|
19
|
+
}
|
|
20
|
+
declare const MAX_CHUNK_BYTES = 7000;
|
|
21
|
+
|
|
17
22
|
interface PostgresStoreOpts<DB = unknown> {
|
|
18
23
|
readonly db: Kysely<DB>;
|
|
19
24
|
readonly schema?: string;
|
|
20
25
|
readonly leaseMs?: Millis;
|
|
21
26
|
readonly notifyChannel?: string;
|
|
27
|
+
readonly listener?: StreamListener;
|
|
28
|
+
}
|
|
29
|
+
interface PostgresStoreHandle extends Store {
|
|
30
|
+
ready(): Promise<void>;
|
|
22
31
|
}
|
|
23
|
-
declare function postgresStore<DB = unknown>(opts: PostgresStoreOpts<DB>):
|
|
32
|
+
declare function postgresStore<DB = unknown>(opts: PostgresStoreOpts<DB>): PostgresStoreHandle;
|
|
24
33
|
|
|
25
34
|
declare function uuidv7(now?: number): string;
|
|
26
35
|
|
|
27
|
-
export { type MigrateOpts, type Migration, type PostgresStoreOpts, migrate, migrations, postgresStore, uuidv7 };
|
|
36
|
+
export { MAX_CHUNK_BYTES, type MigrateOpts, type Migration, type PostgresStoreHandle, type PostgresStoreOpts, type StreamListener, migrate, migrations, postgresStore, uuidv7 };
|