Add @effect/sql-pglite package
Type
- [ ] Refactor
- [x] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
Description
Add @effect/sql-pglite package. An @effect/sql driver for PGlite, single user postgresql in the browser or node.
Related
- Related Issue #
- Closes #
🦋 Changeset detected
Latest commit: ad8a7ae6df190eca3726d4fe8ca3a492733408b4
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @effect/sql-pglite | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Not sure why the lint and docgen failed, they pass on my branch locally.
@evelant, thanks for doing this! Have been looking for a solution to write tests against. Not gotten a chance to fully try it out yet, but figured I could help unblock the pipeline failures to hopefully get this in sooner.
To fix the codegen, run pnpm codegen. It fixes some doc comments.
To fix the docgen, add this to your docgen.json.
{
...,
"examplesCompilerOptions": {
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"moduleResolution": "Bundler",
"module": "ES2022",
"target": "ES2022",
"lib": ["ES2022", "DOM"],
"paths": {
"@effect/experimental": ["../../../experimental/src/index.js"],
"@effect/experimental/*": ["../../../experimental/src/*.js"],
"@effect/platform": ["../../../platform/src/index.js"],
"@effect/platform/*": ["../../../platform/src/*.js"],
"@effect/sql": ["../../../sql/src/index.js"],
"@effect/sql/*": ["../../../sql/src/*.js"],
"effect": ["../../../effect/src/index.js"],
"effect/*": ["../../../effect/src/*.js"]
}
}
}
Ohter feedback:
- Some of the json has inconsistent formatting which can be fixed with
pnpm prettier packages/sql-pglite/**/*.json -w. - Missing entry in the root
/docs/index.md. - (Opinion) Instead of
PgLite, would it make more sense to follow the naming ofSqlite, soPglite. If it isPgLite, the camel to kabob conversion I think would make the package namesql-pg-lite.
Thanks for the feedback! I've had to put down my side project using pglite for now but as soon as I can find time I'll update the PR. As for the naming it's extra confusing because PGlite uses PGlite not Pglite or PgLite. I think my fingers just typed PgLite out of habit haha. I think you're right, probably best to change it to Pglite to match Sqlite. Ah I see how the formatting got a little off too -- prettier plugin in vscode auto-formatting on save.
I finally got around to cleaning this up. Sorry for the long delay!
Any more changes needed or can this be merged now?
I think you probably have to ask Tim for a review manually. Because on my PR, where I had a lot of changes to SQL packages, he was automatically attached as per the CODEOWNERS file, while it seems this automation doesn't work when you are adding a completely new SQL-related package. Maybe you have to even add a new row there
@tim-smart Whenever you get a chance I'd appreciate your feedback on this so I can make any necessary changes, thanks!
This is especially needed now that @effect/sql-pg uses pg instead of postgres, and has lost support for the socket configuration option, which I was previously using to integrate with pglite for integration-testing database code.
Sorry I dropped the ball on finishing this PR. I'll pick it up again ASAP.