diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-19 19:20:18 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-19 19:20:18 -0400 |
| commit | 675558bffb3c58647cde2605186dd7d7d7d9e593 (patch) | |
| tree | 62b19270c21cd42706fb5c01b3cf9aed1d296687 /lib/sqlalchemy | |
| parent | 5cd1d774c2ed35eecd47cd189903640618ca89c3 (diff) | |
| download | sqlalchemy-675558bffb3c58647cde2605186dd7d7d7d9e593.tar.gz | |
- rework the sphinx customizations into distinct modules
- build a new Sphinx extension that allows dialect info
to be entered as directives which is then rendered consistently
throughout all dialect/dbapi sections
- break out the "empty_strings" requirement for oracle test
Diffstat (limited to 'lib/sqlalchemy')
37 files changed, 220 insertions, 378 deletions
diff --git a/lib/sqlalchemy/dialects/drizzle/base.py b/lib/sqlalchemy/dialects/drizzle/base.py index d32240c38..2b5df3860 100644 --- a/lib/sqlalchemy/dialects/drizzle/base.py +++ b/lib/sqlalchemy/dialects/drizzle/base.py @@ -6,7 +6,10 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the Drizzle database. +""" + +.. dialect:: drizzle + :name: Drizzle Drizzle is a variant of MySQL. Unlike MySQL, Drizzle's default storage engine is InnoDB (transactions, foreign-keys) rather than MyISAM. For more @@ -16,14 +19,6 @@ the `Drizzle Documentation <http://docs.drizzle.org/index.html>`_. The SQLAlchemy Drizzle dialect leans heavily on the MySQL dialect, so much of the :doc:`SQLAlchemy MySQL <mysql>` documentation is also relevant. -DBAPI Support -------------- - -The following dialect/driver options are available: - -``drizzle://``- uses mysqldb_ - -``drizzle+mysqldb://`` - uses mysqldb_ """ diff --git a/lib/sqlalchemy/dialects/drizzle/mysqldb.py b/lib/sqlalchemy/dialects/drizzle/mysqldb.py index ce9518a81..7d91cc368 100644 --- a/lib/sqlalchemy/dialects/drizzle/mysqldb.py +++ b/lib/sqlalchemy/dialects/drizzle/mysqldb.py @@ -1,15 +1,10 @@ -"""Support for the Drizzle database via the mysql-python adapter. - -MySQL-Python is available at: - - http://sourceforge.net/projects/mysql-python - -Connecting ------------ - -Connect string format:: +""" +.. dialect:: drizzle+mysqldb + :name: MySQL-Python + :dbapi: mysqldb + :connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> + :url: http://sourceforge.net/projects/mysql-python - drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> """ diff --git a/lib/sqlalchemy/dialects/firebird/base.py b/lib/sqlalchemy/dialects/firebird/base.py index b99040038..df20060e5 100644 --- a/lib/sqlalchemy/dialects/firebird/base.py +++ b/lib/sqlalchemy/dialects/firebird/base.py @@ -5,18 +5,9 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -Support for the Firebird database. -DBAPI Support -------------- - -The following dialect/driver options are available: - -``firebird://``- uses kinterbasdb_ - -``firebird+kinterbasdb://`` - uses kinterbasdb_ - -``firebird+fdb://`` - uses fdb_ +.. dialect:: firebird + :name: Firebird Firebird Dialects ----------------- diff --git a/lib/sqlalchemy/dialects/firebird/fdb.py b/lib/sqlalchemy/dialects/firebird/fdb.py index 3601b391b..aac3579d6 100644 --- a/lib/sqlalchemy/dialects/firebird/fdb.py +++ b/lib/sqlalchemy/dialects/firebird/fdb.py @@ -5,21 +5,15 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -fdb is a kinterbasdb compatible DBAPI for Firebird. +.. dialect:: firebird+fdb + :name: fdb + :dbapi: pyodbc + :connectstring: firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...] + :url: http://pypi.python.org/pypi/fdb/ -.. versionadded:: 0.8 - Support for the fdb Firebird driver. + fdb is a kinterbasdb compatible DBAPI for Firebird. -DBAPI ------ - -http://pypi.python.org/pypi/fdb/ - -Connecting ------------ - -Connect string format:: - - firebird+fdb://user:password@host:port/path/to/db[?key=value&key=value...] + .. versionadded:: 0.8 - Support for the fdb Firebird driver. Status ------ diff --git a/lib/sqlalchemy/dialects/firebird/kinterbasdb.py b/lib/sqlalchemy/dialects/firebird/kinterbasdb.py index 78fffd647..90fadde50 100644 --- a/lib/sqlalchemy/dialects/firebird/kinterbasdb.py +++ b/lib/sqlalchemy/dialects/firebird/kinterbasdb.py @@ -5,18 +5,11 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ - -DBAPI ------ - -http://firebirdsql.org/index.php?op=devel&sub=python - -Connecting ------------ - -Connect string format:: - - firebird+kinterbasdb://user:password@host:port/path/to/db[?key=value&key=value...] +.. dialect:: firebird+kinterbasdb + :name: kinterbasdb + :dbapi: kinterbasdb + :connectstring: firebird+kinterbasdb://user:password@host:port/path/to/db[?key=value&key=value...] + :url: http://firebirdsql.org/index.php?op=devel&sub=python Arguments ---------- diff --git a/lib/sqlalchemy/dialects/informix/base.py b/lib/sqlalchemy/dialects/informix/base.py index eff563a1d..f54bf6d37 100644 --- a/lib/sqlalchemy/dialects/informix/base.py +++ b/lib/sqlalchemy/dialects/informix/base.py @@ -5,7 +5,9 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the Informix database. +""" +.. dialect:: informix + :name: Informix .. note:: diff --git a/lib/sqlalchemy/dialects/informix/informixdb.py b/lib/sqlalchemy/dialects/informix/informixdb.py index b771e1501..474bc5f11 100644 --- a/lib/sqlalchemy/dialects/informix/informixdb.py +++ b/lib/sqlalchemy/dialects/informix/informixdb.py @@ -5,18 +5,12 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -Support for the informixdb DBAPI. -informixdb is available at: - - http://informixdb.sourceforge.net/ - -Connecting -^^^^^^^^^^ - -Sample informix connection:: - - engine = create_engine('informix+informixdb://user:password@host/dbname') +.. dialect:: informix+informixdb + :name: informixdb + :dbapi: informixdb + :connectstring: informix+informixdb://user:password@host/dbname + :url: http://informixdb.sourceforge.net/ """ diff --git a/lib/sqlalchemy/dialects/mssql/adodbapi.py b/lib/sqlalchemy/dialects/mssql/adodbapi.py index 5b2328269..747ea17db 100644 --- a/lib/sqlalchemy/dialects/mssql/adodbapi.py +++ b/lib/sqlalchemy/dialects/mssql/adodbapi.py @@ -5,7 +5,16 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -The adodbapi dialect is not implemented for 0.6 at this time. +.. dialect:: mssql+adodbapi + :name: adodbapi + :dbapi: adodbapi + :connectstring: mssql+adodbapi://<username>:<password>@<dsnname> + :url: http://adodbapi.sourceforge.net/ + +.. note:: + + The adodbapi dialect is not implemented SQLAlchemy versions 0.6 and + above at this time. """ import datetime diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index e8f0385b4..51884247f 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -4,7 +4,9 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the Microsoft SQL Server database. +""" +.. dialect:: mssql + :name: Microsoft SQL Server Auto Increment Behavior diff --git a/lib/sqlalchemy/dialects/mssql/mxodbc.py b/lib/sqlalchemy/dialects/mssql/mxodbc.py index 4e0af2d39..91922a442 100644 --- a/lib/sqlalchemy/dialects/mssql/mxodbc.py +++ b/lib/sqlalchemy/dialects/mssql/mxodbc.py @@ -5,24 +5,14 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -Support for MS-SQL via mxODBC. - -mxODBC is available at: - - http://www.egenix.com/ - -This was tested with mxODBC 3.1.2 and the SQL Server Native -Client connected to MSSQL 2005 and 2008 Express Editions. - -Connecting -~~~~~~~~~~ - -Connection is via DSN:: - - mssql+mxodbc://<username>:<password>@<dsnname> +.. dialect:: mssql+mxodbc + :name: mxODBC + :dbapi: mxodbc + :connectstring: mssql+mxodbc://<username>:<password>@<dsnname> + :url: http://www.egenix.com/ Execution Modes -~~~~~~~~~~~~~~~ +--------------- mxODBC features two styles of statement execution, using the ``cursor.execute()`` and ``cursor.executedirect()`` methods (the second being diff --git a/lib/sqlalchemy/dialects/mssql/pymssql.py b/lib/sqlalchemy/dialects/mssql/pymssql.py index 96b1511bd..881893422 100644 --- a/lib/sqlalchemy/dialects/mssql/pymssql.py +++ b/lib/sqlalchemy/dialects/mssql/pymssql.py @@ -5,28 +5,14 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -Support for the pymssql dialect. - -This dialect supports pymssql 1.0 and greater. - -pymssql is available at: - - http://pymssql.sourceforge.net/ - -Connecting -^^^^^^^^^^ - -Sample connect string:: - - mssql+pymssql://<username>:<password>@<freetds_name> - -Adding "?charset=utf8" or similar will cause pymssql to return -strings as Python unicode objects. This can potentially improve -performance in some scenarios as decoding of strings is -handled natively. +.. dialect:: mssql+pymssql + :name: pymssql + :dbapi: pymssql + :connectstring: mssql+pymssql://<username>:<password>@<freetds_name>?charset=utf8 + :url: http://pymssql.sourceforge.net/ Limitations -^^^^^^^^^^^ +----------- pymssql inherits a lot of limitations from FreeTDS, including: diff --git a/lib/sqlalchemy/dialects/mssql/pyodbc.py b/lib/sqlalchemy/dialects/mssql/pyodbc.py index 10149689a..47a4851b0 100644 --- a/lib/sqlalchemy/dialects/mssql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mssql/pyodbc.py @@ -5,14 +5,14 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -Support for MS-SQL via pyodbc. +.. dialect:: mssql+pyodbc + :name: PyODBC + :dbapi: pyodbc + :connectstring: mssql+pyodbc://<username>:<password>@<dsnname> + :url: http://pypi.python.org/pypi/pyodbc/ -pyodbc is available at: - - http://pypi.python.org/pypi/pyodbc/ - -Connecting -^^^^^^^^^^ +Additional Connection Examples +------------------------------- Examples of pyodbc connection string URLs: @@ -81,7 +81,7 @@ the python shell. For example:: 'dsn%3Dmydsn%3BDatabase%3Ddb' Unicode Binds -^^^^^^^^^^^^^ +------------- The current state of PyODBC on a unix backend with FreeTDS and/or EasySoft is poor regarding unicode; different OS platforms and versions of UnixODBC diff --git a/lib/sqlalchemy/dialects/mssql/zxjdbc.py b/lib/sqlalchemy/dialects/mssql/zxjdbc.py index 38deacfd6..1b36075b0 100644 --- a/lib/sqlalchemy/dialects/mssql/zxjdbc.py +++ b/lib/sqlalchemy/dialects/mssql/zxjdbc.py @@ -4,24 +4,13 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the Microsoft SQL Server database via the zxjdbc JDBC -connector. - -JDBC Driver ------------ - -Requires the jTDS driver, available from: http://jtds.sourceforge.net/ - -Connecting ----------- - -URLs are of the standard form of -``mssql+zxjdbc://user:pass@host:port/dbname[?key=value&key=value...]``. +""" +.. dialect:: mssql+zxjdbc + :name: zxJDBC for Jython + :dbapi: zxjdbc + :connectstring: mssql+zxjdbc://user:pass@host:port/dbname[?key=value&key=value...] + :driverurl: http://jtds.sourceforge.net/ -Additional arguments which may be specified either as query string -arguments on the URL, or as keyword arguments to -:func:`~sqlalchemy.create_engine()` will be passed as Connection -properties to the underlying JDBC driver. """ from ...connectors.zxJDBC import ZxJDBCConnector diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 7f67d7826..92c6f58a0 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -4,27 +4,10 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the MySQL database. - -DBAPI Support -------------- - -The following dialect/driver options are available: - -* :ref:`mysqldb` - -* :ref:`mysqlconnector` - -* :ref:`oursql` - -* :ref:`gaerdbms` - -* :ref:`pymysql` - -* :ref:`mysql_pyodbc` - -* :ref:`mysql_zxjdbc` +""" +.. dialect:: mysql + :name: MySQL Supported Versions and Features ------------------------------- @@ -55,11 +38,6 @@ Nested Transactions 5.0.3 See the official MySQL documentation for detailed information about features supported in any given server release. -Connecting ----------- - -See the API documentation on individual drivers for details on connecting. - Connection Timeouts ------------------- diff --git a/lib/sqlalchemy/dialects/mysql/gaerdbms.py b/lib/sqlalchemy/dialects/mysql/gaerdbms.py index 29a67a540..66180e233 100644 --- a/lib/sqlalchemy/dialects/mysql/gaerdbms.py +++ b/lib/sqlalchemy/dialects/mysql/gaerdbms.py @@ -3,29 +3,18 @@ # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for Google Cloud SQL on Google App Engine. - -This dialect is based primarily on the :mod:`.mysql.mysqldb` dialect with minimal -changes. - -.. versionadded:: 0.7.8 - -DBAPI ------ - - https://developers.google.com/appengine/docs/python/cloud-sql/developers-guide - -Connecting ----------- - -Connect string format:: +""" +.. dialect:: mysql+gaerdbms + :name: Google Cloud SQL + :dbapi: rdbms + :connectstring: mysql+gaerdbms:///<dbname>?instance=instancename + :url: https://developers.google.com/appengine/docs/python/cloud-sql/developers-guide - mysql+gaerdbms:///<dbname> + This dialect is based primarily on the :mod:`.mysql.mysqldb` dialect with minimal + changes. -E.g.:: + .. versionadded:: 0.7.8 - create_engine('mysql+gaerdbms:///mydb', - connect_args={"instance":"instancename"}) Pooling ------- diff --git a/lib/sqlalchemy/dialects/mysql/mysqlconnector.py b/lib/sqlalchemy/dialects/mysql/mysqlconnector.py index ea8d9322c..82d906785 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqlconnector.py +++ b/lib/sqlalchemy/dialects/mysql/mysqlconnector.py @@ -4,21 +4,13 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the MySQL database via the MySQL Connector/Python adapter. - -DBAPI ------ - -MySQL Connector/Python is available at: - - https://launchpad.net/myconnpy - -Connecting ------------ - -Connect string format:: +""" +.. dialect:: mysql+mysqlconnector + :name: MySQL Connector/Python + :dbapi: myconnpy + :connectstring: mysql+mysqlconnector://<user>:<password>@<host>[:<port>]/<dbname> + :url: https://launchpad.net/myconnpy - mysql+mysqlconnector://<user>:<password>@<host>[:<port>]/<dbname> """ diff --git a/lib/sqlalchemy/dialects/mysql/mysqldb.py b/lib/sqlalchemy/dialects/mysql/mysqldb.py index add0c00ee..7385f6e60 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqldb.py +++ b/lib/sqlalchemy/dialects/mysql/mysqldb.py @@ -4,21 +4,14 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the MySQL database via the MySQL-python adapter. - -DBAPI ------ - -MySQL-Python is available at: - - http://sourceforge.net/projects/mysql-python - -Connecting ------------ +""" -Connect string format:: +.. dialect:: mysql+mysqldb + :name: MySQL-Python + :dbapi: mysqldb + :connectstring: mysql+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> + :url: http://sourceforge.net/projects/mysql-python - mysql+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> Unicode ------- diff --git a/lib/sqlalchemy/dialects/mysql/oursql.py b/lib/sqlalchemy/dialects/mysql/oursql.py index ca713a068..cc4e3b5f2 100644 --- a/lib/sqlalchemy/dialects/mysql/oursql.py +++ b/lib/sqlalchemy/dialects/mysql/oursql.py @@ -4,21 +4,13 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the MySQL database via the oursql adapter. - -DBAPI ------ - -OurSQL is available at: - - http://packages.python.org/oursql/ - -Connecting ------------ - -Connect string format:: +""" - mysql+oursql://<user>:<password>@<host>[:<port>]/<dbname> +.. dialect:: mysql+oursql + :name: OurSQL + :dbapi: oursql + :connectstring: mysql+oursql://<user>:<password>@<host>[:<port>]/<dbname> + :url: http://packages.python.org/oursql/ Unicode ------- diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py index b6f2d4384..36b49ba3b 100644 --- a/lib/sqlalchemy/dialects/mysql/pymysql.py +++ b/lib/sqlalchemy/dialects/mysql/pymysql.py @@ -4,21 +4,13 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the MySQL database via the pymysql adapter. - -DBAPI ------ - -pymysql is available at: - - http://code.google.com/p/pymysql/ - -Connecting ----------- - -Connect string:: +""" - mysql+pymysql://<username>:<password>@<host>/<dbname>[?<options>] +.. dialect:: mysql+pymysql + :name: PyMySQL + :dbapi: pymysql + :connectstring: mysql+pymysql://<username>:<password>@<host>/<dbname>[?<options>] + :url: http://code.google.com/p/pymysql/ MySQL-Python Compatibility -------------------------- diff --git a/lib/sqlalchemy/dialects/mysql/pyodbc.py b/lib/sqlalchemy/dialects/mysql/pyodbc.py index 20cc53be7..2736ef7a4 100644 --- a/lib/sqlalchemy/dialects/mysql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mysql/pyodbc.py @@ -4,21 +4,15 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the MySQL database via the pyodbc adapter. - -DBAPI ------ - -pyodbc is available at: - - http://pypi.python.org/pypi/pyodbc/ +""" -Connecting ----------- -Connect string:: +.. dialect:: mysql+pyodbc + :name: PyODBC + :dbapi: pyodbc + :connectstring: mysql+pyodbc://<username>:<password>@<dsnname> + :url: http://pypi.python.org/pypi/pyodbc/ - mysql+pyodbc://<username>:<password>@<dsnname> Limitations ----------- diff --git a/lib/sqlalchemy/dialects/mysql/zxjdbc.py b/lib/sqlalchemy/dialects/mysql/zxjdbc.py index 82e7dca8d..955044a58 100644 --- a/lib/sqlalchemy/dialects/mysql/zxjdbc.py +++ b/lib/sqlalchemy/dialects/mysql/zxjdbc.py @@ -4,20 +4,13 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the MySQL database via Jython's zxjdbc JDBC connector. - -DBAPI ------ - -The official MySQL JDBC driver is at -http://dev.mysql.com/downloads/connector/j/. - -Connecting ----------- - -Connect string:: +""" - mysql+zxjdbc://<user>:<password>@<hostname>[:<port>]/<database> +.. dialect:: mysql+zxjdbc + :name: zxjdbc for Jython + :dbapi: zxjdbc + :connectstring: mysql+zxjdbc://<user>:<password>@<hostname>[:<port>]/<database> + :driverurl: http://dev.mysql.com/downloads/connector/j/ Character Sets -------------- diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py index ee4a82115..7b1470f63 100644 --- a/lib/sqlalchemy/dialects/oracle/base.py +++ b/lib/sqlalchemy/dialects/oracle/base.py @@ -4,9 +4,11 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the Oracle database. +""" +.. dialect:: oracle + :name: Oracle -Oracle version 8 through current (11g at the time of this writing) are supported. + Oracle version 8 through current (11g at the time of this writing) are supported. Connect Arguments ----------------- diff --git a/lib/sqlalchemy/dialects/oracle/cx_oracle.py b/lib/sqlalchemy/dialects/oracle/cx_oracle.py index ddd61e5a9..233f3cb27 100644 --- a/lib/sqlalchemy/dialects/oracle/cx_oracle.py +++ b/lib/sqlalchemy/dialects/oracle/cx_oracle.py @@ -4,24 +4,19 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the Oracle database via the cx_oracle driver. - -Driver ------- +""" -The Oracle dialect uses the cx_oracle driver, available at -http://cx-oracle.sourceforge.net/ . The dialect has several behaviors -which are specifically tailored towards compatibility with this module. -Version 5.0 or greater is **strongly** recommended, as SQLAlchemy makes -extensive use of the cx_oracle output converters for numeric and -string conversions. +.. dialect:: oracle+cx_oracle + :name: cx-Oracle + :dbapi: cx_oracle + :connectstring: oracle+cx_oracle://user:pass@host:port/dbname[?key=value&key=value...] + :url: http://cx-oracle.sourceforge.net/ -Connecting ----------- +Additional Connect Arguments +---------------------------- -Connecting with create_engine() uses the standard URL approach of -``oracle://user:pass@host:port/dbname[?key=value&key=value...]``. If dbname is -present, the host, port, and dbname tokens are converted to a TNS name using +When connecting with ``dbname`` present, the host, port, and dbname tokens are +converted to a TNS name using the cx_oracle :func:`makedsn()` function. Otherwise, the host token is taken directly as a TNS name. diff --git a/lib/sqlalchemy/dialects/oracle/zxjdbc.py b/lib/sqlalchemy/dialects/oracle/zxjdbc.py index 3a0f45665..54608969b 100644 --- a/lib/sqlalchemy/dialects/oracle/zxjdbc.py +++ b/lib/sqlalchemy/dialects/oracle/zxjdbc.py @@ -4,13 +4,12 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the Oracle database via the zxjdbc JDBC connector. - -JDBC Driver ------------ - -The official Oracle JDBC driver is at -http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html. +""" +.. dialect:: oracle+zxjdbc + :name: zxJDBC for Jython + :dbapi: zxjdbc + :connectstring: oracle+zxjdbc://user:pass@host/dbname + :driverurl: http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html. """ import decimal diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 0d2cb3c8f..625ece6a1 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -4,20 +4,10 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the PostgreSQL database. - -DBAPI Support -------------- - -The following dialect/driver options are available: - -* :ref:`psycopg2` - -* :ref:`pg8000` - -* :ref:`pypostgresql` +""" +.. dialect:: postgresql + :name: PostgreSQL -* :ref:`zxjdbc` Sequences/SERIAL ---------------- diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index e19d84b51..6a7c5cecb 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -4,19 +4,12 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the PostgreSQL database via the pg8000 driver. - -DBAPI ------- - - http://pybrary.net/pg8000/ - -Connecting ----------- - -Connect string format:: - - postgresql+pg8000://user:password@host:port/dbname[?key=value&key=value...] +""" +.. dialect:: postgresql+pg8000 + :name: pg8000 + :dbapi: pg8000 + :connectstring: postgresql+pg8000://user:password@host:port/dbname[?key=value&key=value...] + :url: http://pybrary.net/pg8000/ Unicode ------- diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 14fb35456..700f76793 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -4,23 +4,12 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the PostgreSQL database via the psycopg2 driver. - -DBAPI ------- - -The psycopg2 driver is available at http://pypi.python.org/pypi/psycopg2/ . -The dialect has several behaviors which are specifically tailored towards compatibility -with this module. - -Note that psycopg1 is **not** supported. - -Connecting ----------- - -Connect string format:: - - postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...] +""" +.. dialect:: postgresql+psycopg2 + :name: psycopg2 + :dbapi: psycopg2 + :connectstring: postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...] + :url: http://pypi.python.org/pypi/psycopg2/ psycopg2 Connect Arguments ----------------------------------- diff --git a/lib/sqlalchemy/dialects/postgresql/pypostgresql.py b/lib/sqlalchemy/dialects/postgresql/pypostgresql.py index cf091b311..e7023610b 100644 --- a/lib/sqlalchemy/dialects/postgresql/pypostgresql.py +++ b/lib/sqlalchemy/dialects/postgresql/pypostgresql.py @@ -4,19 +4,12 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the PostgreSQL database via py-postgresql. - -DBAPI ------ - - http://python.projects.pgfoundry.org/ - -Connecting ----------- - -Connect string format:: - - postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...] +""" +.. dialect:: postgresql+pypostgresql + :name: py-postgresql + :dbapi: pypostgresql + :connectstring: postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...] + :url: http://python.projects.pgfoundry.org/ """ diff --git a/lib/sqlalchemy/dialects/postgresql/zxjdbc.py b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py index 381424c7f..196d77aaa 100644 --- a/lib/sqlalchemy/dialects/postgresql/zxjdbc.py +++ b/lib/sqlalchemy/dialects/postgresql/zxjdbc.py @@ -4,19 +4,12 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the PostgreSQL database via the zxjdbc JDBC connector. - -DBAPI ------------ - -The official Postgresql JDBC driver is at http://jdbc.postgresql.org/. - -Connecting ----------- - -Connect string format:: - - postgresql+zxjdbc://scott:tiger@localhost/db +""" +.. dialect:: postgresql+zxjdbc + :name: zxJDBC for Jython + :dbapi: zxjdbc + :connectstring: postgresql+zxjdbc://scott:tiger@localhost/db + :driverurl: http://jdbc.postgresql.org/ """ diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index eb03a55c4..c7ac2bba4 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -4,7 +4,10 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the SQLite database. +""" +.. dialect:: sqlite + :name: SQLite + Date and Time Types ------------------- diff --git a/lib/sqlalchemy/dialects/sqlite/pysqlite.py b/lib/sqlalchemy/dialects/sqlite/pysqlite.py index 648867094..558f1016b 100644 --- a/lib/sqlalchemy/dialects/sqlite/pysqlite.py +++ b/lib/sqlalchemy/dialects/sqlite/pysqlite.py @@ -4,10 +4,15 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for the SQLite database via pysqlite. +""" +.. dialect:: sqlite+pysqlite + :name: pysqlite + :dbapi: sqlite3 + :connectstring: sqlite+pysqlite:///file_path + :url: http://docs.python.org/library/sqlite3.html -Note that pysqlite is the same driver as the ``sqlite3`` -module included with the Python distribution. + Note that ``pysqlite`` is the same driver as the ``sqlite3`` + module included with the Python distribution. Driver ------ @@ -26,14 +31,12 @@ this explicitly:: from sqlite3 import dbapi2 as sqlite e = create_engine('sqlite+pysqlite:///file.db', module=sqlite) -Full documentation on pysqlite is available at: -`<http://www.initd.org/pub/software/pysqlite/doc/usage-guide.html>`_ Connect Strings --------------- The file specification for the SQLite database is taken as the "database" portion of -the URL. Note that the format of a url is:: +the URL. Note that the format of a SQLAlchemy url is:: driver://user:pass@host/database diff --git a/lib/sqlalchemy/dialects/sybase/base.py b/lib/sqlalchemy/dialects/sybase/base.py index 9a1a5bdf3..2d213ed5b 100644 --- a/lib/sqlalchemy/dialects/sybase/base.py +++ b/lib/sqlalchemy/dialects/sybase/base.py @@ -8,7 +8,10 @@ # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php -"""Support for Sybase Adaptive Server Enterprise (ASE). +""" + +.. dialect:: sybase + :name: Sybase .. note:: diff --git a/lib/sqlalchemy/dialects/sybase/mxodbc.py b/lib/sqlalchemy/dialects/sybase/mxodbc.py index f88b1ed3c..2bf4071dd 100644 --- a/lib/sqlalchemy/dialects/sybase/mxodbc.py +++ b/lib/sqlalchemy/dialects/sybase/mxodbc.py @@ -3,11 +3,17 @@ # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php - """ -Support for Sybase via mxodbc. -This dialect is a stub only and is likely non functional at this time. +.. dialect:: sybase+mxodbc + :name: mxODBC + :dbapi: mxodbc + :connectstring: sybase+mxodbc://<username>:<password>@<dsnname> + :url: http://www.egenix.com/ + +.. note:: + + This dialect is a stub only and is likely non functional at this time. """ diff --git a/lib/sqlalchemy/dialects/sybase/pyodbc.py b/lib/sqlalchemy/dialects/sybase/pyodbc.py index 70bdd71a2..c4badd3e5 100644 --- a/lib/sqlalchemy/dialects/sybase/pyodbc.py +++ b/lib/sqlalchemy/dialects/sybase/pyodbc.py @@ -5,14 +5,12 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -Support for Sybase via pyodbc. +.. dialect:: sybase+pyodbc + :name: PyODBC + :dbapi: pyodbc + :connectstring: sybase+pyodbc://<username>:<password>@<dsnname>[/<database>] + :url: http://pypi.python.org/pypi/pyodbc/ -http://pypi.python.org/pypi/pyodbc/ - -Connect strings are of the form:: - - sybase+pyodbc://<username>:<password>@<dsn>/ - sybase+pyodbc://<username>:<password>@<host>/<database> Unicode Support --------------- diff --git a/lib/sqlalchemy/dialects/sybase/pysybase.py b/lib/sqlalchemy/dialects/sybase/pysybase.py index bf8c2096b..58a669be0 100644 --- a/lib/sqlalchemy/dialects/sybase/pysybase.py +++ b/lib/sqlalchemy/dialects/sybase/pysybase.py @@ -5,13 +5,11 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php """ -Support for Sybase via the python-sybase driver. - -http://python-sybase.sourceforge.net/ - -Connect strings are of the form:: - - sybase+pysybase://<username>:<password>@<dsn>/[database name] +.. dialect:: sybase+pysybase + :name: Python-Sybase + :dbapi: Sybase + :connectstring: sybase+pysybase://<username>:<password>@<dsn>/[database name] + :url: http://python-sybase.sourceforge.net/ Unicode Support --------------- diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index ade1fd241..163e04947 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -186,8 +186,15 @@ class SuiteRequirements(Requirements): return exclusions.open() @property - def empty_strings(self): - """target database can persist/return an empty string.""" + def empty_strings_varchar(self): + """target database can persist/return an empty string with a varchar.""" + + return exclusions.open() + + @property + def empty_strings_text(self): + """target database can persist/return an empty string with an + unbounded text.""" return exclusions.open() diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py index 361d784b8..cd7b61f42 100644 --- a/lib/sqlalchemy/testing/suite/test_types.py +++ b/lib/sqlalchemy/testing/suite/test_types.py @@ -70,8 +70,7 @@ class _UnicodeFixture(object): assert isinstance(row[0], unicode) - @requirements.empty_strings - def test_empty_strings(self): + def _test_empty_strings(self): unicode_table = self.tables.unicode_table config.db.execute( @@ -89,9 +88,17 @@ class UnicodeVarcharTest(_UnicodeFixture, fixtures.TablesTest): datatype = Unicode(255) + @requirements.empty_strings_varchar + def test_empty_strings(self): + self._test_empty_strings() + class UnicodeTextTest(_UnicodeFixture, fixtures.TablesTest): __requires__ = 'unicode_data', 'text_type' datatype = UnicodeText() + @requirements.empty_strings_text + def test_empty_strings(self): + self._test_empty_strings() + __all__ = ('UnicodeVarcharTest', 'UnicodeTextTest')
\ No newline at end of file |
