Commit Graph

97 Commits

Author SHA1 Message Date
Mike Bayer f37aa86df8 revert this, bad idea 2012-02-13 19:29:38 -05:00
Mike Bayer 4bbd814fff - [bug] Fixed the "render literal bind" function,
used by Alembic, to escape % signs with %%.
2012-02-13 18:53:21 -05:00
Mike Bayer 09553dc90f - [feature] Dialect-specific compilers now raise
CompileException for all type/statement compilation
issues, instead of InvalidRequestError or ArgumentError.
The DDL for CREATE TABLE will re-raise
CompileExceptions to include table/column information
for the problematic column.  [ticket:2361]
2012-01-28 15:20:21 -05:00
Mike Bayer b854074c6d - [feature] Added create_type constructor argument
to pg.ENUM.  When False, no CREATE/DROP or
checking for the type will be performed as part
of a table create/drop event; only the
create()/drop)() methods called directly
will do this.  Helps with Alembic "offline"
scripts.
2011-11-28 22:28:28 -05:00
Mike Bayer e6a5ea8fa7 - [bug] Postgresql dialect memoizes that an ENUM of a
particular name was processed
during a create/drop sequence.  This allows
a create/drop sequence to work without any
calls to "checkfirst", and also means with
"checkfirst" turned on it only needs to
check for the ENUM once.  [ticket:2311]
2011-10-29 17:38:56 -04:00
Mike Bayer 5397d95365 - Added client_encoding parameter to create_engine()
when the postgresql+psycopg2 dialect is used;
calls the psycopg2 set_client_encoding() method
with the value upon connect.  [ticket:1839]
2011-10-15 15:05:51 -04:00
Mike Bayer 771f6fba4c add a test to confirm alter table of pk column gets reflected 2011-10-04 12:30:23 -04:00
Mike Bayer bf2f3595d0 - Added "postgresql_using" argument to Index(), produces
USING clause to specify index implementation for
    PG.  [ticket:2290].  Thanks to Ryan P. Kelly for
    the patch.
2011-10-02 17:17:46 -04:00
Mike Bayer 843847740c - Reflection functions for Table, Sequence no longer
case insensitive.  Names can be differ only in case
    and will be correctly distinguished.  [ticket:2256]
2011-09-09 17:12:52 -04:00
Mike Bayer 5bc91d48c2 this test only runs for PG 2011-08-12 22:58:46 -04:00
Mike Bayer 8b505e7c24 - Narrowed the assumption made when reflecting
a foreign-key referenced table with schema in
the current search path; an explicit schema will
be applied to the referenced table only if
it actually matches that of the referencing table,
which also has an explicit schema.   Previously
it was assumed that "current" schema was synonymous
with the full search_path.  [ticket:2249]
2011-08-09 19:45:20 -04:00
Mike Bayer 1ae69566cc fix keyword error 2011-07-20 11:09:04 -04:00
Mike Bayer b2d50f2807 - Added new "postgresql_ops" argument to
Index, allows specification of PostgreSQL
    operator classes for indexed columns.
    [ticket:2198]  Courtesy Filip Zyzniewski.
2011-07-20 10:49:36 -04:00
Mike Bayer c0f9221160 - Some unit test fixes regarding numeric arrays,
MATCH operator.   A potential floating-point
inaccuracy issue was fixed, and certain tests
of the MATCH operator only execute within an
EN-oriented locale for now.  [ticket:2175].
Also in 0.6.8.
2011-06-04 20:20:28 -04:00
Mike Bayer ef654af35a - Fixed bug affecting PG 9 whereby index reflection
would fail if against a column whose name
had changed.  [ticket:2141].  Also in 0.6.8.
2011-05-20 17:53:13 -04:00
Philip Jenvey ee2154d994 mark more postgresql+zxjdbc failures 2011-05-11 18:44:23 -07:00
Mike Bayer 6850ba6ac5 - split all SS tests into separate + engine per test + close_all() + dispose within teardown 2011-05-01 00:45:39 -04:00
Philip Jenvey 24e6c56da8 update warnings per zxjdbc 2011-04-23 14:15:08 -07:00
Mike Bayer 55f87348f3 - add test for [ticket:2142] 2011-04-23 15:05:50 -04:00
Mike Bayer c718dea749 - Fixed the psycopg2_version parsing in the
psycopg2 dialect.
2011-04-18 12:38:08 -04:00
Mike Bayer 4dd69ff878 - remove obsolete test regarding PG server side cursors + ORM query, was failing + hanging jenkins 2011-04-17 16:51:04 -04:00
Mike Bayer b462373b46 - REAL has been added to the core types. Supported
by Postgresql, SQL Server, MySQL, SQLite.  Note
that the SQL Server and MySQL versions, which
add extra arguments, are also still available
from those dialects.  [ticket:2081]
2011-04-05 12:40:55 -04:00
Mike Bayer 7b24e458c7 - move all the comments that got shoved below the fixture grabs back up 2011-03-27 17:19:00 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer ebd0fdad73 - convert @provide_metadata to use self access
- having occasional issues with BasicEntity grabbing, if it persists
may have to pass an explicit base class into setup_classes()/setup_mappers()
2011-03-26 21:40:05 -04:00
Mike Bayer 14a2fae239 - remove @testing.resolve_artifact_names, replace with direct attribute
access to the cls/self.tables/classes registries
- express orm/_base.py ORMTest in terms of engine/_base.py TablesTest,
factor out common steps into TablesTest, remove AltEngineTest as a
separate class.   will further consolidate these base classes
2011-03-26 19:03:11 -04:00
Mike Bayer f75ea6945c - Fixed the BIT type to allow a "length" parameter, "varying"
parameter.  Reflection also fixed.  [ticket:2073]
2011-03-16 11:01:20 -04:00
Jim Phares fde2a7f8fe Informix and postgresql reserved words changes -- almost done. 2011-03-15 16:56:45 -04:00
Mike Bayer 74f26d2279 - Fixed regression from 0.6 where SMALLINT and
BIGINT types would both generate SERIAL
on an integer PK column, instead of
SMALLINT and BIGSERIAL [ticket:2065]
2011-02-17 20:43:17 -05:00
Mike Bayer 2e4da52221 - The Sequence() construct, when passed a MetaData()
object via its 'metadata' argument, will be
included in CREATE/DROP statements within
metadata.create_all() and metadata.drop_all(),
including "checkfirst" logic.  [ticket:2055]
2011-02-13 19:32:00 -05:00
Mike Bayer 33eae4a140 make it more explicit in tests which dialect we want to use for things 2011-02-11 11:24:54 -05:00
Mike Bayer 134a4cb3a6 fix some tests 2011-02-10 23:37:15 -05:00
Mike Bayer 3f9a343d72 - Query.distinct() now accepts column expressions
as *args, interpreted by the Postgresql dialect
  as DISTINCT ON (<expr>). [ticket:1069]
- select.distinct() now accepts column expressions
  as *args, interpreted by the Postgresql dialect
  as DISTINCT ON (<expr>).  Note this was already
  available via passing a list to the `distinct`
  keyword argument to select(). [ticket:1069]
- select.prefix_with() accepts multiple expressions
  (i.e. *expr), 'prefix' keyword argument to select()
  accepts a list or tuple.
- Passing a string to the `distinct` keyword argument
  of `select()` for the purpose of emitting special
  MySQL keywords (DISTINCTROW etc.) is deprecated -
  use `prefix_with()` for this.
- put kw arguments to select() in order
- restore docs for _SelectBase, renamed from _SelectBaseMixin
2011-02-10 14:17:08 -05:00
Mike Bayer 7e8f351097 - Non-DBAPI errors which occur in the scope of an execute()
call are now wrapped in sqlalchemy.exc.StatementError,
and the text of the SQL statement and repr() of params
is included.  This makes it easier to identify statement
executions which fail before the DBAPI becomes
involved.  [ticket:2015]
2011-02-09 18:11:40 -05:00
Mike Bayer d5cc2f83c1 - When explicit sequence execution derives the name
of the auto-generated sequence of a SERIAL column,
which currently only occurs if implicit_returning=False,
now accommodates if the table + column name is greater
than 63 characters using the same logic Postgresql uses.
[ticket:1083]
2011-02-04 17:37:36 -05:00
Mike Bayer aa62a3a833 - factor consistent set_isolation_level(), get_isolation_level()
per-connection methods for sqlite, postgresql, psycopg2 dialects
- move isolation test suite to test engines/test_transaction
- preparing for [ticket:2001]
2011-01-16 13:05:18 -05:00
Mike Bayer fc0ffac241 stupid workaround for pg8000 2011-01-15 13:49:39 -05:00
Mike Bayer 75b5236e69 - the _pk_processors/_prefetch_processors approach relied upon calling RPs without a cursor.description
result, also generates procs that are not used in most cases.  simplify the approach
by passing type to _exec_default() to be used if needed by _execute_scalar(),
looking for the proc on just t._autoincrement_column in post_insert().
2011-01-15 11:53:37 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer c691b4cbdf - support for cdecimal
- add --with-cdecimal flag to tests, monkeypatches cdecimal in
- fix mssql/pyodbc.py to not use private '_int' accessor in decimal conversion
routines
- pyodbc version 2.1.8 is needed for cdecimal in any case as
previous versions also called '_int', 2.1.8 adds the same string
logic as our own dialect, so that logic is skipped for modern
pyodbc version
- make the imports for "Decimal" consistent across the whole lib.  not sure
yet how we should be importing "Decimal" or what the best way forward
is that would allow a clean user-invoked swap of cdecimal; for now,
added docs suggesting a global monkeypatch - the two decimal libs
are not compatible with each other so any chance of mixing produces
serious issues.  adding adapters to DBAPIs tedious and adds in-python
overhead.  suggestions welcome on how we should be doing
Decimal/cdecimal.
2010-12-11 17:44:46 -05:00
Mike Bayer f1e54a69fb - merge default tip 2010-12-05 14:56:26 -05:00
Mike Bayer df7379f992 - modernize multiple warning assertions for PG reflect index test 2010-11-30 20:39:06 -05:00
Mike Bayer 582b12152e - Fixed bug whereby KeyError would occur with non-ENUM
supported PG versions after a pool dispose+recreate
would occur, [ticket:1989]
2010-11-30 13:55:17 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer d14d171772 - the "mutable" flag on PickleType, postgresql.ARRAY is now off
by default.  [ticket:1980]
2010-11-28 12:16:39 -05:00
Mike Bayer 77f641429f - Fixed operator precedence rules for multiple
chains of a single non-associative operator.
I.e. "x - (y - z)" will compile as "x - (y - z)"
and not "x - y - z".  Also works with labels,
i.e. "x - (y - z).label('foo')"
[ticket:1984]
- Single element tuple expressions inside an IN clause
parenthesize correctly, also from [ticket:1984],
added tests for PG
- re-fix again importlater, [ticket:1983]
2010-11-25 12:20:13 -05:00
Mike Bayer 45cdb17ef0 - fixes for PG, mysql, twophase
- added "pool_events" arg to create_engine(), "events" to pool, allowing
establishment of listeners which fire before those of the dialect
2010-11-20 17:57:30 -05:00
Mike Bayer e15fa0342d skip on 2.4 2010-11-18 20:12:24 -05:00
Mike Bayer fd4f39648a merge tip 2010-11-18 18:57:33 -05:00
Mike Bayer 2336b1cebf - Added as_uuid=True flag to the UUID type, will receive
and return values as Python UUID() objects rather than
strings.  Currently, the UUID type is only known to
work with psycopg2.  [ticket:1956]
2010-11-18 18:44:35 -05:00