Comparing version 0.3.1 to 0.3.2
@@ -146,2 +146,3 @@ // Generated by dts-bundle-generator v9.5.1 | ||
readonly database: Kysely<DB>; | ||
private pool; | ||
private jobDefinitions; | ||
@@ -155,2 +156,3 @@ private eventHandler; | ||
}); | ||
migrate(): Promise<void>; | ||
deploy(): Promise<void>; | ||
@@ -157,0 +159,0 @@ onEvent(event: CuckEvent): void; |
{ | ||
"name": "cuckmq", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"author": "tlonny", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -46,14 +46,3 @@ <div align="center"> | ||
We must ensure the database is ready to persist job state. `cuckmq` creates tables, indices and stores data under the `_cuckmq` schema, to avoid namespace collisions with app tables. | ||
This is achieved by using the `Migrator`, which runs an **idempotent** migration function. We can call this as part of our build step, or during app initialization: | ||
```typescript | ||
import { Migrator } from "cuckmq" | ||
import { Pool } from "pg" | ||
const pool = new Pool({ connectionString: process.env.DATABASE_URL as string }) | ||
await new Migrator(pool).migrate() | ||
``` | ||
## Usage | ||
@@ -101,2 +90,12 @@ | ||
### Migrating | ||
We must ensure the database is ready to persist job state. `cuckmq` creates tables, indices and stores data under the `_cuckmq` schema, to avoid namespace collisions with app tables. | ||
This is achieved by calling the **idempotent** `Context#migrate` function. We can call this as part of our build step, or during app initialization: | ||
```typescript | ||
await context.migrate() | ||
``` | ||
### Deploying | ||
@@ -103,0 +102,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
168441
782
185