[std.database] ORM

simendsjo simendsjo at gmail.com
Thu Oct 13 11:16:23 PDT 2011


On 13.10.2011 19:49, bls wrote:
> Am 13.10.2011 18:44, schrieb simendsjo:
>> On 13.10.2011 11:53, Steve Teale wrote:
>>> On Thu, 13 Oct 2011 11:22:20 +0200, bls wrote:
>>>
>>>> > Am 12.10.2011 20:13, schrieb Steve Teale:
>>>>> >> The way this discussion is going we're going to have four layers,
>>>>> with
>>>>> >> the top one written by Jacob.
>>>> >
>>>> > 1 = etc.c.
>>>> > 2 = Database classes
>>>> > 3 = ??
>>>> > 4 = ORM
>>>> >
>>>> > Please explain ?
>>> What I meant was that there might be a layer here that would provide a
>>> common interface to the supported databases in terms of literal SQL
>>> commands, as embodied in Andrei's example
>>>
>>
>> I was thinking more like
>> 1) etc.c.mysql/pg - c interface
>> 2) std.sql.mysql/pg - d interface using templates, ranges etc
>> 3) Database classes - common interface
>> 4) ORM
>
> Sorry, I don't get it. IMHO 2) and 3) are at the same level.. F.I.
> a draft :
>
> http://pastebin.com/n8H0QF8X
>

2) doesn't hide any features of the database. If the database supports a 
feature, it's here.
3) is a common interface - will hide the specific database, including 
features unique for this db.

At any level, you should be able to drop down to the lower levels if 
necessary.

Of course... 4) could be built directly on 1), 2) or 3). Step 2) isn't 
really needed as long as you can get internal handles and drop down to 
1), but having a clean D interface instead would be nice.


More information about the Digitalmars-d mailing list