Pacharapol Withayasakpunt Pacharapol Withayasakpunt
Sat, February 15, 2020

I wrote an ORM for SQLite

It starts with inter-op with mongoose, and inspired from Typegoose.

It is an ORM that

  • Can query by Mongo-like query
  • Auto-convert back-and-forth for JSON \<=> TEXT, Date \<=> INTEGER and Boolean \<=> INTEGER

For Mongo-like query, it can be tested here -- https://q2search.herokuapp.com/LiteORM (The actual Mongo-like query is in the console)

Still, there are something that would be hard to do / cannot do…

  • Case-sensitive LIKE (LIKE in SQLite is case-insensitive)
  • Query by RegExp (I use LIKE '%'||$identifier||'%' instead. RegExp queries need re-compile.)
  • Limited update / delete (like LIMIT 1 ==> I would have to re-compile SQLite)

https://github.com/patarapolw/liteorm