Skip to content

bun:sqlite not closable after running migrations #11418

Closed

Description

@pekeler

What version of Bun is running?

1.1.10

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

import { migrate } from "drizzle-orm/bun-sqlite/migrator";
import { drizzle } from "drizzle-orm/bun-sqlite";
import { Database } from "bun:sqlite";

const sqlite = new Database("sqlite.db");
const db = drizzle(sqlite);
migrate(db, { migrationsFolder: "./drizzle" });
sqlite.close(true);

What is the expected behavior?

No error, db is closed.

What do you see instead?

error: database is locked

Additional information

Repro: https://github.com/pekeler/bun-lite

Activity

  1. jnatmorris commented on Jun 10, 2024

    @jnatmorris

    As per the documentation "To close a database connection, but allow existing queries to finish, call .close(false):".
    Unfortunately this does not work for me as I'm running into the same bug, but just when executing many insert statements in quick succession.

  2. maxmilton commented on Nov 10, 2024

    @maxmilton
    Contributor

    Possibly related to #14709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions