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 for python. The first kind is really complete, can handle database migration,.. but is really heavy and does not fit for all use (not be able to use it for 1/2 sql databases out in the wild). While the second one you can potentially interrogate any SQL databases, but maintenance can quickly becomes a nightmare. i am not really confortable having something too complex, because many times, developers will want to write their own abstraction of their database (every database is different). The way rust-postgre project does seem the good one for me. However, I don t think having a sql driver is a requirement for 1.0, but maybe to set a "standard" or reference project/library and avoid fragmentation... ----- Gaetan 2013/12/11 Kevin Ballard <ke...@sb.org> > 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 code that uses databases in general). > > -Kevin > > On Dec 11, 2013, at 9:10 AM, Steven Fackler <sfack...@gmail.com> wrote: > > 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 generic SQL interfaces are less than useful in the "I can > instantly swap from Postgres to SQLite with a config file toggle" sense > simply because their implementations of SQL (SERIAL vs AUTOINCREMENT, etc) > differ too much for it to work without a ton of pain. If anything, a > generic API would be nice just to push the APIs of different SQL client > libraries closer together. > > Someone could absolutely take the interface used by rust-postgres and make > a MySQL/MariaDB driver with it, but that person wouldn't be me :) > > Steven Fackler > > > On Wed, Dec 11, 2013 at 7:15 AM, Gaetan <gae...@xeberon.net> wrote: > >> 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. >> >> ----- >> Gaetan >> >> >> >> 2013/12/11 Corey Richardson <co...@octayn.net> >> >>> 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 any DB API >>> should draw inspiration from it. It leverages trait objects, though >>> it's unclear that that can be generic. Personally I've never really >>> been a fan of generic SQL APIs. Unless they leverage intense amounts >>> of magic (Entity Framework, SQLAlchemy), I find they end up being >>> crippled (luasql) or fairly uses (python's dbapi). >>> >>> Maybe that's just me. >>> >>> On Wed, Dec 11, 2013 at 9:24 AM, Gaetan <gae...@xeberon.net> 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 >>> > >>> > ----- >>> > Gaetan >>> > >>> > >>> > >>> > 2013/12/11 John Mija <jon...@proinbox.com> >>> >> >>> >> 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/ >>> >> _______________________________________________ >>> >> Rust-dev mailing list >>> >> Rust-dev@mozilla.org >>> >> https://mail.mozilla.org/listinfo/rust-dev >>> > >>> > >>> > >>> > _______________________________________________ >>> > Rust-dev mailing list >>> > Rust-dev@mozilla.org >>> > https://mail.mozilla.org/listinfo/rust-dev >>> > >>> >> >> >> _______________________________________________ >> Rust-dev mailing list >> Rust-dev@mozilla.org >> https://mail.mozilla.org/listinfo/rust-dev >> >> > _______________________________________________ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev > > >
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev