Skip to content

feat: server default/onupdate #61

@mplemay

Description

@mplemay

Hey @piercefreeman ,

On of the features I found myself commonly using in sqlalchemy was the server_default and onupdate for Columns.

Proposal

class MyModel(TableBase):
    id: UUID = Field(default=func.gen_random_uuid(), primary_key=True)
    updated_at: datetime = Field(default=func.now(), onupdate=func.now())

Let me know your thoughts and if you want me to take a first pass at it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions