www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Easy and efficient database usage

reply w0rp <devw0rp gmail.com> writes:
I keep finding myself thinking about what an API in D for easy 
and efficient database usage would look like. I started thinking 
about how ORM is done in libraries in other languages, and 
started to become obsessed with the notion that perhaps there 
should be a library for D which is roughly as convenient to use 
as an ORM, but tends towards greater efficiency, in particular 
for encouraging more efficient queries through the API, and for 
cutting down on the number of allocations done.

Has anyone had any thoughts on this so far? I work with Django in 
my day-to-day work, but I have often thought that it would be 
nice to have something for easy database access for D web server 
backends. So you can write low to medium scale web applications 
in some dynamic language, and high performance backends in D for 
large scale web projects. Django provides a variety of nice 
features for working with databases, and I wonder how they would 
be represented in D.

Does anyone have any thoughts on this topic?
Oct 23 2015
next sibling parent Laeeth Isharc <laeethnospam nospam.laeeth.com> writes:
On Friday, 23 October 2015 at 12:42:08 UTC, w0rp wrote:
 I keep finding myself thinking about what an API in D for easy 
 and efficient database usage would look like. I started 
 thinking about how ORM is done in libraries in other languages, 
 and started to become obsessed with the notion that perhaps 
 there should be a library for D which is roughly as convenient 
 to use as an ORM, but tends towards greater efficiency, in 
 particular for encouraging more efficient queries through the 
 API, and for cutting down on the number of allocations done.

 Has anyone had any thoughts on this so far? I work with Django 
 in my day-to-day work, but I have often thought that it would 
 be nice to have something for easy database access for D web 
 server backends. So you can write low to medium scale web 
 applications in some dynamic language, and high performance 
 backends in D for large scale web projects. Django provides a 
 variety of nice features for working with databases, and I 
 wonder how they would be represented in D.

 Does anyone have any thoughts on this topic?
https://github.com/rejectedsoftware/dotter Perhaps not exactly what you need, but this looked quite nice to me. Sönke doesn't seem to be doing much else, so I can't think why it's not finished yet ;) (and since this is the internet: I mean the opposite).
Oct 23 2015
prev sibling parent BLM768 <blm768 gmail.com> writes:
On Friday, 23 October 2015 at 12:42:08 UTC, w0rp wrote:
 Does anyone have any thoughts on this topic?
A couple of years ago, I started playing with the idea. The basic concept was to dump DB records into "dumb" (i.e. representing just the basic aspects of the model object) structs, which can be stack-allocated to minimize GC usage. It's very far from complete and has been dormant for a while, but someone might be able to make use of some of the code. It would probably need to be rewritten to use a "standard" DB driver framework, though; right now, it's just got its own abstraction layer over SQLite.
Nov 02 2015