-
Notifications
You must be signed in to change notification settings - Fork 1
Add ChronoPostgresDatastore implementation #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tjamescouch
wants to merge
21
commits into
master
Choose a base branch
from
postgres-datastore
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5df5678
Add ChronoPostgresDatastore implementation
tjamescouch 03eda55
prettify
tjamescouch ef30e5a
Refactor to use TypeORM QueryBuilder instead of raw SQL
tjamescouch 1d73f8d
Extract mock DataSource helpers to separate file
tjamescouch bacd330
Refactor test helpers into modular, readable files
tjamescouch 47c6f0a
add cleanup handling
tjamescouch c7b8ca4
Replace mock-based tests with real Postgres tests
tjamescouch ac3ddfc
Remove testAccessor hack now that we have real Postgres tests
tjamescouch 51931fb
Simplify claimedAt reset to use null instead of raw SQL
tjamescouch 9ef562a
Add comprehensive test coverage for postgres datastore
tjamescouch 10c1122
chore(chrono-postgres-datastore): move typeorm to peerDependencies only
tjamescouch 78c6c0d
feat(chrono-postgres-datastore): add initialization timeout to preven…
tjamescouch 52d37d9
update package json
tjamescouch 0a05dd9
fix(chrono-postgres-datastore): resolve biome lint warnings
tjamescouch 66cd962
fix(chrono-postgres-datastore): remove lastExecutedAt from retry()
tjamescouch 30d0a62
declaration setting moved up
tjamescouch 41b5ebb
refactor(chrono-postgres-datastore): replace TypeORM with raw pg library
tjamescouch 0896d13
refactor(chrono-postgres-datastore): simplify queries with subqueries
tjamescouch 4c05a35
chore(chrono-postgres-datastore): add test tsconfig for typecheck
tjamescouch 512606e
refactor: use getQueryable consistently for all database operations
tjamescouch b9c11fd
chore: update CI postgres image to 17 and bump alpha version
tjamescouch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,5 @@ export default defineConfig({ | |
| format: ['esm', 'cjs'], | ||
| outDir: './build', | ||
| sourcemap: true, | ||
| hash: false, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these seem wrong |
||||||
| } | ||||||
| } | ||||||
| }, | ||||||
tjamescouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| "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" | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
for now. |
||||||
| } | ||||||
| } | ||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.