Proposal: Database Engine for D

Mengu via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 5 14:12:05 PST 2016


On Tuesday, 5 January 2016 at 08:26:16 UTC, Jacob Carlborg wrote:
> On 2016-01-05 05:16, Chris Wright wrote:
>
>> Not proposing language changes was an intentional feature, not 
>> a mistake.
>
> Then you obviously can't use the operators. You would have to 
> fall back to methods:
>
> Person.where!(e => e.name.eq("John"));

i love how things can become so complex in this community. i am a 
web developer so i am going to talk in terms of simplicity.

as russel said, with SQLAlchemy (python library) operators are 
overloaded and we can do 
DBSession.query(User).filter(User.first_name == "Jacob", User.age 
 > 27). this will generate the following query:

"SELECT * FROM users u WHERE u.first_name = 'Jacob' AND u.age > 
27" and will let the DB handle the rest.

but as a web developer, i don't mind if i have to type 
User.where("first_name = ? AND age > 27", 
request.POST.get('name')). this will generate the same query 
above. i added the question mark to say the parameters should be 
escaped properly.

guys, what we need is a DB abstraction supporting PostgreSQL, 
MySQL and other major database systems and we need it yesterday. 
let's not make things more complex than they are and build up 
this thing.

p.s. this is not a reply to jacob, just his post was the one i 
clicked reply for. :-)


More information about the Digitalmars-d mailing list