Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5df5678
Add ChronoPostgresDatastore implementation
tjamescouch Jan 27, 2026
03eda55
prettify
tjamescouch Jan 27, 2026
ef30e5a
Refactor to use TypeORM QueryBuilder instead of raw SQL
tjamescouch Jan 27, 2026
1d73f8d
Extract mock DataSource helpers to separate file
tjamescouch Jan 27, 2026
bacd330
Refactor test helpers into modular, readable files
tjamescouch Jan 27, 2026
47c6f0a
add cleanup handling
tjamescouch Jan 28, 2026
c7b8ca4
Replace mock-based tests with real Postgres tests
tjamescouch Jan 28, 2026
ac3ddfc
Remove testAccessor hack now that we have real Postgres tests
tjamescouch Jan 28, 2026
51931fb
Simplify claimedAt reset to use null instead of raw SQL
tjamescouch Jan 28, 2026
9ef562a
Add comprehensive test coverage for postgres datastore
tjamescouch Jan 28, 2026
10c1122
chore(chrono-postgres-datastore): move typeorm to peerDependencies only
tjamescouch Jan 28, 2026
78c6c0d
feat(chrono-postgres-datastore): add initialization timeout to preven…
tjamescouch Jan 28, 2026
52d37d9
update package json
tjamescouch Jan 28, 2026
0a05dd9
fix(chrono-postgres-datastore): resolve biome lint warnings
tjamescouch Jan 28, 2026
66cd962
fix(chrono-postgres-datastore): remove lastExecutedAt from retry()
tjamescouch Jan 30, 2026
30d0a62
declaration setting moved up
tjamescouch Jan 30, 2026
41b5ebb
refactor(chrono-postgres-datastore): replace TypeORM with raw pg library
tjamescouch Jan 30, 2026
0896d13
refactor(chrono-postgres-datastore): simplify queries with subqueries
tjamescouch Jan 30, 2026
4c05a35
chore(chrono-postgres-datastore): add test tsconfig for typecheck
tjamescouch Jan 30, 2026
512606e
refactor: use getQueryable consistently for all database operations
tjamescouch Feb 2, 2026
b9c11fd
chore: update CI postgres image to 17 and bump alpha version
tjamescouch Feb 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into alternatives to testing with real postgres. I tried PGLite but it was not good with TypeORM and defeated the purpose of the tests.

services:
postgres:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chrono_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5

steps:
- name: Perform source code checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -54,3 +69,5 @@ jobs:
- name: Test
run: pnpm test
if: github.ref != 'refs/heads/master'
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/chrono_test
1 change: 1 addition & 0 deletions packages/chrono-core/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default defineConfig({
format: ['esm', 'cjs'],
outDir: './build',
sourcemap: true,
hash: false,
});
1 change: 1 addition & 0 deletions packages/chrono-memory-datastore/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default defineConfig({
format: ['esm', 'cjs'],
outDir: './build',
sourcemap: true,
hash: false,
});
1 change: 1 addition & 0 deletions packages/chrono-mongo-datastore/tsdown.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default defineConfig({
format: ['esm', 'cjs'],
outDir: './build',
sourcemap: true,
hash: false,
});
52 changes: 52 additions & 0 deletions packages/chrono-postgres-datastore/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@neofinancial/chrono-postgres-datastore",
"version": "0.5.2-alpha.2",
"description": "PostgreSQL datastore implementation for Chrono task scheduling system",
"private": false,
"publishConfig": {
"access": "public"
},
"homepage": "https://github.com/neofinancial/chrono",
"repository": {
"type": "git",
"url": "https://github.com/neofinancial/chrono.git"
},
"main": "./build/index.js",
"module": "./build/index.mjs",
"types": "./build/index.d.ts",
"exports": {
".": {
"import": {
"types": "./build/index.d.mts",
"default": "./build/index.mjs"
},
"require": {
"types": "./build/index.d.ts",
"default": "./build/index.js"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these seem wrong

}
}
},
"keywords": [],
"author": "Neo Financial Engineering <engineering@neofinancial.com>",
"license": "MIT",
"files": [
"build/**",
"README.md"
],
"scripts": {
"clean": "rimraf ./build",
"build": "tsdown",
"typecheck": "tsc -p ./tsconfig.json --noEmit && tsc -p ./test/tsconfig.json --noEmit",
"test": "NODE_ENV=test TZ=UTC vitest run"
},
"dependencies": {
"pg": "^8.13.1"
},
"devDependencies": {
"@neofinancial/chrono": "workspace:*",
"@types/pg": "^8.11.0"
},
"peerDependencies": {
"@neofinancial/chrono": ">=0.5.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"@neofinancial/chrono": ">=0.5.0"
"@neofinancial/chrono": "workspace:*"

for now.

}
}
Loading