radb.typesys module

class radb.typesys.AttrSpec(rel: Optional[str], name: Optional[str], type: radb.utils.ValType)[source]

Bases: radb.utils.CustomJSONSerializable

Specification of an attribute in a RelType. See Relation Schema and Attribute References for an overview.

Construct a AttrSpec, given the name of the relation where the attribute originally comes from (optional), the name of the attribute (optional), and the type of the attribute.

can_be_confused_with(other: radb.typesys.AttrSpec)[source]

Check if this AttrSpec can be potentially confused with another one, if both are presented as possibilities when resolving an AttrRef.

str_name_and_type_only()[source]
str_ref_only()[source]
class radb.typesys.FuncSpec(name: str, is_aggr: bool, outtype: radb.utils.ValType, required_argtypes: List[radb.utils.ValType], optional_argtypes: List[radb.utils.ValType], no_max_argc: bool = False)[source]

Bases: object

Specification (i.e., signature) of a built-in function. See Operators and Functions and Type Checking for an overview.

Create a function specification. The function is an aggregate function if is_aggr is True. If no_max_argc is True, the function can take an arbitrary number of additional arguments; in that case, optional_argtypes must not be empty, and its last element will be used as the type for additional arguments.

static from_config_line(line: str)[source]

Construct a FuncSpec object from a line. See Specification of Built-in Functions for the specification format.

class radb.typesys.RelType(tmp, attrs)[source]

Bases: radb.utils.CustomJSONSerializable

sql_attr(i)[source]
sql_attrs()[source]
sql_rel()[source]
str_attr_names_and_types()[source]
exception radb.typesys.TypeSysError[source]

Bases: Exception

class radb.typesys.ValTypeChecker(default_decl_lines: str, decl_lines: Optional[str] = None)[source]

Bases: object

can_be_used_as(this, other)[source]
static decls_from_config_lines(lines)[source]
function_call(fname: str, argtypes: List[radb.utils.ValType], allow_aggr=False)[source]