McreateSession
Bun

method

sqlite.DatabaseSync.createSession

@param options

The configuration options for the session.

@returns

A session handle.

Referenced types

interface CreateSessionOptions

  • db?: string

    Name of the database to track. This is useful when multiple databases have been added using ATTACH DATABASE.

  • table?: string

    A specific table to track changes for. By default, changes to all tables are tracked.

interface Session

  • Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times. An exception is thrown if the database or the session is not open. This method is a wrapper around sqlite3session_changeset().

    @returns

    Binary changeset that can be applied to other databases.

  • close(): void;

    Closes the session. An exception is thrown if the database or the session is not open. This method is a wrapper around sqlite3session_delete().

  • Similar to the method above, but generates a more compact patchset. See Changesets and Patchsets in the documentation of SQLite. An exception is thrown if the database or the session is not open. This method is a wrapper around sqlite3session_patchset().

    @returns

    Binary patchset that can be applied to other databases.