sqlite encode
I'm trying to encode some data in the schema.
I thought I could use the
sql
command, but I think that's only for doing default values
Like for this table:
I'd like to use the sqlean encode
function for sensitive information like the birthday but don't know where to add that or if I can 🫠5 Replies
so you want to have some sort of interceptor to catch the inserted value and then encode it?
so you can specify it once and then in any insert to database it will be encoded?
I guess you can use it with
customTypes
or do you need to do it on database level?
if it should be on database level, you can try using
Like this?
doesn't seem to do the thing
ok, now I see, you don't have an access to a value on insert
I'll think about this usecase and will get back to you
@Andrew Sherman When I saw the way the new
.$default() / .$defaultFn
were implemented I did some testing but I couldn't migrate from my custom type as it was implemented because of this issue
Right now, I'm manually creating an id on every insert just because I need the created id to return it to the front-end
We might want to look into patching the return from the driver with the result of the function passed to $default()
yeah, the purpose of
$default()
is only to have a default on insert, to simulate custom id creation, etc.
I guess for such purposes we will need tome other function