Database interface design - was how to build up the library.

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Oct 7 09:59:43 PDT 2011


On 10/7/11 11:51 AM, Steve Teale wrote:
> Andrei,
>
> The suggestion in your penultimate paragraph is what I'm trying to get started.
>
> Maybe the answer to the problem with structs may lie somewhere in std.typecons in
> combination with the field discovery features supported by most databases. If we
> can manufacture the struct to suit the circumstances, then we've cracked it! I'm
> probably talking rubbish - Friday night, couple of beers.

No can do. This is a hard wall. Structs must be defined during 
compilation. Database structure can be discovered at run time.

What you can do, however, is that you pass a struct type to store a row 
in the resultset and at runtime the fields of the struct are matched 
dynamically with the fields in the rowset. That is doable and useful.

> I will attempt top start a new thread - [std.database] - your 10 cents worth?

http://www.youtube.com/watch?v=lmUZGdi7Ty4


Andrei



More information about the Digitalmars-d mailing list