Module spin_sdk.wit.imports.fermyon_spin_sqlite

Global variables

var Error

The set of errors which may be raised by functions in this interface

Functions

def close(conn: int) ‑> None
Expand source code
def close(conn: int) -> None:
    """
    Close the specified `connection`.
    """
    raise NotImplementedError

Close the specified connection.

def execute(conn: int,
statement: str,
parameters: List[Value_Integer | Value_Real | Value_Text | Value_Blob | Value_Null]) ‑> QueryResult
Expand source code
def execute(conn: int, statement: str, parameters: List[Value]) -> QueryResult:
    """
    Execute a statement returning back data if there is any
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_sqlite.Error)`
    """
    raise NotImplementedError

Execute a statement returning back data if there is any

Raises: componentize_py_types.Err(Error)

def open(database: str) ‑> int
Expand source code
def open(database: str) -> int:
    """
    Open a connection to a named database instance.
    
    If `database` is "default", the default instance is opened.
    
    `error::no-such-database` will be raised if the `name` is not recognized.
    
    Raises: `componentize_py_types.Err(spin_sdk.wit.imports.fermyon_spin_sqlite.Error)`
    """
    raise NotImplementedError

Open a connection to a named database instance.

If database is "default", the default instance is opened.

error::no-such-database will be raised if the name is not recognized.

Raises: componentize_py_types.Err(Error)

Classes

class Error_AccessDenied
Expand source code
@dataclass
class Error_AccessDenied:
    pass

Error_AccessDenied()

class Error_DatabaseFull
Expand source code
@dataclass
class Error_DatabaseFull:
    pass

Error_DatabaseFull()

class Error_InvalidConnection
Expand source code
@dataclass
class Error_InvalidConnection:
    pass

Error_InvalidConnection()

class Error_Io (value: str)
Expand source code
@dataclass
class Error_Io:
    value: str

Error_Io(value: str)

Instance variables

var value : str
class Error_NoSuchDatabase
Expand source code
@dataclass
class Error_NoSuchDatabase:
    pass

Error_NoSuchDatabase()

class QueryResult (columns: List[str],
rows: List[RowResult])
Expand source code
@dataclass
class QueryResult:
    """
    A result of a query
    """
    columns: List[str]
    rows: List[RowResult]

A result of a query

Instance variables

var columns : List[str]
var rows : List[RowResult]
class RowResult (values: List[Value_Integer | Value_Real | Value_Text | Value_Blob | Value_Null])
Expand source code
@dataclass
class RowResult:
    """
    A set of values for each of the columns in a query-result
    """
    values: List[Value]

A set of values for each of the columns in a query-result

Instance variables

var values : List[Value_Integer | Value_Real | Value_Text | Value_Blob | Value_Null]
class Value_Blob (value: bytes)
Expand source code
@dataclass
class Value_Blob:
    value: bytes

Value_Blob(value: bytes)

Instance variables

var value : bytes
class Value_Integer (value: int)
Expand source code
@dataclass
class Value_Integer:
    value: int

Value_Integer(value: int)

Instance variables

var value : int
class Value_Null
Expand source code
@dataclass
class Value_Null:
    pass

Value_Null()

class Value_Real (value: float)
Expand source code
@dataclass
class Value_Real:
    value: float

Value_Real(value: float)

Instance variables

var value : float
class Value_Text (value: str)
Expand source code
@dataclass
class Value_Text:
    value: str

Value_Text(value: str)

Instance variables

var value : str