@pgpm/database-jobs 0.5.0 → 0.7.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.
package/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @pgpm/database-jobs
|
|
2
2
|
|
|
3
|
+
<p align="center" width="100%">
|
|
4
|
+
<img height="250" src="https://raw.githubusercontent.com/launchql/launchql/refs/heads/main/assets/outline-logo.svg" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center" width="100%">
|
|
8
|
+
<a href="https://github.com/launchql/pgpm-modules/actions/workflows/ci.yml">
|
|
9
|
+
<img height="20" src="https://github.com/launchql/pgpm-modules/actions/workflows/ci.yml/badge.svg" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://github.com/launchql/pgpm-modules/blob/main/LICENSE"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@pgpm/database-jobs"><img height="20" src="https://img.shields.io/github/package-json/v/launchql/pgpm-modules?filename=packages%2Fjobs%2Fdatabase-jobs%2Fpackage.json"/></a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
3
15
|
Database-specific job handling and queue management.
|
|
4
16
|
|
|
5
17
|
## Overview
|
|
@@ -31,40 +43,42 @@ This is a quick way to get started. The sections below provide more detailed ins
|
|
|
31
43
|
### Prerequisites
|
|
32
44
|
|
|
33
45
|
```bash
|
|
34
|
-
# Install pgpm
|
|
46
|
+
# Install pgpm CLI
|
|
35
47
|
npm install -g pgpm
|
|
36
48
|
|
|
37
|
-
# Start
|
|
49
|
+
# Start local Postgres (via Docker) and export env vars
|
|
38
50
|
pgpm docker start
|
|
39
|
-
|
|
40
|
-
# Set environment variables
|
|
41
51
|
eval "$(pgpm env)"
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
|
|
54
|
+
> **Tip:** Already running Postgres? Skip the Docker step and just export your `PG*` environment variables.
|
|
45
55
|
|
|
46
|
-
|
|
56
|
+
### **Add to an Existing Package**
|
|
47
57
|
|
|
48
58
|
```bash
|
|
59
|
+
# 1. Install the package
|
|
49
60
|
pgpm install @pgpm/database-jobs
|
|
50
|
-
|
|
61
|
+
|
|
62
|
+
# 2. Deploy locally
|
|
63
|
+
pgpm deploy
|
|
51
64
|
```
|
|
52
65
|
|
|
53
|
-
|
|
66
|
+
### **Add to a New Project**
|
|
54
67
|
|
|
55
68
|
```bash
|
|
56
|
-
|
|
57
|
-
pgpm
|
|
58
|
-
|
|
69
|
+
# 1. Create a workspace
|
|
70
|
+
pgpm init --workspace
|
|
71
|
+
cd my-app
|
|
59
72
|
|
|
60
|
-
|
|
73
|
+
# 2. Create your first module
|
|
74
|
+
pgpm init
|
|
75
|
+
cd packages/your-module
|
|
61
76
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
pgpm install
|
|
77
|
+
# 3. Install a package
|
|
78
|
+
pgpm install @pgpm/database-jobs
|
|
65
79
|
|
|
66
|
-
# Deploy
|
|
67
|
-
pgpm deploy
|
|
80
|
+
# 4. Deploy everything
|
|
81
|
+
pgpm deploy --createdb --database mydb1
|
|
68
82
|
```
|
|
69
83
|
|
|
70
84
|
## Core Concepts
|
|
@@ -332,76 +346,6 @@ The test suite validates:
|
|
|
332
346
|
- Job key upsert semantics
|
|
333
347
|
- Worker locking and concurrency
|
|
334
348
|
|
|
335
|
-
## Development
|
|
336
|
-
|
|
337
|
-
See the [Development](#development) section below for information on working with this package.
|
|
338
|
-
|
|
339
|
-
---
|
|
340
|
-
|
|
341
|
-
## Development
|
|
342
|
-
|
|
343
|
-
### **Before You Begin**
|
|
344
|
-
|
|
345
|
-
```bash
|
|
346
|
-
# 1. Install pgpm
|
|
347
|
-
npm install -g pgpm
|
|
348
|
-
|
|
349
|
-
# 2. Start Postgres (Docker or local)
|
|
350
|
-
pgpm docker start
|
|
351
|
-
|
|
352
|
-
# 3. Load PG* environment variables (PGHOST, PGUSER, ...)
|
|
353
|
-
eval "$(pgpm env)"
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
---
|
|
357
|
-
|
|
358
|
-
### **Starting a New Project**
|
|
359
|
-
|
|
360
|
-
```bash
|
|
361
|
-
# 1. Create a workspace
|
|
362
|
-
pgpm init --workspace
|
|
363
|
-
cd my-app
|
|
364
|
-
|
|
365
|
-
# 2. Create your first module
|
|
366
|
-
pgpm init
|
|
367
|
-
|
|
368
|
-
# 3. Add a migration
|
|
369
|
-
pgpm add some_change
|
|
370
|
-
|
|
371
|
-
# 4. Deploy (auto-creates database)
|
|
372
|
-
pgpm deploy --createdb
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
---
|
|
376
|
-
|
|
377
|
-
### **Working With an Existing Project**
|
|
378
|
-
|
|
379
|
-
```bash
|
|
380
|
-
# 1. Clone and enter the project
|
|
381
|
-
git clone <repo> && cd <project>
|
|
382
|
-
|
|
383
|
-
# 2. Install dependencies
|
|
384
|
-
pnpm install
|
|
385
|
-
|
|
386
|
-
# 3. Deploy locally
|
|
387
|
-
pgpm deploy --createdb
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
---
|
|
391
|
-
|
|
392
|
-
### **Testing a Module Inside a Workspace**
|
|
393
|
-
|
|
394
|
-
```bash
|
|
395
|
-
# 1. Install workspace deps
|
|
396
|
-
pnpm install
|
|
397
|
-
|
|
398
|
-
# 2. Enter the module directory
|
|
399
|
-
cd packages/<some-module>
|
|
400
|
-
|
|
401
|
-
# 3. Run tests in watch mode
|
|
402
|
-
pnpm test:watch
|
|
403
|
-
```
|
|
404
|
-
|
|
405
349
|
## Related Tooling
|
|
406
350
|
|
|
407
351
|
* [pgpm](https://github.com/launchql/launchql/tree/main/packages/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# launchql-database-jobs extension
|
|
2
2
|
comment = 'launchql-database-jobs extension'
|
|
3
|
-
default_version = '0.
|
|
3
|
+
default_version = '0.6.0'
|
|
4
4
|
module_pathname = '$libdir/launchql-database-jobs'
|
|
5
5
|
requires = 'plpgsql,uuid-ossp,pgcrypto,launchql-default-roles,launchql-verify'
|
|
6
6
|
relocatable = false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/database-jobs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Database-specific job handling and queue management",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"pgpm": "^0.2.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pgpm/default-roles": "0.
|
|
18
|
-
"@pgpm/verify": "0.
|
|
17
|
+
"@pgpm/default-roles": "0.7.0",
|
|
18
|
+
"@pgpm/verify": "0.7.0"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "https://github.com/launchql/
|
|
22
|
+
"url": "https://github.com/launchql/pgpm-modules"
|
|
23
23
|
},
|
|
24
|
-
"homepage": "https://github.com/launchql/
|
|
24
|
+
"homepage": "https://github.com/launchql/pgpm-modules",
|
|
25
25
|
"bugs": {
|
|
26
|
-
"url": "https://github.com/launchql/
|
|
26
|
+
"url": "https://github.com/launchql/pgpm-modules/issues"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "1f24d8fa95fb141f16e5b8345458c3b687d80908"
|
|
29
29
|
}
|
|
File without changes
|