Skip to content

Support timeout on sqlite #5621

Closed
Closed

Description

@internalfx

What is the problem this feature would solve?

Sometimes the sqlite database is being read by another application and is intermittently locked for short periods of time. There is no way (that I know of) to currently have the database wait for the lock to free.

What is the feature you are proposing to solve the problem?

the better-sqlite3 library has a timeout option...

options.timeout: the number of milliseconds to wait
when executing queries on a locked database,
before throwing a SQLITE_BUSY error (default: 5000).

What alternatives have you considered?

I don't know of another alternative.

Activity

  1. karimfromjordan commented on Sep 18, 2023

    @karimfromjordan

    Isn't this already possible by running the following?

    db.run('pragma busy_timeout = 5000;');
  2. internalfx commented on Sep 18, 2023

    @internalfx
    Author

    Nice! That does work. I always thought that was supported by the connection library not SQLITE itself. Good to know!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bun:sqliteSomething to do with bun:sqliteenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions