3 ms·
FWIW I enjoyed the challenge of hacking up my own version of this. It's admittedly not battle-tested, but hey ;) https://github.com/cbdevnet/libgit2-backends/b
by _cbdev 11y ago
FWIW I enjoyed the challenge of hacking up my own version of this. It's admittedly not battle-tested, but hey ;)
https://github.com/cbdevnet/libgit2-backends/blob/master/postgres/postgres.c https://github.com/cbdevnet/libgit2-backends/blob/master/pos...
- andrewstuart 11y agoAwesome! Incredible to get two implementations. I really appreciate that you've made this happen. Is this built from scratch or a port of one of the existing drivers? Did you have a chance to have a look at the other implementation - what do you see as the major differences? Any thoughts of submitting to the libgit2 project?
- _cbdev 11y agoI copied the prototypes and general structure of the driver from the existing ones (mainly the sqlite driver), implementing the functionality with the appropriate postgres API calls. As for the implementation by mhodgson, one thing I noticed is that it uses the slightly newer PQexecPrepared API, which only works from protocol version 3.0 and upwards (which was introduced with PostgreSQL 7.4, so not really a problem). He also seems to use some more calls to the libgit2 API, mainly for copying and creating buffers for SQL statements (which I did with static allocation, at the expense of having hardcoded schema and table names). All in all, mhodgson's implementation seems more feature-complete (and well-tested) than mine, yet also considerably more complex. As for submitting it, I'd like to have some confirmation that it works first :) Unfortunately, I'm currently too busy to really set up some tests for it, but once I have the time, I just might ;)
- richardwooding 11y agoGah! You beat me to it :)