-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Core system columns
Identity and container
| Notion API | Proposed Column | Rationale |
|---|---|---|
| id | object_id | Avoid collision with user id columns |
| parent.database_id | database_id | Mirrors tableoid semantically |
Lifecycle
| Notion API | Proposed Column | Notes |
|---|---|---|
| in_trash | is_deleted | SQL-idiomatic |
| archived | is_archived | Keep as-is |
Temporal metadata
| Notion API | Proposed Column |
|---|---|
| created_time | created_at |
| last_edited_time | updated_at |
SystemColumn as specialized version of Column:
class Column(...):
is_system: ClassVar[bool] = False
class SystemColumn(Column):
is_system: ClassVar[bool] = TrueColumns accessors new API
table.c # user-defined columns only
table.columns # alias of table.c
table.sys # system columns only
table.all # optional convenienceStorage model:
class Table:
_user_columns: ColumnCollection
_system_columns: ColumnCollectionImplication on __len__
len(table) should return the number of user-defined columns only.
Add a new specialized function for returning schema size:
def schema_size(table: Table) -> int:
return len(table.all)Name collision and enforcement rules
System columns names are reserved
if name in system_column_names:
raise SchemaError("Cannot redefine system column")User cannot shadow system columns
This avoids:
Column("object_id", String)Which would be catastrophic.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Projects
Status
Todo