pg-boss 10.3.3 → 10.4.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/.claude/settings.local.json +25 -0
- package/dist/attorney.d.ts +19 -0
- package/dist/attorney.d.ts.map +1 -0
- package/dist/attorney.js +227 -0
- package/dist/bam.d.ts +14 -0
- package/dist/bam.d.ts.map +1 -0
- package/dist/bam.js +114 -0
- package/dist/boss.d.ts +16 -0
- package/dist/boss.d.ts.map +1 -0
- package/dist/boss.js +163 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +333 -0
- package/dist/contractor.d.ts +22 -0
- package/dist/contractor.d.ts.map +1 -0
- package/dist/contractor.js +81 -0
- package/dist/db.d.ts +16 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +46 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +266 -0
- package/dist/manager.d.ts +93 -0
- package/dist/manager.d.ts.map +1 -0
- package/dist/manager.js +746 -0
- package/dist/migrationStore.d.ts +7 -0
- package/dist/migrationStore.d.ts.map +1 -0
- package/dist/migrationStore.js +425 -0
- package/dist/plans.d.ts +102 -0
- package/dist/plans.d.ts.map +1 -0
- package/dist/plans.js +1220 -0
- package/dist/spy.d.ts +23 -0
- package/dist/spy.d.ts.map +1 -0
- package/dist/spy.js +73 -0
- package/dist/timekeeper.d.ts +34 -0
- package/dist/timekeeper.d.ts.map +1 -0
- package/dist/timekeeper.js +158 -0
- package/dist/tools.d.ts +18 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +45 -0
- package/dist/types.d.ts +301 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/worker.d.ts +43 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +113 -0
- package/package.json +1 -1
- package/src/plans.js +22 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as types from './types.ts';
|
|
2
|
+
declare function rollback(schema: string, version: number, migrations?: types.Migration[]): string;
|
|
3
|
+
declare function next(schema: string, version: number, migrations: types.Migration[] | undefined): string;
|
|
4
|
+
declare function migrate(schema: string, version: number, migrations?: types.Migration[]): string;
|
|
5
|
+
declare function getAll(schema: string): types.Migration[];
|
|
6
|
+
export { rollback, next, migrate, getAll, };
|
|
7
|
+
//# sourceMappingURL=migrationStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrationStore.d.ts","sourceRoot":"","sources":["../src/migrationStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AASnC,iBAAS,QAAQ,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,UAQjF;AAED,iBAAS,IAAI,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,SAAS,UAQxF;AAED,iBAAS,OAAO,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,UAuBhF;AAED,iBAAS,MAAM,CAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,EAAE,CAkYlD;AAED,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,GACP,CAAA"}
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import assert from 'node:assert';
|
|
2
|
+
import * as plans from "./plans.js";
|
|
3
|
+
import * as types from "./types.js";
|
|
4
|
+
function flatten(schema, commands, version) {
|
|
5
|
+
commands.unshift(plans.assertMigration(schema, version));
|
|
6
|
+
commands.push(plans.setVersion(schema, version));
|
|
7
|
+
return plans.locked(schema, commands);
|
|
8
|
+
}
|
|
9
|
+
function rollback(schema, version, migrations) {
|
|
10
|
+
migrations = migrations || getAll(schema);
|
|
11
|
+
const result = migrations.find(i => i.version === version);
|
|
12
|
+
assert(result, `Version ${version} not found.`);
|
|
13
|
+
return flatten(schema, result.uninstall || [], result.previous);
|
|
14
|
+
}
|
|
15
|
+
function next(schema, version, migrations) {
|
|
16
|
+
migrations = migrations || getAll(schema);
|
|
17
|
+
const result = migrations.find(i => i.previous === version);
|
|
18
|
+
assert(result, `Version ${version} not found.`);
|
|
19
|
+
return flatten(schema, result.install, result.version);
|
|
20
|
+
}
|
|
21
|
+
function migrate(schema, version, migrations) {
|
|
22
|
+
migrations = migrations || getAll(schema);
|
|
23
|
+
const result = migrations
|
|
24
|
+
.filter(i => i.previous >= version)
|
|
25
|
+
.sort((a, b) => a.version - b.version)
|
|
26
|
+
.reduce((acc, migration) => {
|
|
27
|
+
acc.install = acc.install.concat(migration.install);
|
|
28
|
+
if (migration.async) {
|
|
29
|
+
const bamCommands = migration.async.map(cmd => cmd.replace(/\$VERSION\$/g, String(migration.version)));
|
|
30
|
+
acc.install = acc.install.concat(bamCommands);
|
|
31
|
+
}
|
|
32
|
+
acc.version = migration.version;
|
|
33
|
+
return acc;
|
|
34
|
+
}, { install: [], version });
|
|
35
|
+
assert(result.install.length > 0, `Version ${version} not found.`);
|
|
36
|
+
return flatten(schema, result.install, result.version);
|
|
37
|
+
}
|
|
38
|
+
function getAll(schema) {
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
release: '11.1.0',
|
|
42
|
+
version: 26,
|
|
43
|
+
previous: 25,
|
|
44
|
+
install: [
|
|
45
|
+
`
|
|
46
|
+
CREATE OR REPLACE FUNCTION ${schema}.create_queue(queue_name text, options jsonb)
|
|
47
|
+
RETURNS VOID AS
|
|
48
|
+
$$
|
|
49
|
+
DECLARE
|
|
50
|
+
tablename varchar := CASE WHEN options->>'partition' = 'true'
|
|
51
|
+
THEN 'j' || encode(sha224(queue_name::bytea), 'hex')
|
|
52
|
+
ELSE 'job_common'
|
|
53
|
+
END;
|
|
54
|
+
queue_created_on timestamptz;
|
|
55
|
+
BEGIN
|
|
56
|
+
|
|
57
|
+
WITH q as (
|
|
58
|
+
INSERT INTO ${schema}.queue (
|
|
59
|
+
name,
|
|
60
|
+
policy,
|
|
61
|
+
retry_limit,
|
|
62
|
+
retry_delay,
|
|
63
|
+
retry_backoff,
|
|
64
|
+
retry_delay_max,
|
|
65
|
+
expire_seconds,
|
|
66
|
+
retention_seconds,
|
|
67
|
+
deletion_seconds,
|
|
68
|
+
warning_queued,
|
|
69
|
+
dead_letter,
|
|
70
|
+
partition,
|
|
71
|
+
table_name
|
|
72
|
+
)
|
|
73
|
+
VALUES (
|
|
74
|
+
queue_name,
|
|
75
|
+
options->>'policy',
|
|
76
|
+
COALESCE((options->>'retryLimit')::int, 2),
|
|
77
|
+
COALESCE((options->>'retryDelay')::int, 0),
|
|
78
|
+
COALESCE((options->>'retryBackoff')::bool, false),
|
|
79
|
+
(options->>'retryDelayMax')::int,
|
|
80
|
+
COALESCE((options->>'expireInSeconds')::int, 900),
|
|
81
|
+
COALESCE((options->>'retentionSeconds')::int, 1209600),
|
|
82
|
+
COALESCE((options->>'deleteAfterSeconds')::int, 604800),
|
|
83
|
+
COALESCE((options->>'warningQueueSize')::int, 0),
|
|
84
|
+
options->>'deadLetter',
|
|
85
|
+
COALESCE((options->>'partition')::bool, false),
|
|
86
|
+
tablename
|
|
87
|
+
)
|
|
88
|
+
ON CONFLICT DO NOTHING
|
|
89
|
+
RETURNING created_on
|
|
90
|
+
)
|
|
91
|
+
SELECT created_on into queue_created_on from q;
|
|
92
|
+
|
|
93
|
+
IF queue_created_on IS NULL OR options->>'partition' IS DISTINCT FROM 'true' THEN
|
|
94
|
+
RETURN;
|
|
95
|
+
END IF;
|
|
96
|
+
|
|
97
|
+
EXECUTE format('CREATE TABLE ${schema}.%I (LIKE ${schema}.job INCLUDING DEFAULTS)', tablename);
|
|
98
|
+
|
|
99
|
+
EXECUTE format('ALTER TABLE ${schema}.%1$I ADD PRIMARY KEY (name, id)', tablename);
|
|
100
|
+
EXECUTE format('ALTER TABLE ${schema}.%1$I ADD CONSTRAINT q_fkey FOREIGN KEY (name) REFERENCES ${schema}.queue (name) ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED', tablename);
|
|
101
|
+
EXECUTE format('ALTER TABLE ${schema}.%1$I ADD CONSTRAINT dlq_fkey FOREIGN KEY (dead_letter) REFERENCES ${schema}.queue (name) ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED', tablename);
|
|
102
|
+
|
|
103
|
+
EXECUTE format('CREATE INDEX %1$s_i5 ON ${schema}.%1$I (name, start_after) INCLUDE (priority, created_on, id) WHERE state < ''active''', tablename);
|
|
104
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i4 ON ${schema}.%1$I (name, singleton_on, COALESCE(singleton_key, '''')) WHERE state <> ''cancelled'' AND singleton_on IS NOT NULL', tablename);
|
|
105
|
+
|
|
106
|
+
IF options->>'policy' = 'short' THEN
|
|
107
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i1 ON ${schema}.%1$I (name, COALESCE(singleton_key, '''')) WHERE state = ''created'' AND policy = ''short''', tablename);
|
|
108
|
+
ELSIF options->>'policy' = 'singleton' THEN
|
|
109
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i2 ON ${schema}.%1$I (name, COALESCE(singleton_key, '''')) WHERE state = ''active'' AND policy = ''singleton''', tablename);
|
|
110
|
+
ELSIF options->>'policy' = 'stately' THEN
|
|
111
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i3 ON ${schema}.%1$I (name, state, COALESCE(singleton_key, '''')) WHERE state <= ''active'' AND policy = ''stately''', tablename);
|
|
112
|
+
ELSIF options->>'policy' = 'exclusive' THEN
|
|
113
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i6 ON ${schema}.%1$I (name, COALESCE(singleton_key, '''')) WHERE state <= ''active'' AND policy = ''exclusive''', tablename);
|
|
114
|
+
END IF;
|
|
115
|
+
|
|
116
|
+
EXECUTE format('ALTER TABLE ${schema}.%I ADD CONSTRAINT cjc CHECK (name=%L)', tablename, queue_name);
|
|
117
|
+
EXECUTE format('ALTER TABLE ${schema}.job ATTACH PARTITION ${schema}.%I FOR VALUES IN (%L)', tablename, queue_name);
|
|
118
|
+
END;
|
|
119
|
+
$$
|
|
120
|
+
LANGUAGE plpgsql;
|
|
121
|
+
`,
|
|
122
|
+
`CREATE UNIQUE INDEX job_i6 ON ${schema}.job_common (name, COALESCE(singleton_key, '')) WHERE state <= 'active' AND policy = 'exclusive'`
|
|
123
|
+
],
|
|
124
|
+
uninstall: [
|
|
125
|
+
`DROP INDEX ${schema}.job_i6`
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
release: '12.6.0',
|
|
130
|
+
version: 27,
|
|
131
|
+
previous: 26,
|
|
132
|
+
install: [
|
|
133
|
+
`ALTER TABLE ${schema}.version ADD COLUMN IF NOT EXISTS bam_on timestamp with time zone`,
|
|
134
|
+
`
|
|
135
|
+
CREATE TABLE IF NOT EXISTS ${schema}.bam (
|
|
136
|
+
id uuid PRIMARY KEY default gen_random_uuid(),
|
|
137
|
+
name text NOT NULL,
|
|
138
|
+
version int NOT NULL,
|
|
139
|
+
status text NOT NULL DEFAULT 'pending',
|
|
140
|
+
queue text,
|
|
141
|
+
table_name text NOT NULL,
|
|
142
|
+
command text NOT NULL,
|
|
143
|
+
error text,
|
|
144
|
+
created_on timestamp with time zone NOT NULL DEFAULT now(),
|
|
145
|
+
started_on timestamp with time zone,
|
|
146
|
+
completed_on timestamp with time zone
|
|
147
|
+
)
|
|
148
|
+
`,
|
|
149
|
+
`CREATE FUNCTION ${schema}.job_table_format(command text, table_name text)
|
|
150
|
+
RETURNS text AS
|
|
151
|
+
$$
|
|
152
|
+
SELECT format(
|
|
153
|
+
replace(
|
|
154
|
+
replace(command, '.job', '.%1$I'),
|
|
155
|
+
'job_i', '%1$s_i'
|
|
156
|
+
),
|
|
157
|
+
table_name
|
|
158
|
+
);
|
|
159
|
+
$$
|
|
160
|
+
LANGUAGE sql IMMUTABLE;
|
|
161
|
+
`,
|
|
162
|
+
`
|
|
163
|
+
CREATE OR REPLACE FUNCTION ${schema}.job_table_run_async(command_name text, version int, command text, tbl_name text DEFAULT NULL, queue_name text DEFAULT NULL)
|
|
164
|
+
RETURNS VOID AS
|
|
165
|
+
$$
|
|
166
|
+
BEGIN
|
|
167
|
+
IF queue_name IS NOT NULL THEN
|
|
168
|
+
SELECT table_name INTO tbl_name FROM ${schema}.queue WHERE name = queue_name;
|
|
169
|
+
END IF;
|
|
170
|
+
|
|
171
|
+
IF tbl_name IS NOT NULL THEN
|
|
172
|
+
INSERT INTO ${schema}.bam (name, version, status, queue, table_name, command)
|
|
173
|
+
VALUES (
|
|
174
|
+
command_name,
|
|
175
|
+
version,
|
|
176
|
+
'pending',
|
|
177
|
+
queue_name,
|
|
178
|
+
tbl_name,
|
|
179
|
+
${schema}.job_table_format(command, tbl_name)
|
|
180
|
+
);
|
|
181
|
+
RETURN;
|
|
182
|
+
END IF;
|
|
183
|
+
|
|
184
|
+
INSERT INTO ${schema}.bam (name, version, status, queue, table_name, command)
|
|
185
|
+
SELECT
|
|
186
|
+
command_name,
|
|
187
|
+
version,
|
|
188
|
+
'pending',
|
|
189
|
+
NULL,
|
|
190
|
+
'job_common',
|
|
191
|
+
${schema}.job_table_format(command, 'job_common')
|
|
192
|
+
UNION ALL
|
|
193
|
+
SELECT
|
|
194
|
+
command_name,
|
|
195
|
+
version,
|
|
196
|
+
'pending',
|
|
197
|
+
queue.name,
|
|
198
|
+
queue.table_name,
|
|
199
|
+
${schema}.job_table_format(command, queue.table_name)
|
|
200
|
+
FROM ${schema}.queue
|
|
201
|
+
WHERE partition = true;
|
|
202
|
+
END;
|
|
203
|
+
$$
|
|
204
|
+
LANGUAGE plpgsql;
|
|
205
|
+
`,
|
|
206
|
+
`
|
|
207
|
+
CREATE OR REPLACE FUNCTION ${schema}.job_table_run(command text, tbl_name text DEFAULT NULL, queue_name text DEFAULT NULL)
|
|
208
|
+
RETURNS VOID AS
|
|
209
|
+
$$
|
|
210
|
+
DECLARE
|
|
211
|
+
tbl RECORD;
|
|
212
|
+
BEGIN
|
|
213
|
+
IF queue_name IS NOT NULL THEN
|
|
214
|
+
SELECT table_name INTO tbl_name FROM ${schema}.queue WHERE name = queue_name;
|
|
215
|
+
END IF;
|
|
216
|
+
|
|
217
|
+
IF tbl_name IS NOT NULL THEN
|
|
218
|
+
EXECUTE ${schema}.job_table_format(command, tbl_name);
|
|
219
|
+
RETURN;
|
|
220
|
+
END IF;
|
|
221
|
+
|
|
222
|
+
EXECUTE ${schema}.job_table_format(command, 'job_common');
|
|
223
|
+
|
|
224
|
+
FOR tbl IN SELECT table_name FROM ${schema}.queue WHERE partition = true
|
|
225
|
+
LOOP
|
|
226
|
+
EXECUTE ${schema}.job_table_format(command, tbl.table_name);
|
|
227
|
+
END LOOP;
|
|
228
|
+
END;
|
|
229
|
+
$$
|
|
230
|
+
LANGUAGE plpgsql;
|
|
231
|
+
`,
|
|
232
|
+
`ALTER TABLE ${schema}.job ADD COLUMN IF NOT EXISTS group_id text`,
|
|
233
|
+
`ALTER TABLE ${schema}.job ADD COLUMN IF NOT EXISTS group_tier text`,
|
|
234
|
+
`
|
|
235
|
+
CREATE OR REPLACE FUNCTION ${schema}.create_queue(queue_name text, options jsonb)
|
|
236
|
+
RETURNS VOID AS
|
|
237
|
+
$$
|
|
238
|
+
DECLARE
|
|
239
|
+
tablename varchar := CASE WHEN options->>'partition' = 'true'
|
|
240
|
+
THEN 'j' || encode(sha224(queue_name::bytea), 'hex')
|
|
241
|
+
ELSE 'job_common'
|
|
242
|
+
END;
|
|
243
|
+
queue_created_on timestamptz;
|
|
244
|
+
BEGIN
|
|
245
|
+
|
|
246
|
+
WITH q as (
|
|
247
|
+
INSERT INTO ${schema}.queue (
|
|
248
|
+
name,
|
|
249
|
+
policy,
|
|
250
|
+
retry_limit,
|
|
251
|
+
retry_delay,
|
|
252
|
+
retry_backoff,
|
|
253
|
+
retry_delay_max,
|
|
254
|
+
expire_seconds,
|
|
255
|
+
retention_seconds,
|
|
256
|
+
deletion_seconds,
|
|
257
|
+
warning_queued,
|
|
258
|
+
dead_letter,
|
|
259
|
+
partition,
|
|
260
|
+
table_name
|
|
261
|
+
)
|
|
262
|
+
VALUES (
|
|
263
|
+
queue_name,
|
|
264
|
+
options->>'policy',
|
|
265
|
+
COALESCE((options->>'retryLimit')::int, 2),
|
|
266
|
+
COALESCE((options->>'retryDelay')::int, 0),
|
|
267
|
+
COALESCE((options->>'retryBackoff')::bool, false),
|
|
268
|
+
(options->>'retryDelayMax')::int,
|
|
269
|
+
COALESCE((options->>'expireInSeconds')::int, 900),
|
|
270
|
+
COALESCE((options->>'retentionSeconds')::int, 1209600),
|
|
271
|
+
COALESCE((options->>'deleteAfterSeconds')::int, 604800),
|
|
272
|
+
COALESCE((options->>'warningQueueSize')::int, 0),
|
|
273
|
+
options->>'deadLetter',
|
|
274
|
+
COALESCE((options->>'partition')::bool, false),
|
|
275
|
+
tablename
|
|
276
|
+
)
|
|
277
|
+
ON CONFLICT DO NOTHING
|
|
278
|
+
RETURNING created_on
|
|
279
|
+
)
|
|
280
|
+
SELECT created_on into queue_created_on from q;
|
|
281
|
+
|
|
282
|
+
IF queue_created_on IS NULL OR options->>'partition' IS DISTINCT FROM 'true' THEN
|
|
283
|
+
RETURN;
|
|
284
|
+
END IF;
|
|
285
|
+
|
|
286
|
+
EXECUTE format('CREATE TABLE ${schema}.%I (LIKE ${schema}.job INCLUDING DEFAULTS)', tablename);
|
|
287
|
+
|
|
288
|
+
EXECUTE ${schema}.job_table_format($cmd$ALTER TABLE ${schema}.job ADD PRIMARY KEY (name, id)$cmd$, tablename);
|
|
289
|
+
EXECUTE ${schema}.job_table_format($cmd$ALTER TABLE ${schema}.job ADD CONSTRAINT q_fkey FOREIGN KEY (name) REFERENCES ${schema}.queue (name) ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED$cmd$, tablename);
|
|
290
|
+
EXECUTE ${schema}.job_table_format($cmd$ALTER TABLE ${schema}.job ADD CONSTRAINT dlq_fkey FOREIGN KEY (dead_letter) REFERENCES ${schema}.queue (name) ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED$cmd$, tablename);
|
|
291
|
+
|
|
292
|
+
EXECUTE ${schema}.job_table_format($cmd$CREATE INDEX job_i5 ON ${schema}.job (name, start_after) INCLUDE (priority, created_on, id) WHERE state < 'active'$cmd$, tablename);
|
|
293
|
+
EXECUTE ${schema}.job_table_format($cmd$CREATE UNIQUE INDEX job_i4 ON ${schema}.job (name, singleton_on, COALESCE(singleton_key, '')) WHERE state <> 'cancelled' AND singleton_on IS NOT NULL$cmd$, tablename);
|
|
294
|
+
EXECUTE ${schema}.job_table_format($cmd$CREATE INDEX job_i7 ON ${schema}.job (name, group_id) WHERE state = 'active' AND group_id IS NOT NULL$cmd$, tablename);
|
|
295
|
+
|
|
296
|
+
IF options->>'policy' = 'short' THEN
|
|
297
|
+
EXECUTE ${schema}.job_table_format($cmd$CREATE UNIQUE INDEX job_i1 ON ${schema}.job (name, COALESCE(singleton_key, '')) WHERE state = 'created' AND policy = 'short'$cmd$, tablename);
|
|
298
|
+
ELSIF options->>'policy' = 'singleton' THEN
|
|
299
|
+
EXECUTE ${schema}.job_table_format($cmd$CREATE UNIQUE INDEX job_i2 ON ${schema}.job (name, COALESCE(singleton_key, '')) WHERE state = 'active' AND policy = 'singleton'$cmd$, tablename);
|
|
300
|
+
ELSIF options->>'policy' = 'stately' THEN
|
|
301
|
+
EXECUTE ${schema}.job_table_format($cmd$CREATE UNIQUE INDEX job_i3 ON ${schema}.job (name, state, COALESCE(singleton_key, '')) WHERE state <= 'active' AND policy = 'stately'$cmd$, tablename);
|
|
302
|
+
ELSIF options->>'policy' = 'exclusive' THEN
|
|
303
|
+
EXECUTE ${schema}.job_table_format($cmd$CREATE UNIQUE INDEX job_i6 ON ${schema}.job (name, COALESCE(singleton_key, '')) WHERE state <= 'active' AND policy = 'exclusive'$cmd$, tablename);
|
|
304
|
+
END IF;
|
|
305
|
+
|
|
306
|
+
EXECUTE format('ALTER TABLE ${schema}.%I ADD CONSTRAINT cjc CHECK (name=%L)', tablename, queue_name);
|
|
307
|
+
EXECUTE format('ALTER TABLE ${schema}.job ATTACH PARTITION ${schema}.%I FOR VALUES IN (%L)', tablename, queue_name);
|
|
308
|
+
END;
|
|
309
|
+
$$
|
|
310
|
+
LANGUAGE plpgsql;
|
|
311
|
+
`,
|
|
312
|
+
`ALTER INDEX IF EXISTS ${schema}.job_i1 RENAME TO job_common_i1`,
|
|
313
|
+
`ALTER INDEX IF EXISTS ${schema}.job_i2 RENAME TO job_common_i2`,
|
|
314
|
+
`ALTER INDEX IF EXISTS ${schema}.job_i3 RENAME TO job_common_i3`,
|
|
315
|
+
`ALTER INDEX IF EXISTS ${schema}.job_i4 RENAME TO job_common_i4`,
|
|
316
|
+
`ALTER INDEX IF EXISTS ${schema}.job_i5 RENAME TO job_common_i5`,
|
|
317
|
+
`ALTER INDEX IF EXISTS ${schema}.job_i6 RENAME TO job_common_i6`,
|
|
318
|
+
`ALTER INDEX IF EXISTS ${schema}.job_i7 RENAME TO job_common_i7`
|
|
319
|
+
],
|
|
320
|
+
async: [
|
|
321
|
+
`SELECT ${schema}.job_table_run_async(
|
|
322
|
+
'group_concurency_index',
|
|
323
|
+
$VERSION$,
|
|
324
|
+
$$
|
|
325
|
+
CREATE INDEX CONCURRENTLY job_i7 ON ${schema}.job (name, group_id) WHERE state = 'active' AND group_id IS NOT NULL
|
|
326
|
+
$$
|
|
327
|
+
)`
|
|
328
|
+
],
|
|
329
|
+
uninstall: [
|
|
330
|
+
`ALTER INDEX ${schema}.job_common_i6 RENAME TO job_i6`,
|
|
331
|
+
`ALTER INDEX ${schema}.job_common_i5 RENAME TO job_i5`,
|
|
332
|
+
`ALTER INDEX ${schema}.job_common_i4 RENAME TO job_i4`,
|
|
333
|
+
`ALTER INDEX ${schema}.job_common_i3 RENAME TO job_i3`,
|
|
334
|
+
`ALTER INDEX ${schema}.job_common_i2 RENAME TO job_i2`,
|
|
335
|
+
`ALTER INDEX ${schema}.job_common_i1 RENAME TO job_i1`,
|
|
336
|
+
`SELECT ${schema}.job_table_run('DROP INDEX ${schema}.job_i7')`,
|
|
337
|
+
`
|
|
338
|
+
CREATE OR REPLACE FUNCTION ${schema}.create_queue(queue_name text, options jsonb)
|
|
339
|
+
RETURNS VOID AS
|
|
340
|
+
$$
|
|
341
|
+
DECLARE
|
|
342
|
+
tablename varchar := CASE WHEN options->>'partition' = 'true'
|
|
343
|
+
THEN 'j' || encode(sha224(queue_name::bytea), 'hex')
|
|
344
|
+
ELSE 'job_common'
|
|
345
|
+
END;
|
|
346
|
+
queue_created_on timestamptz;
|
|
347
|
+
BEGIN
|
|
348
|
+
|
|
349
|
+
WITH q as (
|
|
350
|
+
INSERT INTO ${schema}.queue (
|
|
351
|
+
name,
|
|
352
|
+
policy,
|
|
353
|
+
retry_limit,
|
|
354
|
+
retry_delay,
|
|
355
|
+
retry_backoff,
|
|
356
|
+
retry_delay_max,
|
|
357
|
+
expire_seconds,
|
|
358
|
+
retention_seconds,
|
|
359
|
+
deletion_seconds,
|
|
360
|
+
warning_queued,
|
|
361
|
+
dead_letter,
|
|
362
|
+
partition,
|
|
363
|
+
table_name
|
|
364
|
+
)
|
|
365
|
+
VALUES (
|
|
366
|
+
queue_name,
|
|
367
|
+
options->>'policy',
|
|
368
|
+
COALESCE((options->>'retryLimit')::int, 2),
|
|
369
|
+
COALESCE((options->>'retryDelay')::int, 0),
|
|
370
|
+
COALESCE((options->>'retryBackoff')::bool, false),
|
|
371
|
+
(options->>'retryDelayMax')::int,
|
|
372
|
+
COALESCE((options->>'expireInSeconds')::int, 900),
|
|
373
|
+
COALESCE((options->>'retentionSeconds')::int, 1209600),
|
|
374
|
+
COALESCE((options->>'deleteAfterSeconds')::int, 604800),
|
|
375
|
+
COALESCE((options->>'warningQueueSize')::int, 0),
|
|
376
|
+
options->>'deadLetter',
|
|
377
|
+
COALESCE((options->>'partition')::bool, false),
|
|
378
|
+
tablename
|
|
379
|
+
)
|
|
380
|
+
ON CONFLICT DO NOTHING
|
|
381
|
+
RETURNING created_on
|
|
382
|
+
)
|
|
383
|
+
SELECT created_on into queue_created_on from q;
|
|
384
|
+
|
|
385
|
+
IF queue_created_on IS NULL OR options->>'partition' IS DISTINCT FROM 'true' THEN
|
|
386
|
+
RETURN;
|
|
387
|
+
END IF;
|
|
388
|
+
|
|
389
|
+
EXECUTE format('CREATE TABLE ${schema}.%I (LIKE ${schema}.job INCLUDING DEFAULTS)', tablename);
|
|
390
|
+
|
|
391
|
+
EXECUTE format('ALTER TABLE ${schema}.%1$I ADD PRIMARY KEY (name, id)', tablename);
|
|
392
|
+
EXECUTE format('ALTER TABLE ${schema}.%1$I ADD CONSTRAINT q_fkey FOREIGN KEY (name) REFERENCES ${schema}.queue (name) ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED', tablename);
|
|
393
|
+
EXECUTE format('ALTER TABLE ${schema}.%1$I ADD CONSTRAINT dlq_fkey FOREIGN KEY (dead_letter) REFERENCES ${schema}.queue (name) ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED', tablename);
|
|
394
|
+
|
|
395
|
+
EXECUTE format('CREATE INDEX %1$s_i5 ON ${schema}.%1$I (name, start_after) INCLUDE (priority, created_on, id) WHERE state < ''active''', tablename);
|
|
396
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i4 ON ${schema}.%1$I (name, singleton_on, COALESCE(singleton_key, '''')) WHERE state <> ''cancelled'' AND singleton_on IS NOT NULL', tablename);
|
|
397
|
+
|
|
398
|
+
IF options->>'policy' = 'short' THEN
|
|
399
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i1 ON ${schema}.%1$I (name, COALESCE(singleton_key, '''')) WHERE state = ''created'' AND policy = ''short''', tablename);
|
|
400
|
+
ELSIF options->>'policy' = 'singleton' THEN
|
|
401
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i2 ON ${schema}.%1$I (name, COALESCE(singleton_key, '''')) WHERE state = ''active'' AND policy = ''singleton''', tablename);
|
|
402
|
+
ELSIF options->>'policy' = 'stately' THEN
|
|
403
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i3 ON ${schema}.%1$I (name, state, COALESCE(singleton_key, '''')) WHERE state <= ''active'' AND policy = ''stately''', tablename);
|
|
404
|
+
ELSIF options->>'policy' = 'exclusive' THEN
|
|
405
|
+
EXECUTE format('CREATE UNIQUE INDEX %1$s_i6 ON ${schema}.%1$I (name, COALESCE(singleton_key, '''')) WHERE state <= ''active'' AND policy = ''exclusive''', tablename);
|
|
406
|
+
END IF;
|
|
407
|
+
|
|
408
|
+
EXECUTE format('ALTER TABLE ${schema}.%I ADD CONSTRAINT cjc CHECK (name=%L)', tablename, queue_name);
|
|
409
|
+
EXECUTE format('ALTER TABLE ${schema}.job ATTACH PARTITION ${schema}.%I FOR VALUES IN (%L)', tablename, queue_name);
|
|
410
|
+
END;
|
|
411
|
+
$$
|
|
412
|
+
LANGUAGE plpgsql;
|
|
413
|
+
`,
|
|
414
|
+
`DROP FUNCTION ${schema}.job_table_run(text, text, text)`,
|
|
415
|
+
`DROP FUNCTION ${schema}.job_table_run_async(text, int, text, text, text)`,
|
|
416
|
+
`DROP FUNCTION ${schema}.job_table_format(text, text)`,
|
|
417
|
+
`DROP TABLE ${schema}.bam`,
|
|
418
|
+
`ALTER TABLE ${schema}.version DROP COLUMN bam_on`,
|
|
419
|
+
`ALTER TABLE ${schema}.job DROP COLUMN group_tier`,
|
|
420
|
+
`ALTER TABLE ${schema}.job DROP COLUMN group_id`
|
|
421
|
+
]
|
|
422
|
+
}
|
|
423
|
+
];
|
|
424
|
+
}
|
|
425
|
+
export { rollback, next, migrate, getAll, };
|
package/dist/plans.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { UpdateQueueOptions } from './types.ts';
|
|
2
|
+
export interface SqlQuery {
|
|
3
|
+
text: string;
|
|
4
|
+
values: unknown[];
|
|
5
|
+
}
|
|
6
|
+
declare const DEFAULT_SCHEMA = "pgboss";
|
|
7
|
+
declare const MIGRATE_RACE_MESSAGE = "division by zero";
|
|
8
|
+
declare const CREATE_RACE_MESSAGE = "already exists";
|
|
9
|
+
declare const JOB_STATES: Readonly<{
|
|
10
|
+
created: "created";
|
|
11
|
+
retry: "retry";
|
|
12
|
+
active: "active";
|
|
13
|
+
completed: "completed";
|
|
14
|
+
cancelled: "cancelled";
|
|
15
|
+
failed: "failed";
|
|
16
|
+
}>;
|
|
17
|
+
declare const QUEUE_POLICIES: Readonly<{
|
|
18
|
+
standard: "standard";
|
|
19
|
+
short: "short";
|
|
20
|
+
singleton: "singleton";
|
|
21
|
+
stately: "stately";
|
|
22
|
+
exclusive: "exclusive";
|
|
23
|
+
}>;
|
|
24
|
+
declare function create(schema: string, version: number, options?: {
|
|
25
|
+
createSchema?: boolean;
|
|
26
|
+
}): string;
|
|
27
|
+
declare function createQueue(schema: string, name: string, options: unknown): string;
|
|
28
|
+
declare function deleteQueue(schema: string, name: string): string;
|
|
29
|
+
declare function trySetQueueMonitorTime(schema: string, queues: string[], seconds: number): SqlQuery;
|
|
30
|
+
declare function trySetQueueDeletionTime(schema: string, queues: string[], seconds: number): SqlQuery;
|
|
31
|
+
declare function trySetCronTime(schema: string, seconds: number): string;
|
|
32
|
+
declare function trySetBamTime(schema: string, seconds: number): string;
|
|
33
|
+
declare function updateQueue(schema: string, { deadLetter }?: UpdateQueueOptions): string;
|
|
34
|
+
declare function getQueues(schema: string, names?: string[]): SqlQuery;
|
|
35
|
+
declare function deleteJobsById(schema: string, table: string): string;
|
|
36
|
+
declare function deleteQueuedJobs(schema: string, table: string): string;
|
|
37
|
+
declare function deleteStoredJobs(schema: string, table: string): string;
|
|
38
|
+
declare function truncateTable(schema: string, table: string): string;
|
|
39
|
+
declare function deleteAllJobs(schema: string, table: string): string;
|
|
40
|
+
declare function getSchedules(schema: string): string;
|
|
41
|
+
declare function getSchedulesByQueue(schema: string): string;
|
|
42
|
+
declare function schedule(schema: string): string;
|
|
43
|
+
declare function unschedule(schema: string): string;
|
|
44
|
+
declare function subscribe(schema: string): string;
|
|
45
|
+
declare function unsubscribe(schema: string): string;
|
|
46
|
+
declare function getQueuesForEvent(schema: string): string;
|
|
47
|
+
declare function getTime(): string;
|
|
48
|
+
declare function getVersion(schema: string): string;
|
|
49
|
+
declare function setVersion(schema: string, version: number): string;
|
|
50
|
+
declare function versionTableExists(schema: string): string;
|
|
51
|
+
declare function insertVersion(schema: string, version: number): string;
|
|
52
|
+
interface GroupConcurrencyConfig {
|
|
53
|
+
default: number;
|
|
54
|
+
tiers?: Record<string, number>;
|
|
55
|
+
}
|
|
56
|
+
interface FetchJobOptions {
|
|
57
|
+
schema: string;
|
|
58
|
+
table: string;
|
|
59
|
+
name: string;
|
|
60
|
+
policy: string | undefined;
|
|
61
|
+
limit: number;
|
|
62
|
+
includeMetadata?: boolean;
|
|
63
|
+
priority?: boolean;
|
|
64
|
+
orderByCreatedOn?: boolean;
|
|
65
|
+
ignoreStartAfter?: boolean;
|
|
66
|
+
ignoreSingletons: string[] | null;
|
|
67
|
+
ignoreGroups?: string[] | null;
|
|
68
|
+
groupConcurrency?: number | GroupConcurrencyConfig;
|
|
69
|
+
}
|
|
70
|
+
declare function fetchNextJob(options: FetchJobOptions): SqlQuery;
|
|
71
|
+
declare function completeJobs(schema: string, table: string): string;
|
|
72
|
+
declare function cancelJobs(schema: string, table: string): string;
|
|
73
|
+
declare function resumeJobs(schema: string, table: string): string;
|
|
74
|
+
declare function restoreJobs(schema: string, table: string): string;
|
|
75
|
+
interface InsertJobsOptions {
|
|
76
|
+
table: string;
|
|
77
|
+
name: string;
|
|
78
|
+
returnId?: boolean;
|
|
79
|
+
}
|
|
80
|
+
declare function insertJobs(schema: string, { table, name, returnId }: InsertJobsOptions): string;
|
|
81
|
+
declare function failJobsById(schema: string, table: string): string;
|
|
82
|
+
declare function failJobsByTimeout(schema: string, table: string, queues: string[]): string;
|
|
83
|
+
declare function deletion(schema: string, table: string, queues: string[]): string;
|
|
84
|
+
declare function retryJobs(schema: string, table: string): string;
|
|
85
|
+
declare function getQueueStats(schema: string, table: string, queues: string[]): SqlQuery;
|
|
86
|
+
declare function cacheQueueStats(schema: string, table: string, queues: string[]): string;
|
|
87
|
+
declare function locked(schema: string, query: string | string[], key?: string): string;
|
|
88
|
+
declare function assertMigration(schema: string, version: number): string;
|
|
89
|
+
declare function findJobs(schema: string, table: string, options: {
|
|
90
|
+
queued: boolean;
|
|
91
|
+
byKey: boolean;
|
|
92
|
+
byData: boolean;
|
|
93
|
+
byId: boolean;
|
|
94
|
+
}): string;
|
|
95
|
+
declare function getJobById(schema: string, table: string): string;
|
|
96
|
+
declare function getNextBamCommand(schema: string): string;
|
|
97
|
+
declare function setBamCompleted(schema: string, id: string): string;
|
|
98
|
+
declare function setBamFailed(schema: string, id: string, error: string): string;
|
|
99
|
+
declare function getBamStatus(schema: string): string;
|
|
100
|
+
declare function getBamEntries(schema: string): string;
|
|
101
|
+
export { create, insertVersion, getVersion, setVersion, versionTableExists, fetchNextJob, completeJobs, cancelJobs, resumeJobs, restoreJobs, retryJobs, findJobs, deleteJobsById, deleteAllJobs, deleteQueuedJobs, deleteStoredJobs, truncateTable, failJobsById, failJobsByTimeout, insertJobs, getTime, getSchedules, getSchedulesByQueue, schedule, unschedule, subscribe, unsubscribe, getQueuesForEvent, deletion, cacheQueueStats, updateQueue, createQueue, deleteQueue, getQueues, getQueueStats, trySetQueueMonitorTime, trySetQueueDeletionTime, trySetCronTime, trySetBamTime, locked, assertMigration, getJobById, getNextBamCommand, setBamCompleted, setBamFailed, getBamStatus, getBamEntries, QUEUE_POLICIES, JOB_STATES, MIGRATE_RACE_MESSAGE, CREATE_RACE_MESSAGE, DEFAULT_SCHEMA, };
|
|
102
|
+
//# sourceMappingURL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