Another SQLite3 wrapper

Russel Winder russel at russel.org.uk
Mon Nov 15 23:36:08 PST 2010


Alexey,

On Tue, 2010-11-16 at 01:14 +0000, Alexey Khmara wrote:
> Hello!
> 
> I tried to find any module to work with SQLite3 in D2, and failed. I
> found either just bindings to old SQLite versions or D1 modules with
> "craft-SQL-on-the-fly" interface, all abandoned.
> So I want to add just another D2 SQLite3 bindings and OO-wrapper and
> uploaded to GitHub: https://github.com/bayun/SQLite3-D

I cloned the repository which gets the sqlite.d file but there seems to
be no unit tests, system tests or examples?

Also should the API be retargetable to any SQL resource rather than just
being targeted at SQLite?

> It seems that no-one wants to support bindings for current SQLite
> version.. Well, I'll try to do this. But I currently use very small
> subset of it's features, so it's mostly mechanical translation without
> further testing.
> My tiny OO interface supports prepare/bind style of statements, and
> seems to work good :-) But I'm new to D, and will be grateful to
> somebody who can check, if my code is correct and don't have subtle
> bugs.

Can you put some examples of how to use your package?  Reading the
source tells me a lot, but not how you intend things to be used.

[ . . . ]

You may want to look at the way Groovy handles this sort of stuff.  Most
languages bind at a very low level so that people end up simply
embedding SQL statements in strings, or if you are lucky template
strings.  Groovy adds a layer above this using the meta-object protocol
features to create a very nice builder approach to interacting with the
database.  Basically you code up everything in Groovy code and the
infrastructure handles composing the SQL and all the connections and
cursors.

I am about to look at Python's SQLAlchemy, Python also has other stuff
for trying to raise the level.

In terms of support in D, there needs to be a low level drivers I am
sure, but having a way of interacting with SQLite, DB2, Oracle, even SQL
Server all from the same source code would be good.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20101116/989dadbc/attachment.pgp>


More information about the Digitalmars-d-announce mailing list