Commit Graph

803 Commits

Author SHA1 Message Date
Roman Podolyaka a1ceae2ed3 Add AUTOCOMMIT isolation level support for psycopg2
One can use this to emit statements, which can not be
executed within a transaction (e. g. CREATE DATABASE):

    from sqlalchemy import create_engine

    eng = create_engine('postgresql://test:test@localhost/test')

    conn = eng.connect().execution_options(isolation_level='AUTOCOMMIT')
    conn.execute('CREATE DATABASE test2;')

Fixes issue #2072.
2013-06-15 16:54:50 +03:00
Chris Withers b2ea2eef5d Implement EXCLUDE constraints for postgres. 2013-06-10 12:09:56 +01:00
Chris Withers f4020282b7 add support for range operators listed in http://www.postgresql.org/docs/9.2/interactive/functions-range.html 2013-06-10 12:09:55 +01:00
Chris Withers 70edfa229c Basic type support for the new range types in postgres 9.2 2013-06-10 12:09:55 +01:00
Mike Bayer 85368d25ed get nested joins to render on oracle 8 2013-06-08 18:54:14 -04:00
Mike Bayer 5d4bb7c213 most of these dialect=mysql.dialect() calls are redundant 2013-06-08 14:49:56 -04:00
Roman Podolyaka 4cc9d482ae Fix using of 'mysql_length' for composite indexes
Currently, one can specify the prefix length for an index
column using 'mysql_length' keyword argument when creating
an Index instance. But in case of composite indexes the
prefix length value is applied only to the last column.

Extend the existing API in way so that 'mysql_length' argument
value can be either:
    - an integer specifying the same prefix length value
      for each column of an index
    - a (column_name --> integer value) mapping specifying
      the prefix length value for each column of an index
      separately

Fixes issue #2704.
2013-06-08 20:56:28 +03:00
Mike Bayer 555f30d64c When querying the information schema on SQL Server 2000, removed
a CAST call that was added in 0.8.1 to help with driver issues,
which apparently is not compatible on 2000.
The CAST remains in place for SQL Server 2005 and greater.
[ticket:2747]
2013-06-06 12:52:18 -04:00
Mike Bayer ada1927529 The `deferrable keyword argument on :class:.ForeignKey` and
:class:`.ForeignKeyConstraint` will not render the ``DEFERRABLE`` keyword
on the MySQL dialect.  For a long time we left this in place because
a non-deferrable foreign key would act very differently than a deferrable
one, but some environments just disable FKs on MySQL, so we'll be less
opinionated here. [ticket:2721]
2013-06-03 18:33:20 -04:00
Mike Bayer 6c4a61b07a - repair for py3k
- fix test
2013-05-29 18:29:12 -04:00
Mike Bayer 534e05888e hstores are text, and in py3k they seem to be implcitly unicode. so
add unicode encoding for py2k for the non-native hstore, pullreq for
    native psycopg2 support coming....
2013-05-29 18:08:28 -04:00
Mike Bayer 2e8816c88f mssql test fixes 2013-05-26 19:49:50 -04:00
Mike Bayer 38f65baf18 - oracle tests passing in py3k!! 2013-05-26 17:58:07 -04:00
Mike Bayer abc4331293 a few more oracle fixes 2013-05-26 17:39:53 -04:00
Mike Bayer 46b0b14fde cleanup for oracle 2013-05-26 17:37:03 -04:00
Mike Bayer 4e930a7f78 - add a test specific to sqlite testing cursor.description encoding (should
probably be one in test_query or test_unicode...)
- fix up test_unitofwork
2013-05-26 16:58:37 -04:00
Mike Bayer b3654ee37a postgresql tests 2013-05-26 16:39:50 -04:00
Mike Bayer f939abe830 mysql tests 2013-05-26 16:32:55 -04:00
Mike Bayer eb06c142fc Merge branch 'master' into rel_0_9 2013-05-26 13:11:21 -04:00
Mike Bayer 62c7e0dbe6 sqlite tests 2013-05-26 13:10:00 -04:00
Chris Withers d630a2e6ef Add missing import that caused test_notice_logging to fail if this suite was run on its own. 2013-05-26 13:05:53 +01:00
Mike Bayer 2e75f668f3 merge default 2013-05-15 15:47:11 -04:00
Mike Bayer cfb0f9ca14 Regression from this ticket caused the unsupported keyword
"true" to render, added logic to convert this to 1/0
for SQL server.
[ticket:2682]
2013-05-15 15:46:29 -04:00
Mike Bayer 734376130f postgresql dialect tests 2013-04-28 16:27:23 -04:00
Mike Bayer 4b614b9b35 - the raw 2to3 run
- went through examples/ and cleaned out excess list() calls
2013-04-27 19:53:57 -04:00
Mike Bayer 63c211f427 tweak this some more to handle the array being empty again 2013-04-22 17:24:31 -04:00
Mike Bayer d2f8c83e25 - change to [ticket:2681], pre-coerce the array to list
unconditonally instead so that it works in all cases.
2013-04-22 17:08:02 -04:00
Mike Bayer 422f471871 The operators for the Postgresql ARRAY type supports
input types of sets, generators, etc. but only when a dimension
is specified for the ARRAY; otherwise, the dialect
needs to peek inside of "arr[0]" to guess how many
dimensions are in use.  If this occurs with a non
list/tuple type, the error message is now informative
and directs to specify a dimension for the ARRAY.
[ticket:2681]
2013-04-22 16:57:15 -04:00
Mike Bayer 41b70ff888 - establish ordering here for the hstore repr test 2013-04-20 11:47:25 -04:00
Mike Bayer 0790efcf87 - this pymssql test needs to be against the pymssql dialect
- Part of a longer series of fixes needed for pyodbc+
      mssql, a CAST to NVARCHAR(max) has been added to the bound
      parameter for the table name and schema name in all information schema
      queries to avoid the issue of comparing NVARCHAR to NTEXT,
      which seems to be rejected by the ODBC driver in some cases,
      such as FreeTDS (0.91 only?) plus unicode bound parameters being passed.
      The issue seems to be specific to the SQL Server information
      schema tables and the workaround is harmless for those cases
      where the problem doesn't exist in the first place.
[ticket:2355]
2013-04-18 17:41:30 -04:00
Mike Bayer 7dff6f6d49 - test all pymssql messages here
- changelog
2013-03-29 12:09:11 -04:00
Mike Bayer 7aea1bfc8e Merged in sontek/sqlalchemy/add_better_disconnect_checks (pull request #47)
Add disconnect check on timeouts
2013-03-29 12:03:17 -04:00
Marc Abramowitz f79b41243d Make MonkeyPatchedBinaryTest not fail on Python 2.5 (which doesn't have
the `b` notation for byte string literals)
2013-03-20 22:37:05 -07:00
Marc Abramowitz e90b2ccdfb Make MonkeyPatchedBinaryTest only run when using mssql. Prevents failed
tests when using a different dialect.
2013-03-18 15:29:54 -07:00
John Anderson eefa4b68f5 cleaned up errors, only check for connection timeout for now 2013-03-18 15:04:30 -07:00
John Anderson cb43db6bd1 Added disconnect checks for timeout, unable to read, and unable to write 2013-03-18 14:49:28 -07:00
Marc Abramowitz c97889af6d Add a test for http://www.sqlalchemy.org/trac/ticket/2683
This test currently passes in Python 2 but fails in Python 3.
2013-03-18 13:38:54 -07:00
Mike Bayer 9ad9ccec87 0.8.1 bump + test, changelog for hstore fix [ticket:2680] 2013-03-18 12:55:56 -07:00
Mike Bayer a0de45185b Added support for Postgresql's traditional SUBSTRING
function syntax, renders as "SUBSTRING(x FROM y FOR z)"
when regular ``func.substring()`` is used.
Also in 0.7.11.  Courtesy Gunnlaugur Por Briem.
[ticket:2676]
2013-03-09 17:40:06 -05:00
Mike Bayer c8a80e2130 - remove all compat items that are pre-2.5 (hooray)
- other cleanup
- don't need compat.decimal, that approach never panned out. hopefully
outside libs aren't pulling it in, they shouldn't be
2013-03-09 17:26:16 -05:00
Hajime Nakagami 60028c3607 test for cymysql 2013-02-17 15:07:19 +09:00
Mike Bayer cb19f227f3 The :meth:.ColumnOperators.in_ operator will now coerce
values of ``None`` to :func:`.null`.
[ticket:2496]
2013-02-02 16:17:58 -05:00
Audrius Kažukauskas dbdf4f25e2 Add ANY/ALL construct support for PostgreSQL's ARRAY type 2013-01-28 19:58:06 +02:00
Mike Bayer b1a01a6256 - replace mssql_ordering with generalized #695 solution
- documentation for mssql index options plus changelog and fixes
2013-01-20 12:43:39 -05:00
Mike Bayer bc75bbd62d Merged in dharland/sqlalchemy (pull request #35)
Add extra mssql dialect options to Index
2013-01-20 12:23:39 -05:00
Mike Bayer 2244c3febe - "postgres_where" has been removed 2013-01-16 23:53:00 -05:00
Derek Harland f5a5a6bf43 Add mssql_include option for mssql dialect 2013-01-14 17:03:38 +13:00
Derek Harland 38f7650072 Add mssql_ordering option for mssql dialect 2013-01-14 17:02:20 +13:00
Derek Harland 7198abb13e Add mssql_clustered option for mssql dialect 2013-01-14 17:00:37 +13:00
Mike Bayer 46a9209cde Added a py3K conditional around unnecessary .decode()
call in mssql information schema, fixes reflection
in Py3K. Also in 0.7.10. [ticket:2638]
2013-01-12 19:51:13 -05:00