Commit Graph

57 Commits

Author SHA1 Message Date
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
Mike Bayer 34cb747f64 - Ensured every numeric, float, int code, scalar + array,
are recognized by psycopg2 and pg8000's "numeric"
base type. [ticket:1955]
2010-11-18 18:10:03 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 60197fb0f4 - Fixed bug which prevented "domain" built from a
custom type such as "enum" from being reflected.
[ticket:1933]
2010-10-20 17:28:08 -04:00
Mike Bayer 42ac34a701 - Added "as_tuple" flag to pg ARRAY type, returns results
as tuples instead of lists to allow hashing.
2010-10-20 16:17:17 -04:00
Mike Bayer ccde531935 - query.with_parent() now accepts transient objects
and will use the non-persistent values of their pk/fk
attributes in order to formulate the criterion.
Docs are also clarified as to the purpose of with_parent().
- fix for PG test executing an alias()
2010-09-06 10:55:53 -04:00
Mike Bayer a793b8e050 - Fixed the psycopg2 dialect to use its
set_isolation_level() method instead of relying
upon the base "SET SESSION ISOLATION" command,
as psycopg2 resets the isolation level on each new
transaction otherwise.
2010-08-10 10:24:02 -04:00
Mike Bayer e430aa915f test/dialect 2010-07-11 14:28:21 -04:00
Mike Bayer 3eab798253 - Won't generate "CREATE TYPE" / "DROP TYPE" if
using types.Enum on a PG version prior to 8.3 -
the supports_native_enum flag is fully
honored.  [ticket:1836]
2010-06-25 13:11:06 -04:00
Mike Bayer d61a48ccfd - fixed numeric test for pg8000, factored out decimal/float codes 2010-04-09 13:01:17 -04:00
Mike Bayer 3351b65df9 - Repaired missing import in psycopg2._PGNumeric type when
unknown numeric is received.

- psycopg2/pg8000 dialects now aware of REAL[], FLOAT[],
DOUBLE_PRECISION[], NUMERIC[] return types without
raising an exception.

- introducing testing.provide_metadata for all these stupid little
create/drop tests
2010-04-07 16:07:55 -04:00
Mike Bayer a6480a2c31 - Postgresql now reflects sequence names associated with
SERIAL columns correctly, after the name of of the sequence
has been changed.  Thanks to Kumar McMillan for the patch.
[ticket:1071]
2010-04-06 18:53:51 -04:00
Mike Bayer 6a8863238c clarify this test 2010-03-26 12:18:21 -04:00
Mike Bayer db052dfba8 - the TIME and TIMESTAMP types are now availble from the
postgresql dialect directly, which add the PG-specific
argument 'precision' to both.   'precision' and
'timezone' are correctly reflected for both TIME and
TIMEZONE types. [ticket:997]
2010-03-26 12:03:54 -04:00
Mike Bayer 3f0bd7269b - The psycopg2 dialect will log NOTICE messages via the
"sqlalchemy.dialects.postgresql" logger name.
[ticket:877]
2010-03-25 17:02:50 -04:00
Mike Bayer 065fcbd9d2 - The official name for the relation() function is now
relationship(), to eliminate confusion over the relational
algebra term.  relation() however will remain available
in equal capacity for the foreseeable future.  [ticket:1740]
2010-03-17 17:48:29 -04:00
Mike Bayer e9b059f782 base tests pass 2010-03-09 14:32:38 -05:00
Mike Bayer 2d95ef1f25 - the "scale" argument of the Numeric() type is honored when
coercing a returned floating point value into a string
on its way to Decimal - this allows accuracy to function
on SQLite, MySQL.  [ticket:1717]
2010-02-26 17:50:34 +00:00
Mike Bayer 11f996da20 fix unicode warnings 2010-02-26 17:20:10 +00:00
Michael Trier 824e42b1e6 Match tests have been completely wrong. 2010-02-26 08:50:04 +00:00
Mike Bayer 756370e0b4 - The assert_unicode flag is deprecated. SQLAlchemy will raise
a warning in all cases where it is asked to encode a non-unicode
Python string, and will do nothing for DBAPIs that already
accept Python unicode objects.
2010-02-25 22:00:58 +00:00
Michael Trier d7a8111d43 The pypostgresql has a problem coercing an array during concatination. Exclude test. 2010-02-23 19:29:57 +00:00
Michael Trier 3c47810167 Work around py-postgresql handling of exceptions. 2010-02-23 04:39:48 +00:00
Michael Trier 2a1eca4bbc Changed the py-postgresql dialect to indicate that it is using the pyformat parameter style. 2010-02-23 00:27:37 +00:00
Mike Bayer 029a6aaadd pg8000 doesn't seem to support this either 2010-02-15 23:39:39 +00:00
Mike Bayer 739b7b0c25 some more 2.4 test fixes 2010-02-15 22:37:37 +00:00
Mike Bayer 85d335b01b - The type/expression system now does a more complete job
of determining the return type from an expression
as well as the adaptation of the Python operator into
a SQL operator, based on the full left/right/operator
of the given expression.  In particular
the date/time/interval system created for Postgresql
EXTRACT in [ticket:1647] has now been generalized into
the type system.   The previous behavior which often
occured of an expression "column + literal" forcing
the type of "literal" to be the same as that of "column"
will now usually not occur - the type of
"literal" is first derived from the Python type of the
literal, assuming standard native Python types + date
types, before falling back to that of the known type
on the other side of the expression.  Also part
of [ticket:1683].
2010-02-11 19:33:06 +00:00
Mike Bayer 770e1ddc13 - Connection has execution_options(), generative method
which accepts keywords that affect how the statement
is executed w.r.t. the DBAPI.   Currently supports
"stream_results", causes psycopg2 to use a server
side cursor for that statement.   Can also be set
upon select() and text() constructs directly as well
as ORM Query().
2010-01-24 22:50:58 +00:00
Philip Jenvey 4a18506d4d not applicable to zxjdbc 2010-01-22 02:15:22 +00:00
Mike Bayer 151fa4e75c statement_options -> execution_options 2010-01-17 20:43:35 +00:00
Mike Bayer abccc06242 - added "statement_options()" to Query, to so options can be
passed to the resulting statement. Currently only
Select-statements have these options, and the only option
used is "stream_results", and the only dialect which knows
"stream_results" is psycopg2.
- Query.yield_per() will set the "stream_results" statement
option automatically.
- Added "statement_options()" to Selects, which set statement
specific options. These enable e.g. dialect specific options
such as whether to enable using server side cursors, etc.
- The psycopg2 now respects the statement option
"stream_results". This option overrides the connection setting
"server_side_cursors". If true, server side cursors will be
used for the statement. If false, they will not be used, even
if "server_side_cursors" is true on the
connection. [ticket:1619]
- added a "frozendict" from http://code.activestate.com/recipes/414283/,
adding more default collections as immutable class vars on
Query, Insert, Select
2010-01-16 22:44:04 +00:00
Mike Bayer d66f470326 fixed DDL quoting with literal strings that have ' [ticket:1640] 2010-01-03 18:53:41 +00:00
Mike Bayer 2698c8facb - postgresql dialect can properly detect pg "devel" version
strings, i.e. "8.5devel" [ticket:1636]
2009-12-29 23:41:04 +00:00
Mike Bayer ebb54d1bc2 merge r6591, r6592 from 0.5 branch for PGInterval etc. /extract 2009-12-29 16:19:09 +00:00
Mike Bayer cf7c80b3f4 - merge r6586 from 0.5 branch, for [ticket:1647] 2009-12-29 02:41:16 +00:00
Mike Bayer f9cb6f5834 - reworked the DDL generation of ENUM and similar to be more platform agnostic.
Uses a straight CheckConstraint with a generic expression.  Preparing for boolean
constraint in [ticket:1589]
- CheckConstraint now accepts SQL expressions, though support for quoting of values
will be very limited.  we don't want to get into formatting dates and such.
2009-12-06 19:51:10 +00:00
Mike Bayer a358868d64 typo 2009-11-24 23:26:47 +00:00
Mike Bayer 976b9223ae test fails on zxjdbc 2009-11-24 22:56:59 +00:00
Mike Bayer 943ce6bf16 merge r6504 from 0.5 plus an enhancement to the unit test, [ticket:1611] 2009-11-15 20:22:57 +00:00
Mike Bayer 5f6ed1a3f8 - pg8000 + postgresql dialects now check for float/numeric return
types to more intelligently determine float() vs. Decimal(),
[ticket:1567]
- since result processing is a hot issue of late, the DBAPI type
returned from cursor.description is certainly useful in cases like
these to determine an efficient result processor.   There's likely
other result processors that can make use of it.  But, backwards
incompat change to result_processor().  Happy major version number..
2009-11-15 19:20:22 +00:00
Mike Bayer e8854fe945 - INTERVAL supports an optional "precision" argument
corresponding to the argument that PG accepts.
- Added support for reflecting the INTERVAL YEAR TO MONTH
and INTERVAL DAY TO SECOND syntaxes of the INTERVAL
type.  [ticket:460]
2009-11-01 22:47:14 +00:00