Re: Abstract Database Interface

2012-12-24 Thread BLM768
I was kind of shocked to find this thread at the top of the list again; I thought it had died. :) This is a very interesting time for the thread to revive because I was just thinking about the project this morning... Now that my interest has revived a bit, I'm trying to figure out how to get

Re: Abstract Database Interface

2012-12-24 Thread Philippe Sigaud
On Sun, Dec 23, 2012 at 7:37 PM, Timon Gehr wrote: > On 10/31/2012 05:54 PM, Philippe Sigaud wrote: > >> >>> => is indeed a strange beast. >> Any possibility to put that on a wiki page or the dlang.org on >> operator overloading? >> >> > http://wiki.dlang.org/DWiki:**Operator_precedence

Re: Abstract Database Interface

2012-12-23 Thread Timon Gehr
On 10/31/2012 05:54 PM, Philippe Sigaud wrote: Timon: From higher to lower, where relational ops are unordered with respect to bitwise ops (this is the reason comparisons would have to be wrapped in parentheses in D as well): ! => (not a real operator, occurs twice this is binding power to th

Re: Abstract Database Interface

2012-11-06 Thread Marco Leise
Am Mon, 29 Oct 2012 08:50:19 +0100 schrieb "BLM768" : > > > I am working on similar project, named SQLd[1]. If you are > > interested, we can join forces and work togheder :) > > > > IRC Nick: Robik > > [1]: http://github.com/robik/SQLd > > That might be a good idea. I haven't done much for sup

Re: Abstract Database Interface

2012-10-31 Thread Philippe Sigaud
Timon: > From higher to lower, where relational ops are unordered with respect to > bitwise ops (this is the reason comparisons would have to be wrapped in > parentheses in D as well): > > ! > => (not a real operator, occurs twice this is binding power to the left) > . ++ -- ( [ > ^^ (right-associ

Re: Abstract Database Interface

2012-10-30 Thread Timon Gehr
On 10/30/2012 04:47 PM, Philippe Sigaud wrote: On Tue, Oct 30, 2012 at 3:44 PM, Jacob Carlborg wrote: How does that work with operator precedence? (...) But because of the operator precedence in Ruby you need to wrap every comparison in parentheses, not very pretty. I think the problem wou

Re: Abstract Database Interface

2012-10-30 Thread Philippe Sigaud
On Tue, Oct 30, 2012 at 3:44 PM, Jacob Carlborg wrote: > How does that work with operator precedence? (...) > But because of the operator precedence in Ruby you need to wrap every > comparison in parentheses, not very pretty. I think the problem would the same here. Of course, to know D operator

Re: Abstract Database Interface

2012-10-30 Thread Jacob Carlborg
On 2012-10-30 10:59, Philippe Sigaud wrote: && and || can be replaced by & and |, so there is a workaround. I feel much more limited by != and, even more problematic, !. Maybe unary - could be used in lieu of !. How does that work with operator precedence? There's a plugin for ActiveRecord,

Re: Abstract Database Interface

2012-10-30 Thread Jacob Carlborg
On 2012-10-30 13:04, Kapps wrote: There was a pull request for __traits(codeof, func) that would return the code for a symbol including lambda methods. It would probably be easier to have something like that for getting the AST and then using that to generate SQL queires (this is how C# / LINQ d

Re: Abstract Database Interface

2012-10-30 Thread Kapps
On Tuesday, 30 October 2012 at 10:01:06 UTC, Philippe Sigaud wrote: On Tue, Oct 30, 2012 at 9:15 AM, Jacob Carlborg wrote: On 2012-10-30 04:22, BLM768 wrote: If you make x some fancy wrapper type containing more fancy wrapper types with overloaded equality operators that return some sort of

Re: Abstract Database Interface

2012-10-30 Thread Philippe Sigaud
On Tue, Oct 30, 2012 at 9:15 AM, Jacob Carlborg wrote: > On 2012-10-30 04:22, BLM768 wrote: > >> If you make x some fancy wrapper type containing more fancy wrapper >> types with overloaded equality operators that return some sort of >> Expression class instead of a boolean, you might actually be

Re: Abstract Database Interface

2012-10-30 Thread Jacob Carlborg
On 2012-10-30 04:22, BLM768 wrote: If you make x some fancy wrapper type containing more fancy wrapper types with overloaded equality operators that return some sort of Expression class instead of a boolean, you might actually be able to get this to work with only D's current features. However,

Re: Abstract Database Interface

2012-10-29 Thread BLM768
If I recall correctly, Squeryl use Scala AST macros to support a query syntax, that in D would look, as below: class Person : Model { } void main () { auto p = new Person; p.name = "John Doe"; p.save(); p = Person.where!(x => x.name == "John Doe"); } If you make x some fa

Re: Abstract Database Interface

2012-10-29 Thread Jacob Carlborg
On 2012-10-29 18:43, BLM768 wrote: You can have a look at DataMapper. That's also for Ruby but it's not specific for SQL, if I recall correctly. Have a look at some ORM library written in Scala, I would guess they can be quite innovative and it's statically typed. http://squeryl.org/index.htm

Re: Abstract Database Interface

2012-10-29 Thread BLM768
You can have a look at DataMapper. That's also for Ruby but it's not specific for SQL, if I recall correctly. Have a look at some ORM library written in Scala, I would guess they can be quite innovative and it's statically typed. http://squeryl.org/index.html http://datamapper.org/ Those

Re: Abstract Database Interface

2012-10-29 Thread Jacob Carlborg
On 2012-10-29 15:42, BLM768 wrote: That's a good point. I haven't had any experience with other ORM libraries, so ActiveRecord was the closest thing that came to mind. I definitely do want to eventually capture some of ActiveRecord's features, but probably not all of them. I feel like the solut

Re: Abstract Database Interface

2012-10-29 Thread BLM768
My point was just that you removed the key features and soul of ActiveRecord. Without these features it's just like any other ORM library. That's a good point. I haven't had any experience with other ORM libraries, so ActiveRecord was the closest thing that came to mind. I definitely do w

Re: Abstract Database Interface

2012-10-29 Thread Jacob Carlborg
It's definitely not ActiveRecord, but my goal is just to take some inspiration from it, not to duplicate it. I'm very concerned about efficiency, which is why I'm using structs, and I like hard-coding the fields into the structure so there's some documentation of what the record is supposed to h

Re: Abstract Database Interface

2012-10-29 Thread BLM768
Looking at the API used in this example it would say that it's not very interesting and not very ActiveRecrod like. I think this looks more interesting and more like ActiveRecrod: class Person : Model { } void main () { auto p = new Person; p.name = "John Doe"; p.save(); p

Re: Abstract Database Interface

2012-10-29 Thread BLM768
I am working on similar project, named SQLd[1]. If you are interested, we can join forces and work togheder :) IRC Nick: Robik [1]: http://github.com/robik/SQLd That might be a good idea. I haven't done much for supporting different databases, so getting more backend support would be quite

Re: Abstract Database Interface

2012-10-28 Thread Robik
On Sunday, 28 October 2012 at 00:31:49 UTC, BLM768 wrote: I've recently been working with Ruby's ActiveRecord as part of my job, and I realized that D was powerful enough to make a similar abstraction layer. I've been playing with the idea for a little while, and I've put up some code at https

Re: Abstract Database Interface

2012-10-28 Thread Rory McGuire
I like, nice work. On 28 Oct 2012 02:35, "BLM768" wrote: > I've recently been working with Ruby's ActiveRecord as part of my job, and > I realized that D was powerful enough to make a similar abstraction layer. > I've been playing with the idea for a little while, and I've put up some > code at h

Re: Abstract Database Interface

2012-10-28 Thread Jacob Carlborg
On 2012-10-28 02:31, BLM768 wrote: I've recently been working with Ruby's ActiveRecord as part of my job, and I realized that D was powerful enough to make a similar abstraction layer. I've been playing with the idea for a little while, and I've put up some code at https://github.com/blm768/adbi.

Abstract Database Interface

2012-10-27 Thread BLM768
I've recently been working with Ruby's ActiveRecord as part of my job, and I realized that D was powerful enough to make a similar abstraction layer. I've been playing with the idea for a little while, and I've put up some code at https://github.com/blm768/adbi. It isn't nearly as comprehensive