Closed TomMD closed 3 years ago
I took another pass, removing some of the cruft of the first version of this change.
Looking back at the critical blog post, things that are still unaddressed include:
it doesn’t even provide an instance for Integer
Yes, but I'm not clear on a good SQL type for integer. Even the decimal type has a limit of 16k decimal digits so the translation from Integer is going to be imperfect if we use that. I'm not sure what good options exist that won't break indexing.
Insertion/updates also feel like an afterthought, as Selda won’t even allow you to use SQL DEFAULT for columns other than autoincrementing primary keys.
Hurm, insert/update/lookup feels smooth for what is supported and like a library extension for what isn't. That' is unsurprising but won't be addressed by any one PR. Eventually perhaps we can get DELETE CASCADE
and other sorts of behaviors, but perhaps I'm just startlingly uninterested in the example used in the blog.
Ping @Valderman
Sorry for being slow on this; crunch time at work, so it's not been my top priority.
This seems like a good idea in general. I also agree that Integer
support is very much a non-issue. I've yet to see a good case for supporting it, and portability concerns alone are enough for me to hold off on it indefinitely.
In mostly an answer to https://williamyaoh.com/posts/2019-12-14-typesafe-db-libraries.html and my own eventual needs, here is some firming up of Int32 and Int64 support.