Skip to content

planetscale session ID is not preserved #41

@anszom

Description

@anszom

I've encountered some problems when using kysely's migration module. The migration process starts by acquiring a global database lock (SQL GET_LOCK) and releasing it afterwards (SQL RELEASE_LOCK).

The lock is scoped to the "connection", so releasing the lock must happen inside the same connection, otherwise it has no effect. This by itself works correctly with the HTTP-based @planetscale/database driver, because it maintains a session ID within the Connection object.

Unfortunately, kysely-planetscale acquires a new connection for each request. In effect, database locks remain in place until they time out after 20 seconds.

It's likely that useSharedConnection would help, but that feature doesn't work at all (#40), and the README implies that it is not to be relied on.

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