Skip to content

Use of database.prepare() appears to block "DROP TABLE" unless statement.free() is used to clean up. #435

@DavidPratten

Description

@DavidPratten

Hi,

Please consider documentation updates for database.prepare() and database.run()/exec() etc to warn users of this behaviour. Ideally the API could be changed so that statement.free() executes when the JS statement object goes out of scope.

It appears that if database.prepare() is used, without corresponding use of statement.free() that "DROP TABLE" will fail with error "Uncaught Error: database table is locked".

The cause? It seems that SQLite has more stringent locking requirements for DROP compared to other DDL / DML statements.

Thanks

David

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions