2 days ago · 10 min read1980 words · Tech · hide

TL;DR the source is at hare-sql, hare-sqlite, and hare-postgresql. I've been writing Hare modules for a while and I did initially make hare-sqlite with limited C bindings, but now I wanted to attempt to make much more robust SQL modules to not only support SQLite, but also PostgreSQL since those are the 2 most popular databases in open source. I have a lot of experience with Go's database/sql package and so I thought that was a good design to follow and to adapt it to Hare's idioms and language constraints. What I came up with was the following: hare-sql defines the interface and contains no drivers hare-sqlite implements the interface by way of SQLite's C bindings hare-postgresql also implements the interface and has all the wire protocol and authentication messages required to operate over a TCP socket sql::db, sql::rows, and sql::values Hare has no interfaces or generics, so a driver implements a table of function pointers and embeds a pointer to that table as the first field of…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town