moigagoo / norm

A Nim ORM for SQLite and Postgres
https://norm.nim.town
MIT License
381 stars 34 forks source link

Update lowdb version to 0.2.0 and add enum support #187

Closed PhilippMDoerner closed 1 year ago

PhilippMDoerner commented 1 year ago

Lowdb is used for direct interaction with the database. This means easier enum support. For supporting any new datatype, 3 procs are needed:

In the newest version it provides propper enum support, meaning no dbValue proc needs to be defined for it. Norm only needs to define "to" and "dbType". These procs have now been added.

Further, tests were added to confirm that these procs can be overwritten by procs specific for a given enum.

Note: I will be honest, I don't have the faintest clue where these types of tests "properly" belong. So I think they're correctly placed where they are (?).

Closes #166

PhilippMDoerner commented 1 year ago

I don't know how this happened but I completely forgot about the PR, apologies. Addressed the remarks and implemented them.