Hacker News new | past | comments | ask | show | jobs | submit login

Just today, I finished writing my own low level go sqlite driver. I haven't published it yet. I really thought there was a need for it. I hate the database/sql integration that the other drivers have. Now I'll have to see if my driver has any need to exist.

This always seems to happen when I write something.




I'd be curious to hear if my sqlite package fits your needs, or if it doesn't, why it doesn't.

Collaboration would be great if it's possible, but there are good reasons you may want to do your own thing.


Your sqlite package totally fits my needs. My biggest problem is that I hate the database/sql layer. Connection pooling is completely unnecessary and surprising in a sqlite context. I honestly have no idea how anyone is using it with sqlite. The concept of a sqlite "connection" goes out the window. You can no longer use sqlite transactions in any normal way. You get locking issues if you don't force it into shared cache mode.

I've always wanted just a pure sqlite package with a one-to-one mapping of functions. Your driver is totally what I've always wanted to exist.

I've put up a preview version of my package if you wanted to look at it.

https://github.com/bvinc/go-sqlite-lite

My project started as a fork of https://github.com/mxk/go-sqlite/tree/master/sqlite3

I ended up removing a ton of features, removing the database/sql driver, getting rid of all the "caching" of information that it does, removing callbacks (which I plan to re-add later), and renaming the methods to match sqlite function names.

It still has some niceties that I plan to keep, such as the Scan method to extract several columns with a single method call, and a RowData type to extract rows into a go map.

I found your project in Github and I'm going to suggest some things. There's a particularly nasty footgun that you might have by not having HAVE_USLEEP defined on UNIX. I'll open an issue.


Ah, you implement the online backup API! That's something I need to do. Opened an issue.


Last I checked mattn's wrapper was for an older version and was missing some things, like registering an update hook (I could be wrong, been a while). I welcome a current, lower level wrapper. If you publish your code, I'd take a look.


There is nothing wrong with implementing something someone else has already done!

Usage of a library has more to do with it’s community than it’s codebase.


> There is nothing wrong with implementing something someone else has already done!

Well, the phrase "re-inventing the wheel" exists for a reason.

> Usage of a library has more to do with it’s community than it’s codebase.

The purpose of a library is code re-use.

For comparison, the wikipedia page [1] for a computer library does not even mention communities, or the social aspect in general.

I'd say the community is a factor in the decision to use a particular library, but it's not the driving factor.

[1] https://en.wikipedia.org/wiki/Library_(computing)


And most people discount the learning experience. You don't really know how to do something until you've done it, with all its warts and edge cases and all.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: