VinGarcia / ksql

A Simple and Powerful Golang SQL Library
MIT License
321 stars 22 forks source link

Soft delete? #43

Closed olivatooo closed 1 year ago

olivatooo commented 1 year ago

To implement a soft delete feature I need to always append to my query that I want to get deleted_at is null? There is a default way to do so? Looking into the examples I couldn't find any examples with a DeletedAt field

There is a way to extend ksql features?

VinGarcia commented 1 year ago

Hello @olivatooo, sorry for the delay. Since KSQL aims at being simple it avoids as much as possible to hide the actual SQL that is being generated.

You should be able to use a query builder to get this behavior you wanted.

That said I think that keeping this WHERE deleted_at IS NULL clause might actually make the query more readable, since a reader that is not aware of this default value could get very confused.

But that's just my personal preference.