Module spin_sdk.wit.imports.mysql
Classes
class Connection
-
A connection to a MySQL database.
Expand source code
class Connection: """ A connection to a MySQL database. """ @classmethod def open(cls, address: str) -> Self: """ Open a connection to the MySQL instance at `address`. Raises: `spin_sdk.wit.types.Err(spin_sdk.wit.imports.rdbms_types.Error)` """ raise NotImplementedError def query(self, statement: str, params: List[rdbms_types.ParameterValue]) -> rdbms_types.RowSet: """ query the database: select Raises: `spin_sdk.wit.types.Err(spin_sdk.wit.imports.rdbms_types.Error)` """ raise NotImplementedError def execute(self, statement: str, params: List[rdbms_types.ParameterValue]) -> None: """ execute command to the database: insert, update, delete Raises: `spin_sdk.wit.types.Err(spin_sdk.wit.imports.rdbms_types.Error)` """ raise NotImplementedError def __enter__(self) -> Self: """Returns self""" return self def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None: """ Release this resource. """ raise NotImplementedError
Static methods
def open(address: str) ‑> Self
Methods
def execute(self,
statement: str,
params: List[ParameterValue_Boolean | ParameterValue_Int8 | ParameterValue_Int16 | ParameterValue_Int32 | ParameterValue_Int64 | ParameterValue_Uint8 | ParameterValue_Uint16 | ParameterValue_Uint32 | ParameterValue_Uint64 | ParameterValue_Floating32 | ParameterValue_Floating64 | ParameterValue_Str | ParameterValue_Binary | ParameterValue_DbNull]) ‑> Nonedef query(self,
statement: str,
params: List[ParameterValue_Boolean | ParameterValue_Int8 | ParameterValue_Int16 | ParameterValue_Int32 | ParameterValue_Int64 | ParameterValue_Uint8 | ParameterValue_Uint16 | ParameterValue_Uint32 | ParameterValue_Uint64 | ParameterValue_Floating32 | ParameterValue_Floating64 | ParameterValue_Str | ParameterValue_Binary | ParameterValue_DbNull]) ‑> RowSet