Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Huon Wilson
On 12/12/13 09:57, Carter Schonwald wrote: as another point in the design space, a pretty idiom for SQL style dbs in haskell is the *-simple family of libs postgres simple http://hackage.haskell.org/package/postgresql-simple-0.3.7.0/docs/Database-PostgreSQL-Simple.html mysql-simple http://hack

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Piotr Kukiełka
If at some point of time something like haskell do notation or scala for comprehension will be implemented in rust then it would be worth to look at slick: http://slick.typesafe.com/ Example from slick home page: // @table("COFFEES") case cl

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Carter Schonwald
as another point in the design space, a pretty idiom for SQL style dbs in haskell is the *-simple family of libs postgres simple http://hackage.haskell.org/package/postgresql-simple-0.3.7.0/docs/Database-PostgreSQL-Simple.html mysql-simple http://hackage.haskell.org/package/mysql-simple-0.2.2.4/d

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread spir
On 12/11/2013 06:04 PM, Patrick Walton wrote: We aren't likely to block 1.0 on this. Instead of stabilizing all libraries once and for all in 1.0 like Go did, we're taking a gradual approach to libraries similar to that of node.js, in which 1.0 will have some library modules stable and some modul

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread spir
On 12/11/2013 07:14 PM, Kevin Ballard wrote: My belief is that a generic interface to DBs is only useful because that way you can write other DB-driven libraries that don't care about the details of the DB. I don't think I've ever seen code in the wild that uses this functionality though (alth

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread spir
On 12/11/2013 03:24 PM, Gaetan wrote: I would be inspired by the python interface: Yes, on this point python just does "the right thing". Denis ___ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Gaetan
most of the time: - either you rely on full abstraction of the db in your library (sql alchemy), ie, the library gives you a complete abstraction of the views/tables/ etc of the sql database. - either you just use the SQL statements with minor data type binding (dbapi). i ve used both, especially

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Kevin Ballard
My belief is that a generic interface to DBs is only useful because that way you can write other DB-driven libraries that don't care about the details of the DB. I don't think I've ever seen code in the wild that uses this functionality though (although, admittedly, I haven't looked at a lot of

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Diggory Hardy
On Wednesday 11 December 2013 17:27:43 John Mija wrote: > Sounds good me. > > I believed that the API would be frozen in 1.0 like Go. Besides, that > version is going to attract many developers and without a generic API to > build SQL drivers, it would be very chaotic to have different clients of

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread John Mija
Sounds good me. I believed that the API would be frozen in 1.0 like Go. Besides, that version is going to attract many developers and without a generic API to build SQL drivers, it would be very chaotic to have different clients of SQL engines with a different API instead of to have the same o

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Erick Tryzelaar
While I'm all in favor of having a standard SQL interface, but I don't think it needs to be a part of Rust's standard library. Instead I feel this is one of those libraries that can live outside of rust proper and be blessed by the community as being the standard SQL framework. Once rustpkg is done

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Steven Fackler
The interface can be made generic, but it'd require HKT and potentially some more work on removing spurious conflicting trait implementation warnings. It only uses trait objects for query parameters where you actually need an array of distinct types implementing an interface. I've also found that g

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Patrick Walton
On 12/11/13 3:01 AM, John Mija wrote: Before of release 1.0, it would be very good if it's added to the package standard a generic interface to be implemented by the packages of SQL drivers. We aren't likely to block 1.0 on this. Instead of stabilizing all libraries once and for all in 1.0 lik

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Gaetan
I agree python dbapi is pretty simple to use due to the dynamic nature of types in python. I like this rust postgre binding, I can't see why it cannot be extended to support mysql? Actually, my main reference is sqlalchemy but it's a step much higher in term of abstraction of the DB. - Gaeta

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Corey Richardson
Python has the advantage of dynamic typing, and Go runtime type assertions and variadics. Their interfaces probably aren't /too/ good for inspiration, especially Python's. See rust-postgres (https://github.com/sfackler/rust-postgres) for an existing DB binding. I think it's fairly idiomatic and an

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Masklinn
On 2013-12-11, at 15:24 , Gaetan wrote: > I'll be glad volunteering for this task, however I'm new in rust so I may > need to have some mentoring for this... > > I would be inspired by the python interface: > https://pypi.python.org/pypi/MySQL-python/1.2.4 A better inspiration than a specifi

Re: [rust-dev] Interface around SQL databases

2013-12-11 Thread Gaetan
I'll be glad volunteering for this task, however I'm new in rust so I may need to have some mentoring for this... I would be inspired by the python interface: https://pypi.python.org/pypi/MySQL-python/1.2.4 - Gaetan 2013/12/11 John Mija > Before of release 1.0, it would be very good if i

[rust-dev] Interface around SQL databases

2013-12-11 Thread John Mija
Before of release 1.0, it would be very good if it's added to the package standard a generic interface to be implemented by the packages of SQL drivers. As example, see packages "database/sql" and "database/sql/driver" in the Go's library: http://golang.org/pkg/database/