PortableTab.base_table module
- class PortableTab.base_table.BaseTable(db_dir=None)
Bases:
CapnpTable,ABCClass that represents a table assigned schema.
- __tablename__
The name of the table.
- Type:
str
- __schema__
The schema of the table. It must be defined in the struct of Capnp schema. ref: https://capnproto.org/language.html
- Type:
str
- __record_type__
The record type of the table.
- Type:
str
- Parameters:
db_dir (Path-like, optional) – Base directory where the schema and tables are placed.
Notes
“db_dir” specifies the base directory where other tables will also be placed. Tables are placed in subdirectories with tablename in the base directory.
- create() Path
Create table.
- Returns:
Directory path where the created tables and schema will be stored.
- Return type:
Path
Notes
Even if multiple types are defined, only the type specified as __record_type__ is used.