From phd at phd.pp.ru Tue Oct 20 16:04:20 2009 From: phd at phd.pp.ru (Oleg Broytman) Date: Tue, 20 Oct 2009 18:04:20 +0400 Subject: [DB-SIG] SQLObject 0.12.0 Message-ID: <20091020140420.GC25709@phd.pp.ru> Hello! I'm pleased to announce version 0.12.0, the first stable release of branch 0.12 of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with. SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ Mailing list: https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss Archives: http://news.gmane.org/gmane.comp.python.sqlobject Download: http://cheeseshop.python.org/pypi/SQLObject/0.12.0 News and changes: http://sqlobject.org/News.html What's New ========== Features & Interface -------------------- * .selectBy(), .deleteBy() and .by*() methods pass all values through .from_python(), not only unicode. * The user can choose a DB API driver for SQLite by using a "backend" parameter in DB URI or SQLiteConnection that can be a comma-separated list of backend names. Possible backends are: "pysqlite2" (alias "sqlite2"), "sqlite3", "sqlite" (alias "sqlite1"). Default is to test pysqlite2, sqlite3 and sqlite in that order. * The user can choose a DB API driver for PostgreSQL by using a "backend" parameter in DB URI or PostgresConnection that can be a comma-separated list of backend names. Possible backends are: "psycopg2", "psycopg1", "psycopg" (tries psycopg2 and psycopg1), "pygresql". Default is "psycopg". WARNING: API change! PostgresConnection's parameter "usePygresql" is now replaced with "backend=pygresql". * The user can choose a DB API driver for MSSQL by using a "backend" parameter in DB URI or MSSQLConnection that can be a comma-separated list of backend names. Possible backends are: "adodb" (alias "adodbapi") and "pymssql". Default is to test adodbapi and pymssql in that order. * alternateMethodName is defined for all unique fields, not only alternateID; this makes SQLObject create .by*() methods for all unique fields. * SET client_encoding for PostgreSQL to the value of "charset" parameter in DB URI or PostgresConnection. * TimestampCol() can be instantiated without any defaults, in this case default will be None (good default for TIMESTAMP columns in MySQL). Small Features -------------- * Imported DB API drivers are stored as connection instance variables, not in global variables; this allows to use different DB API drivers at the same time; for example, PySQLite2 and sqlite3. * Removed all deprecated attribute and functions. * Removed the last remained string exceptions. For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytman http://phd.pp.ru/ phd at phd.pp.ru Programmers don't die, they just GOSUB without RETURN. From julians37 at googlemail.com Wed Oct 28 09:28:18 2009 From: julians37 at googlemail.com (Julian Scheid) Date: Wed, 28 Oct 2009 21:28:18 +1300 Subject: [DB-SIG] Test Suite? Message-ID: Hi, is there a test suite I can run to test conformance of a driver implementation to the DB-API 2.0 spec? JDBC, for example, has this: http://java.sun.com/products/jdbc/jdbctestsuite-1_3_1.html Thank you Julian From vernondcole at gmail.com Wed Oct 28 16:25:52 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 28 Oct 2009 09:25:52 -0600 Subject: [DB-SIG] Test Suite? In-Reply-To: References: Message-ID: There is such a test, written by Stuart Bishop. I was supposed to have contributed some Python 3000 patches to it, but got sidetracked. I will repent shortly. In the meantime, if you are using a version 2x Python you do not want my changes anyway... https://launchpad.net/dbapi-compliance Main branch is lp:dbapi-compliance -- Vernon Cole On Wed, Oct 28, 2009 at 2:28 AM, Julian Scheid wrote: > Hi, > > is there a test suite I can run to test conformance of a driver > implementation to the DB-API 2.0 spec? > > JDBC, for example, has this: > http://java.sun.com/products/jdbc/jdbctestsuite-1_3_1.html > > Thank you > > Julian > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Chris.Clark at ingres.com Wed Oct 28 17:27:32 2009 From: Chris.Clark at ingres.com (Chris Clark) Date: Wed, 28 Oct 2009 09:27:32 -0700 Subject: [DB-SIG] Test Suite? In-Reply-To: References: Message-ID: <4AE870F4.7050808@ingres.com> The great thing about standards is there are so many of them to pick from! I don't recall who originally said that but it is sort of apt here :-) I'm using http://stuartbishop.net/Software/DBAPI20TestSuite/ which is the original that Vernon was referring to. Vernon is your Launchpad project only for Python 3.x? There is also http://code.google.com/p/acute-dbapi/ (note I've not used it, I've not had chance to check it out). I get the impression this builds on http://stuartbishop.net/Software/DBAPI20TestSuite/ based on the credits SQL Alchemy has some more advanced tests (e.g. checks behavior on close of a connection with an attempted use on a cursor) BUT they are not generic as you need to write a driver wrapper. So in summary I'd suggest http://stuartbishop.net/Software/DBAPI20TestSuite/ If you could report any findings here I would appreciate it! If we can all agree on which test to use we can be in the same state as Java with a definitive test suite. Chris Vernon Cole wrote: > There is such a test, written by Stuart Bishop. I was supposed to have > contributed some Python 3000 patches to it, but got sidetracked. I > will repent shortly. In the meantime, if you are using a version 2x > Python you do not want my changes anyway... > https://launchpad.net/dbapi-compliance > Main branch is lp:dbapi-compliance > -- > Vernon Cole > > On Wed, Oct 28, 2009 at 2:28 AM, Julian Scheid > > wrote: > > Hi, > > is there a test suite I can run to test conformance of a driver > implementation to the DB-API 2.0 spec? > > JDBC, for example, has this: > http://java.sun.com/products/jdbc/jdbctestsuite-1_3_1.html > > Thank you > > Julian > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > > > ------------------------------------------------------------------------ > > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > From mike_mp at zzzcomputing.com Wed Oct 28 18:32:16 2009 From: mike_mp at zzzcomputing.com (Michael Bayer) Date: Wed, 28 Oct 2009 13:32:16 -0400 Subject: [DB-SIG] Test Suite? In-Reply-To: <4AE870F4.7050808@ingres.com> References: <4AE870F4.7050808@ingres.com> Message-ID: Chris Clark wrote: > > So in summary I'd suggest > http://stuartbishop.net/Software/DBAPI20TestSuite/ I've checked out this test suite, and it's great. One thing that I'd like to see in any suite, which I didn't see here, is a comprehensive exercising of unicode/encoding behavior. Python 3 will of course make this whole issue easier as there are fewer choices of behavior, but in the meantime this is always the area in which we (sqlalchemy) must adjust for a wide variety of behavioral quirks. Even though the spec says nothing about this, so perhaps is out of scope entirely, it would at least be nice to ensure that a DBAPI is consistent with itself in terms of its established encoding behavior: 1. Does the DBAPI accept Python unicode objects as the values within the "parameters" collection passed to the execute() and executemany() methods ? Or must these be str() objects in all cases, or if they contain characters that are not ASCII compatible ? 2. If yes to #1, does the DBAPI utilize the database's or the connection's established encoding parameters when passing data to the database ? Or if no, are properly encoded values passed through without issue if their encoding is compatible with that of the underlying database ? Does the usage of setinputsizes() have any impact on the situation ? 3. Do the tuples returned by the cursor.fetchXXX() methods represent string values as Python unicode objects ? Or are they Python unicode only in the case of result set values that were explicitly cast into certain types on the database side (i.e. NVARCHAR), or to any character type (VARCHAR, CHAR), or just for all string-like objects across the board (e.g. pysqlite) ? Or are strings returned as str() objects that are encoded ? 4. Does the DBAPI accept Python unicode objects as the value of the "operation" parameter passed to the execute() and executemany() methods (i.e. the actual statement) ? Or must these be str() objects ? 5. If yes to #4, are unicode objects which contain non-ASCII compatible characters accepted, provided they are compatible with the database's encoding ? This is to support table and column names that contain non-ASCII characters, for example. Or if no, are encoded strings accepted which contain non-ASCII characters ? In SQLAlchemy we have flags implemented at the class level of each dialect which specify what we've observed the behavior of the underlying wrapped DBAPI to be. The DBAPI test suite could provide similar flags, such that DBAPI authors can subclass the test suite class, provide the choices their DBAPI makes as to how to represent non-ASCII data and Python strings, and the test suite can then exercise consistency against these settings. At the very least this would compel DBAPI authors to consider what encoding behavior they'd like to have at both the parameter and statement level, and to implement it consistently. These days most new DBAPIs seem to be going the "all unicode everywhere" route, which is a good thing and is likely due to the coming of Python 3. The case is not as consistent for older DBAPIs, however. - mike > > If you could report any findings here I would appreciate it! If we can > all agree on which test to use we can be in the same state as Java with > a definitive test suite. > > Chris > > Vernon Cole wrote: >> There is such a test, written by Stuart Bishop. I was supposed to have >> contributed some Python 3000 patches to it, but got sidetracked. I >> will repent shortly. In the meantime, if you are using a version 2x >> Python you do not want my changes anyway... >> https://launchpad.net/dbapi-compliance >> Main branch is lp:dbapi-compliance >> -- >> Vernon Cole >> >> On Wed, Oct 28, 2009 at 2:28 AM, Julian Scheid >> > wrote: >> >> Hi, >> >> is there a test suite I can run to test conformance of a driver >> implementation to the DB-API 2.0 spec? >> >> JDBC, for example, has this: >> http://java.sun.com/products/jdbc/jdbctestsuite-1_3_1.html >> >> Thank you >> >> Julian >> _______________________________________________ >> DB-SIG maillist - DB-SIG at python.org >> http://mail.python.org/mailman/listinfo/db-sig >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> DB-SIG maillist - DB-SIG at python.org >> http://mail.python.org/mailman/listinfo/db-sig >> > > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > From julians37 at googlemail.com Wed Oct 28 21:28:58 2009 From: julians37 at googlemail.com (Julian Scheid) Date: Thu, 29 Oct 2009 09:28:58 +1300 Subject: [DB-SIG] Test Suite? In-Reply-To: <4AE870F4.7050808@ingres.com> References: <4AE870F4.7050808@ingres.com> Message-ID: On Thu, Oct 29, 2009 at 5:27 AM, Chris Clark wrote: > If you could report any findings here I would appreciate it! If we can all > agree on which test to use we can be in the same state as Java with a > definitive test suite. Thanks everyone, I'll give those a go and let you know what I find. From vernondcole at gmail.com Thu Oct 29 06:37:55 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 28 Oct 2009 23:37:55 -0600 Subject: [DB-SIG] Test Suite? In-Reply-To: References: <4AE870F4.7050808@ingres.com> Message-ID: Perhaps I did not make myself clear... The launchpad project IS Stuart Bishop's current source. He set it up so that it could be more easily maintained and is the Maintainer of the project. I have not (yet) submitted any changes. The test I use on Python 3x is this same test run through 2to3.py with a few changes where Python 3 breaks the PEP 429 definitions. (I have suggested to Marc-Andr? Lemburg that the PEP needs to be updated for Python 3 syntax, but he does not feel that a change is appropriate at this time.) This project tests only for DB-API compliance, and make no attempt to test things which are not part of the API such as those Michael Bayer suggests. IMHO Machael's comments are spot on, but should be addressed as part of a DB-API version 3. Marc-Andr? is against making a newer API, while BDFL is for it. Any one with patches can submit them through launchpad. https://launchpad.net/dbapi-compliance -- Vernon Cole On Wed, Oct 28, 2009 at 2:28 PM, Julian Scheid wrote: > On Thu, Oct 29, 2009 at 5:27 AM, Chris Clark > wrote: > > If you could report any findings here I would appreciate it! If we can > all > > agree on which test to use we can be in the same state as Java with a > > definitive test suite. > > Thanks everyone, I'll give those a go and let you know what I find. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Thu Oct 29 10:00:19 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Thu, 29 Oct 2009 03:00:19 -0600 Subject: [DB-SIG] Test Suite? In-Reply-To: References: <4AE870F4.7050808@ingres.com> Message-ID: A python 3 compatible branch has now been submitted for merge at https://launchpad.net/dbapi-compliance -- Vernon Cole -------------- next part -------------- An HTML attachment was scrubbed... URL: From stuart at stuartbishop.net Thu Oct 29 11:42:20 2009 From: stuart at stuartbishop.net (Stuart Bishop) Date: Thu, 29 Oct 2009 17:42:20 +0700 Subject: [DB-SIG] Test Suite? In-Reply-To: <4AE870F4.7050808@ingres.com> References: <4AE870F4.7050808@ingres.com> Message-ID: <6bc73d4c0910290342l7b2245d2wd4bd896022daa3eb@mail.gmail.com> On Wed, Oct 28, 2009 at 11:27 PM, Chris Clark wrote: > I'm using http://stuartbishop.net/Software/DBAPI20TestSuite/ which is the > original that Vernon was referring to. Vernon is your Launchpad project only > for Python 3.x? > > There is also http://code.google.com/p/acute-dbapi/ (note I've not used it, > I've not had chance to check it out). I get the impression this builds on > http://stuartbishop.net/Software/DBAPI20TestSuite/ based on the credits > So in summary I'd suggest http://stuartbishop.net/Software/DBAPI20TestSuite/ > > If you could report any findings here I would appreciate it! If we can all > agree on which test to use we can be in the same state as Java with a > definitive test suite. I've not seen acute-dbapi. If it is better than the tests I'm maintaining, I'm quite happy to pass the torch or accept patches. I'm currently not able to put much work into my code base besides being custodian. I two would love to see Unicode handling added to the spec. I'd also like to see many of the optional components become required (the ones that all the major drivers support already). Now we have support in Python core, it might be nice if a compliance suite could be added to Python core too. One thing I noticed with the test suite was how differently developers interpreted the spec - the test suite suite was much less open to interpretation than the spec as tests either passed or they didn't. (Not that Python core is necessary - maintaining the test suite in tandem with the spec has worked out ok so far even if it does lag behind major Python releases). -- Stuart Bishop http://www.stuartbishop.net/