awtkns / fastapi-crudrouter

A dynamic FastAPI router that automatically creates CRUD routes for your models
https://fastapi-crudrouter.awtkns.com
MIT License
1.38k stars 155 forks source link

Support for "logical delete" #139

Open satodaiki opened 2 years ago

satodaiki commented 2 years ago

hello.

For tables that have columns for logical deletion, as shown below, there is a use case where logical deletion is required.

CREATE TABLE user (
    id INTEGER,
    name VARCHAR NOT NULL,
    archive_time TIMESTAMP,
    PRIMARY KEY (id)
);

I think we need to address this. Specifically, it would take the form of adding the following attribute:

CRUDRouter(
    # ...
    logical_delete_column="archive_time",
)

Thank you for your consideration.