leafo / lapis

A web framework for Lua and OpenResty written in MoonScript
http://leafo.net/lapis/
MIT License
3.14k stars 247 forks source link

Get null values from Model query as something else than nil #742

Open eko234 opened 3 years ago

eko234 commented 3 years ago

Hi leafo, I've been really digging lapis and I understand that there are some caveats regarding lua handling null values, I want to know if there is a way to get the raw body of a request that contains a json body and use some parsing library that would retrieve null values as something else, the other thing i would find very useful is a way to configure the database layer to return null values as db.Null instead of null, I don't know if there is already a solution for that but I can't seem to find one, I'm currently developing a json rest api and the lack of data integrity hurts, especially in the frontend.