@odunlamizo/node-river 1.0.8 → 1.1.1
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/README.md +91 -37
- package/dist/driver-BhanG0yg.d.cts +70 -0
- package/dist/driver-DQ6PVYVO.d.ts +70 -0
- package/dist/drivers/pg/index.cjs +74 -3
- package/dist/drivers/pg/index.cjs.map +1 -1
- package/dist/drivers/pg/index.d.cts +5 -2
- package/dist/drivers/pg/index.d.ts +5 -2
- package/dist/drivers/pg/index.js +74 -3
- package/dist/drivers/pg/index.js.map +1 -1
- package/dist/index.cjs +107 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +49 -28
- package/dist/index.d.ts +49 -28
- package/dist/index.js +102 -30
- package/dist/index.js.map +1 -1
- package/dist/{insert-result-Bf0bAFvJ.d.cts → insert-result-DWZkRtk9.d.cts} +27 -26
- package/dist/{insert-result-Bf0bAFvJ.d.ts → insert-result-DWZkRtk9.d.ts} +27 -26
- package/dist/types.d.cts +42 -6
- package/dist/types.d.ts +42 -6
- package/package.json +1 -1
- package/dist/driver-okKFbSrB.d.ts +0 -54
- package/dist/driver-vSyPLsFq.d.cts +0 -54
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { J as JobArgs, I as InsertOpts, a as InsertResult } from './insert-result-Bf0bAFvJ.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Common interface for all RiverQueue drivers (e.g., Postgres, Prisma, Sequelize, etc.).
|
|
5
|
-
* The generic parameter Tx must be set to the driver's transaction/session type.
|
|
6
|
-
*/
|
|
7
|
-
interface Driver<Tx> {
|
|
8
|
-
/**
|
|
9
|
-
* Checks if the driver can connect to the database. Throws on failure.
|
|
10
|
-
*/
|
|
11
|
-
verifyConnection(): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Closes all database connections and cleans up resources.
|
|
14
|
-
*/
|
|
15
|
-
close(): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Inserts a new job into the queue using the provided arguments and options.
|
|
18
|
-
* @param args - The job arguments to insert.
|
|
19
|
-
* @param opts - Options for job insertion.
|
|
20
|
-
* @returns A promise that resolves to the result of the insertion operation,
|
|
21
|
-
* including the job and whether the insert was skipped due to uniqueness.
|
|
22
|
-
*/
|
|
23
|
-
insert<T extends JobArgs>(args: T, opts: InsertOpts): Promise<InsertResult<T>>;
|
|
24
|
-
/**
|
|
25
|
-
* Inserts a new job into the queue within an existing transaction or session.
|
|
26
|
-
* The type of `tx` is driver-specific and should match the transaction/session type for the driver.
|
|
27
|
-
*
|
|
28
|
-
* @param tx - The transaction or session object to use for the insert.
|
|
29
|
-
* @param args - The job arguments to insert.
|
|
30
|
-
* @param opts - Options for job insertion.
|
|
31
|
-
* @returns A promise that resolves to the result of the insertion operation.
|
|
32
|
-
*/
|
|
33
|
-
insertTx<T extends JobArgs>(tx: Tx, args: T, opts: InsertOpts): Promise<InsertResult<T>>;
|
|
34
|
-
/**
|
|
35
|
-
* Inserts multiple jobs in sequence within a single transaction.
|
|
36
|
-
* If any insert fails, all previous inserts in the batch are rolled back.
|
|
37
|
-
*
|
|
38
|
-
* @param jobs - Array of job argument and option pairs to insert.
|
|
39
|
-
* @returns Array of InsertResult objects for each job.
|
|
40
|
-
*/
|
|
41
|
-
insertMany<T extends JobArgs>(jobs: {
|
|
42
|
-
args: T;
|
|
43
|
-
opts: InsertOpts;
|
|
44
|
-
}[]): Promise<InsertResult<T>[]>;
|
|
45
|
-
/**
|
|
46
|
-
* Starts and returns a new transaction or session object for the driver.
|
|
47
|
-
* The returned object should be used for transactional operations such as insertTx.
|
|
48
|
-
*
|
|
49
|
-
* @returns A promise that resolves to the driver's transaction/session object.
|
|
50
|
-
*/
|
|
51
|
-
getTx(): Promise<Tx>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type { Driver as D };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { J as JobArgs, I as InsertOpts, a as InsertResult } from './insert-result-Bf0bAFvJ.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Common interface for all RiverQueue drivers (e.g., Postgres, Prisma, Sequelize, etc.).
|
|
5
|
-
* The generic parameter Tx must be set to the driver's transaction/session type.
|
|
6
|
-
*/
|
|
7
|
-
interface Driver<Tx> {
|
|
8
|
-
/**
|
|
9
|
-
* Checks if the driver can connect to the database. Throws on failure.
|
|
10
|
-
*/
|
|
11
|
-
verifyConnection(): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Closes all database connections and cleans up resources.
|
|
14
|
-
*/
|
|
15
|
-
close(): Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Inserts a new job into the queue using the provided arguments and options.
|
|
18
|
-
* @param args - The job arguments to insert.
|
|
19
|
-
* @param opts - Options for job insertion.
|
|
20
|
-
* @returns A promise that resolves to the result of the insertion operation,
|
|
21
|
-
* including the job and whether the insert was skipped due to uniqueness.
|
|
22
|
-
*/
|
|
23
|
-
insert<T extends JobArgs>(args: T, opts: InsertOpts): Promise<InsertResult<T>>;
|
|
24
|
-
/**
|
|
25
|
-
* Inserts a new job into the queue within an existing transaction or session.
|
|
26
|
-
* The type of `tx` is driver-specific and should match the transaction/session type for the driver.
|
|
27
|
-
*
|
|
28
|
-
* @param tx - The transaction or session object to use for the insert.
|
|
29
|
-
* @param args - The job arguments to insert.
|
|
30
|
-
* @param opts - Options for job insertion.
|
|
31
|
-
* @returns A promise that resolves to the result of the insertion operation.
|
|
32
|
-
*/
|
|
33
|
-
insertTx<T extends JobArgs>(tx: Tx, args: T, opts: InsertOpts): Promise<InsertResult<T>>;
|
|
34
|
-
/**
|
|
35
|
-
* Inserts multiple jobs in sequence within a single transaction.
|
|
36
|
-
* If any insert fails, all previous inserts in the batch are rolled back.
|
|
37
|
-
*
|
|
38
|
-
* @param jobs - Array of job argument and option pairs to insert.
|
|
39
|
-
* @returns Array of InsertResult objects for each job.
|
|
40
|
-
*/
|
|
41
|
-
insertMany<T extends JobArgs>(jobs: {
|
|
42
|
-
args: T;
|
|
43
|
-
opts: InsertOpts;
|
|
44
|
-
}[]): Promise<InsertResult<T>[]>;
|
|
45
|
-
/**
|
|
46
|
-
* Starts and returns a new transaction or session object for the driver.
|
|
47
|
-
* The returned object should be used for transactional operations such as insertTx.
|
|
48
|
-
*
|
|
49
|
-
* @returns A promise that resolves to the driver's transaction/session object.
|
|
50
|
-
*/
|
|
51
|
-
getTx(): Promise<Tx>;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export type { Driver as D };
|