Proposal: Database Engine for D

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 1 02:26:14 PST 2016


On Fri, 2016-01-01 at 10:00 +0000, Kapps via Digitalmars-d wrote:
> On Thursday, 31 December 2015 at 17:14:55 UTC, Piotrek wrote:
> > 
> >   struct Person
> >   {
> >    string name;
> >    string surname;
> >    ubyte age;
> >    Address address;
> >   }
> > 
> >  DataBase db = new DataBase("file.db");
> >  auto coll = db.collection!Person("NSA.Registry");
> >  auto visitationList = coll.filter!(p => p.name == "James");
> >  writeln (visitationList);
> 
> This example shows the difficulty of doing this in D. You can't 
> really have something like `p.Name == "James"`, or `p.Age < 21` 
> translate to SQL properly without language changes, which I 
> believe Walter or Andrei were against. This has been the key 
> problem when things like Linq to Sql for D have been brought up 
> before.

Why does it need language changes?

Having the ability to have an internal DSL instead of SQL string
fiddling is one of the major wins for SQLAlchemy. If it can be done in
Python why can't it be done in D?

-- 
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 winder.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: 181 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20160101/7c454751/attachment.sig>


More information about the Digitalmars-d mailing list