Module spin_sdk.wit.imports.rdbms_types
Expand source code
from typing import TypeVar, Generic, Union, Optional, Union, Protocol, Tuple, List, Any, Self
from enum import Flag, Enum, auto
from dataclasses import dataclass
from abc import abstractmethod
import weakref
from ..types import Result, Ok, Err, Some
@dataclass
class ErrorConnectionFailed:
value: str
@dataclass
class ErrorBadParameter:
value: str
@dataclass
class ErrorQueryFailed:
value: str
@dataclass
class ErrorValueConversionFailed:
value: str
@dataclass
class ErrorOther:
value: str
Error = Union[ErrorConnectionFailed, ErrorBadParameter, ErrorQueryFailed, ErrorValueConversionFailed, ErrorOther]
"""
Errors related to interacting with a database.
"""
class DbDataType(Enum):
"""
Data types for a database column
"""
BOOLEAN = 0
INT8 = 1
INT16 = 2
INT32 = 3
INT64 = 4
UINT8 = 5
UINT16 = 6
UINT32 = 7
UINT64 = 8
FLOATING32 = 9
FLOATING64 = 10
STR = 11
BINARY = 12
OTHER = 13
@dataclass
class DbValueBoolean:
value: int
@dataclass
class DbValueInt8:
value: int
@dataclass
class DbValueInt16:
value: int
@dataclass
class DbValueInt32:
value: int
@dataclass
class DbValueInt64:
value: int
@dataclass
class DbValueUint8:
value: int
@dataclass
class DbValueUint16:
value: int
@dataclass
class DbValueUint32:
value: int
@dataclass
class DbValueUint64:
value: int
@dataclass
class DbValueFloating32:
value: float
@dataclass
class DbValueFloating64:
value: float
@dataclass
class DbValueStr:
value: str
@dataclass
class DbValueBinary:
value: bytes
@dataclass
class DbValueDbNull:
pass
@dataclass
class DbValueUnsupported:
pass
DbValue = Union[DbValueBoolean, DbValueInt8, DbValueInt16, DbValueInt32, DbValueInt64, DbValueUint8, DbValueUint16, DbValueUint32, DbValueUint64, DbValueFloating32, DbValueFloating64, DbValueStr, DbValueBinary, DbValueDbNull, DbValueUnsupported]
"""
Database values
"""
@dataclass
class ParameterValueBoolean:
value: int
@dataclass
class ParameterValueInt8:
value: int
@dataclass
class ParameterValueInt16:
value: int
@dataclass
class ParameterValueInt32:
value: int
@dataclass
class ParameterValueInt64:
value: int
@dataclass
class ParameterValueUint8:
value: int
@dataclass
class ParameterValueUint16:
value: int
@dataclass
class ParameterValueUint32:
value: int
@dataclass
class ParameterValueUint64:
value: int
@dataclass
class ParameterValueFloating32:
value: float
@dataclass
class ParameterValueFloating64:
value: float
@dataclass
class ParameterValueStr:
value: str
@dataclass
class ParameterValueBinary:
value: bytes
@dataclass
class ParameterValueDbNull:
pass
ParameterValue = Union[ParameterValueBoolean, ParameterValueInt8, ParameterValueInt16, ParameterValueInt32, ParameterValueInt64, ParameterValueUint8, ParameterValueUint16, ParameterValueUint32, ParameterValueUint64, ParameterValueFloating32, ParameterValueFloating64, ParameterValueStr, ParameterValueBinary, ParameterValueDbNull]
"""
Values used in parameterized queries
"""
@dataclass
class Column:
"""
A database column
"""
name: str
data_type: DbDataType
@dataclass
class RowSet:
"""
A set of database rows
"""
columns: List[Column]
rows: List[List[DbValue]]
Global variables
var DbValue
-
Database values
var Error
-
Errors related to interacting with a database.
var ParameterValue
-
Values used in parameterized queries
Classes
class Column (name: str, data_type: DbDataType)
-
A database column
Expand source code
@dataclass class Column: """ A database column """ name: str data_type: DbDataType
Class variables
var data_type : DbDataType
var name : str
class DbDataType (*args, **kwds)
-
Data types for a database column
Expand source code
class DbDataType(Enum): """ Data types for a database column """ BOOLEAN = 0 INT8 = 1 INT16 = 2 INT32 = 3 INT64 = 4 UINT8 = 5 UINT16 = 6 UINT32 = 7 UINT64 = 8 FLOATING32 = 9 FLOATING64 = 10 STR = 11 BINARY = 12 OTHER = 13
Ancestors
- enum.Enum
Class variables
var BINARY
var BOOLEAN
var FLOATING32
var FLOATING64
var INT16
var INT32
var INT64
var INT8
var OTHER
var STR
var UINT16
var UINT32
var UINT64
var UINT8
class DbValueBinary (value: bytes)
-
DbValueBinary(value: bytes)
Expand source code
@dataclass class DbValueBinary: value: bytes
Class variables
var value : bytes
class DbValueBoolean (value: int)
-
DbValueBoolean(value: int)
Expand source code
@dataclass class DbValueBoolean: value: int
Class variables
var value : int
class DbValueDbNull
-
DbValueDbNull()
Expand source code
@dataclass class DbValueDbNull: pass
class DbValueFloating32 (value: float)
-
DbValueFloating32(value: float)
Expand source code
@dataclass class DbValueFloating32: value: float
Class variables
var value : float
class DbValueFloating64 (value: float)
-
DbValueFloating64(value: float)
Expand source code
@dataclass class DbValueFloating64: value: float
Class variables
var value : float
class DbValueInt16 (value: int)
-
DbValueInt16(value: int)
Expand source code
@dataclass class DbValueInt16: value: int
Class variables
var value : int
class DbValueInt32 (value: int)
-
DbValueInt32(value: int)
Expand source code
@dataclass class DbValueInt32: value: int
Class variables
var value : int
class DbValueInt64 (value: int)
-
DbValueInt64(value: int)
Expand source code
@dataclass class DbValueInt64: value: int
Class variables
var value : int
class DbValueInt8 (value: int)
-
DbValueInt8(value: int)
Expand source code
@dataclass class DbValueInt8: value: int
Class variables
var value : int
class DbValueStr (value: str)
-
DbValueStr(value: str)
Expand source code
@dataclass class DbValueStr: value: str
Class variables
var value : str
class DbValueUint16 (value: int)
-
DbValueUint16(value: int)
Expand source code
@dataclass class DbValueUint16: value: int
Class variables
var value : int
class DbValueUint32 (value: int)
-
DbValueUint32(value: int)
Expand source code
@dataclass class DbValueUint32: value: int
Class variables
var value : int
class DbValueUint64 (value: int)
-
DbValueUint64(value: int)
Expand source code
@dataclass class DbValueUint64: value: int
Class variables
var value : int
class DbValueUint8 (value: int)
-
DbValueUint8(value: int)
Expand source code
@dataclass class DbValueUint8: value: int
Class variables
var value : int
class DbValueUnsupported
-
DbValueUnsupported()
Expand source code
@dataclass class DbValueUnsupported: pass
class ErrorBadParameter (value: str)
-
ErrorBadParameter(value: str)
Expand source code
@dataclass class ErrorBadParameter: value: str
Class variables
var value : str
class ErrorConnectionFailed (value: str)
-
ErrorConnectionFailed(value: str)
Expand source code
@dataclass class ErrorConnectionFailed: value: str
Class variables
var value : str
class ErrorOther (value: str)
-
ErrorOther(value: str)
Expand source code
@dataclass class ErrorOther: value: str
Class variables
var value : str
class ErrorQueryFailed (value: str)
-
ErrorQueryFailed(value: str)
Expand source code
@dataclass class ErrorQueryFailed: value: str
Class variables
var value : str
class ErrorValueConversionFailed (value: str)
-
ErrorValueConversionFailed(value: str)
Expand source code
@dataclass class ErrorValueConversionFailed: value: str
Class variables
var value : str
class ParameterValueBinary (value: bytes)
-
ParameterValueBinary(value: bytes)
Expand source code
@dataclass class ParameterValueBinary: value: bytes
Class variables
var value : bytes
class ParameterValueBoolean (value: int)
-
ParameterValueBoolean(value: int)
Expand source code
@dataclass class ParameterValueBoolean: value: int
Class variables
var value : int
class ParameterValueDbNull
-
ParameterValueDbNull()
Expand source code
@dataclass class ParameterValueDbNull: pass
class ParameterValueFloating32 (value: float)
-
ParameterValueFloating32(value: float)
Expand source code
@dataclass class ParameterValueFloating32: value: float
Class variables
var value : float
class ParameterValueFloating64 (value: float)
-
ParameterValueFloating64(value: float)
Expand source code
@dataclass class ParameterValueFloating64: value: float
Class variables
var value : float
class ParameterValueInt16 (value: int)
-
ParameterValueInt16(value: int)
Expand source code
@dataclass class ParameterValueInt16: value: int
Class variables
var value : int
class ParameterValueInt32 (value: int)
-
ParameterValueInt32(value: int)
Expand source code
@dataclass class ParameterValueInt32: value: int
Class variables
var value : int
class ParameterValueInt64 (value: int)
-
ParameterValueInt64(value: int)
Expand source code
@dataclass class ParameterValueInt64: value: int
Class variables
var value : int
class ParameterValueInt8 (value: int)
-
ParameterValueInt8(value: int)
Expand source code
@dataclass class ParameterValueInt8: value: int
Class variables
var value : int
class ParameterValueStr (value: str)
-
ParameterValueStr(value: str)
Expand source code
@dataclass class ParameterValueStr: value: str
Class variables
var value : str
class ParameterValueUint16 (value: int)
-
ParameterValueUint16(value: int)
Expand source code
@dataclass class ParameterValueUint16: value: int
Class variables
var value : int
class ParameterValueUint32 (value: int)
-
ParameterValueUint32(value: int)
Expand source code
@dataclass class ParameterValueUint32: value: int
Class variables
var value : int
class ParameterValueUint64 (value: int)
-
ParameterValueUint64(value: int)
Expand source code
@dataclass class ParameterValueUint64: value: int
Class variables
var value : int
class ParameterValueUint8 (value: int)
-
ParameterValueUint8(value: int)
Expand source code
@dataclass class ParameterValueUint8: value: int
Class variables
var value : int
class RowSet (columns: List[Column], rows: List[List[Union[DbValueBoolean, DbValueInt8, DbValueInt16, DbValueInt32, DbValueInt64, DbValueUint8, DbValueUint16, DbValueUint32, DbValueUint64, DbValueFloating32, DbValueFloating64, DbValueStr, DbValueBinary, DbValueDbNull, DbValueUnsupported]]])
-
A set of database rows
Expand source code
@dataclass class RowSet: """ A set of database rows """ columns: List[Column] rows: List[List[DbValue]]
Class variables
var columns : List[Column]
var rows : List[List[Union[DbValueBoolean, DbValueInt8, DbValueInt16, DbValueInt32, DbValueInt64, DbValueUint8, DbValueUint16, DbValueUint32, DbValueUint64, DbValueFloating32, DbValueFloating64, DbValueStr, DbValueBinary, DbValueDbNull, DbValueUnsupported]]]