-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
feature: add cloudflare @effect/sql-d1 package #3045
Conversation
🦋 Changeset detectedLatest commit: 6444a3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Maybe we need a "batch" api in sql to support batch transactions? |
a batch api would just be the transaction api without injecting markers between statements, though I don't think all dbs support batching in this way. For example mssql doesn't lol |
no, a batching api would allow us to specify a number of sql statements in a single shot, every sql database that supports transactions also supports such batching api. example: sql.batchTx(
sql`SELECT ...`,
sql`INSERT ...`,
sql`DELETE...`
) the execution can send a single batch to dbs that support it or simply run a |
note that this is also common of products that put http apis on top of databases, while I believe this is a bad practice and that such dbs can't be used in most of the use cases where you'd need a transaction we should probably still support it. @tim-smart we have to decide though what to do with the
|
@mikearnaldi added first suggestion for now. it defects when using transactions. |
The more user-friendly choice is no-op and warn, but it might come as a surprise to the user |
My fear is that |
Same here |
b93b4d5
to
6589289
Compare
6320084
to
6e35798
Compare
6589289
to
0ce7594
Compare
6e35798
to
cf6f1b9
Compare
0ce7594
to
4ea9615
Compare
cf6f1b9
to
5efbec5
Compare
4ea9615
to
49e5bef
Compare
5efbec5
to
af2c37d
Compare
49e5bef
to
ae16809
Compare
af2c37d
to
462931d
Compare
ae16809
to
557cb53
Compare
Type
Description
Add a cloudflare D1 sqlite client. D1 don't support transactions directly (only batches).
Since it was asked multiple times for it to be supported
Tests
Tests are using miniflare to have a local D1 instance