neuralib.sqlp.table.Field
- class neuralib.sqlp.table.Field[source]
Bases:
NamedTupleA SQL column, a field in a table.
- __init__()
Methods
__init__()count(value, /)Return number of occurrences of value.
get_annotation(annotation_type)index(value[, start, stop])Return first index of value.
Attributes
Alias for field number 6
default value.
column/field name
Is it not NULL.
origin field type
column/field type.
associated table
- table: type
associated table
- name: str
column/field name
- raw_type: type
origin field type
- sql_type: type
column/field type. Should be supported by SQL
- f_value: Any
default value.
- not_null: bool
Is it not NULL.
- annotated: list[Any]
Alias for field number 6
- property table_name: str
- property has_default: bool
- property is_primary: bool
- property is_unique: bool
- get_annotation(annotation_type)[source]
- Parameters:
annotation_type (type[T])
- Return type:
T | None
- static __new__(_cls, table, name, raw_type, sql_type, f_value=<object object>, not_null=True, annotated=())
Create new instance of Field(table, name, raw_type, sql_type, f_value, not_null, annotated)
- Parameters:
table (type)
name (str)
raw_type (type)
sql_type (type)
f_value (Any)
not_null (bool)
annotated (list[Any])