SQLite3 Phobos branch

Jonathan M Davis jmdavisProg at gmx.com
Sat Apr 9 15:19:43 PDT 2011


> I have a branch of Phobos which includes SQLite 3.7.5 and its bindings
> for D. I have updated the posix.mak to include this when building.
> 
> I am posting here at this time to prevent duplicate effort and give a
> heads up that I won't be able to test this for Mac or BSD. I would also
> like to know what I would need to complete to get this ready for a Pull
> Request.
> 
> I will work to get this done for Linux and Windows/Wine this weekend.
> 
> On another note. The source distribution uses autotools, but it compiles
> fine just by calling GCC. So there might be some interesting flags which
> should be set.
> 
> https://github.com/he-the-great/phobos/tree/sqlite3
> 
> The binding effort can be attributed to Alexey Khmara, I just added a few
> lines for the update.
> 
> https://github.com/bayun/SQLite3-D

If it's just the bindings, then we probably don't need an actual review 
process on the newsgroup - though it'll obviously be reviewed on github before 
being merged in. However, I think that this sort of binding raises a potential 
problem that we need to make sure we're willing to deal with and know how to 
deal with, and that's library versioning.

How stable is SQLite's API? If they put out SQLite 3.7.6, will any of the 
bindings then be invalid? I'm guessing not, since that's likely just a bug fix 
release, but what about 3.8.x? I'd fully expect that SQLite 4 would have major 
changes were it ever released. Does that mean that Phobos then requires the 
user to have a specific version of SQLite installed if they intend to use any 
of the SQLite bindings? If that's the case, then it could make Phobos unusable 
on some systems when SQLite gets upgraded.

If SQLite's API is stable enough (and I think that there's likely a good 
chance that it is), then including bindings for it in Phobos makes good sense, 
and it's a step towards including a D-based database solution in Phobos. But 
if SQLite's API changes much at all, then we could have versioning issues. If, 
on the other hand, SQLite bindings were in a separate library from Phobos 
(even an official one), then we could have different versions of the bindings 
(and different versions of the eventual D database solution) available by 
having different versions of that library, thereby allowing folks to use the 
version of SQLite that's appropriate for their system. But you can't do that 
in Phobos itself.

This is a problem posed by any C bindings that we might want to put into 
Phobos. And as long as the APIs are stable enough, it shouldn't be a problem. 
But any project that's likely to have API changes which would affect the 
bindings could create versioning issues with Phobos' dependencies. So, the 
question is how we want to deal with that and whether SQLite is stable enough 
that such versioning issues are unlikely to be a problem short of SQLite 4.

- Jonathan M Davis


More information about the Digitalmars-d mailing list