Skip to the content.

Onstro DB

Things to know while designing a schema. The python type hint for a schema is dict[str, dict[str, object]]

The first key represent the column and the mapping to represent the property or in this case the type of the data to be expected in that column.


schema = {
    "name": {"type": "int", "required": True},
    "age:" {"type": "int", "required": True},
    "place": {"type": "str", "default": "canada"},
    "salary": {"type": "float"}
}

The type of a variable must be in quotes. And these are all the allowed type. int, str, float, bool