Skip to content
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

use simpler batch input #255

Merged
merged 6 commits into from
Sep 26, 2024
Merged

use simpler batch input #255

merged 6 commits into from
Sep 26, 2024

Conversation

notrab
Copy link
Member

@notrab notrab commented Aug 28, 2024

Closes #251

@penberg I didn't yet touch sqlite3.ts because updating that might break the compatibility... I'm not sure, wdyt?

Hopefully we can refactor these classes at some point so we don't have to duplicate so much 😅

@notrab notrab requested a review from penberg August 28, 2024 10:18
@penberg
Copy link
Contributor

penberg commented Aug 28, 2024

@notrab I think we need to change sqlite3.ts to keep the API compatible across different variants?

@notrab
Copy link
Member Author

notrab commented Aug 28, 2024

@penberg you're right, I was thinking this was libsql-js for a moment 🤦🏻

@@ -255,7 +256,7 @@ export async function executeHranaBatch(
disableForeignKeys: boolean = false,
): Promise<Array<ResultSet>> {
if (disableForeignKeys) {
batch.step().run("PRAGMA foreign_keys=off")
batch.step().run("PRAGMA foreign_keys=off");
Copy link
Contributor

Choose a reason for hiding this comment

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

Diff noise.

Copy link
Member Author

Choose a reason for hiding this comment

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

Prettier ran on commit, have the rules changed?

@@ -287,7 +288,7 @@ export async function executeHranaBatch(
.condition(hrana.BatchCond.not(hrana.BatchCond.ok(commitStep)));
rollbackStep.run("ROLLBACK").catch((_) => undefined);
if (disableForeignKeys) {
batch.step().run("PRAGMA foreign_keys=on")
batch.step().run("PRAGMA foreign_keys=on");
Copy link
Contributor

Choose a reason for hiding this comment

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

Diff noise.

Copy link
Member Author

Choose a reason for hiding this comment

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

Prettier ran on commit, have the rules changed?

@@ -31,7 +32,7 @@ export abstract class HranaTransaction implements Transaction {
abstract close(): void;
abstract get closed(): boolean;

execute(stmt: InStatement): Promise<ResultSet> {
async execute(stmt: InStatement): Promise<ResultSet> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks unrelated?

async migrate(
stmts: Array<InStatement>,
): Promise<Array<ResultSet>> {
async migrate(stmts: Array<InStatement>): Promise<Array<ResultSet>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Diff noise.

Copy link
Member Author

Choose a reason for hiding this comment

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

Prettier ran on commit, have the rules changed?

@DaBigBlob
Copy link
Contributor

guys is there a reason this isnt merged yet?

@penberg penberg merged commit 80c2767 into main Sep 26, 2024
4 checks passed
@penberg penberg deleted the simpler-batch-api branch September 26, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch transactions requires verbose API
4 participants