H1 2015 - db access support in Phobos

Vadim Lopatin via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 3 01:04:49 PST 2015


On Tuesday, 3 February 2015 at 08:37:04 UTC, Robert burner 
Schadek wrote:
> IMO the java way is to uncreative. We have UDA, CTFE and string 
> mixins anything short of perfect SQL generated at compile time 
> without anything else than UDA annotation to my structs is an 
> epic lose for D. I mean, who wants to write string statements 
> when the lib can generate them for you. For every sql 
> incarnation you can think of.

What you are talking about is a bit different, higher level 
thing, ORM.

It's what done in my project hibernated or in project of Daniel 
Kozak he mentioned above.
E.g. hibernated uses CTFE and mixins to collect metadata, and 
prepare parts of SQL queries.

But for such high level DB library must be based on some lower 
level DB API (connector).
Like JDBC for JPA or Hibernate in Java.

D may offer more convenient way for reading of field values from 
result set, and for setting of parameters - using templates, and 
other cool D features.
Parsing of SQL doesn't make sense in low level. It can determine 
number of fields expected in query result (if * is not used), but 
it doesn't know column types anyway.


More information about the Digitalmars-d mailing list