Module spin_sdk.sqlite
Module for interacting with an SQLite database
Functions
def open(name: str) ‑> Connection
-
Expand source code
def open(name: str) -> Connection: """Open a connection to a named database instance. If `database` is "default", the default instance is opened. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.sqlite.Error_AccessDenied)` will be raised when the component does not have access to the specified database. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.sqlite.Error_NoSuchDatabase)` will be raised when the host does not recognize the database name requested. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.sqlite.Error_InvalidConnection)` will be raised when the provided connection string is not valid. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.sqlite.Error_Io(str))` will be raised when implementation-specific error occured (e.g. I/O) """ return Connection.open(name)
Open a connection to a named database instance.
If
database
is "default", the default instance is opened.A
Err(Error_AccessDenied)
will be raised when the component does not have access to the specified database.A
Err(Error_NoSuchDatabase)
will be raised when the host does not recognize the database name requested.A
Err(Error_InvalidConnection)
will be raised when the provided connection string is not valid.A
Err(Error_Io(str))
will be raised when implementation-specific error occured (e.g. I/O) def open_default() ‑> Connection
-
Expand source code
def open_default() -> Connection: """Open the default store. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.sqlite.Error_AccessDenied)` will be raised when the component does not have access to the default database. A `spin_sdk.wit.types.Err(spin_sdk.wit.imports.sqlite.Error_Io(str))` will be raised when implementation-specific error occured (e.g. I/O) """ return Connection.open("default")
Open the default store.
A
Err(Error_AccessDenied)
will be raised when the component does not have access to the default database.A
Err(Error_Io(str))
will be raised when implementation-specific error occured (e.g. I/O)