Commit Graph

32 Commits

Author SHA1 Message Date
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
Mike Bayer 5119ce78b5 - The psycopg2 dialect now uses psycopg2's "unicode extension"
on all new connections, which allows all String/Text/etc.
types to skip the need to post-process bytestrings into
unicode (an expensive step due to its volume).  Other
dialects which return unicode natively (pg8000, zxjdbc)
also skip unicode post-processing.

- String/Text/Unicode types now skip the unicode() check
on each result column value if the dialect has
detected the DBAPI as returning Python unicode objects
natively.  This check is issued on first connect
using "SELECT CAST 'some text' AS VARCHAR(10)" or
equivalent, then checking if the returned object
is a Python unicode.   This allows vast performance
increases for native-unicode DBAPIs, including
pysqlite/sqlite3, psycopg2, and pg8000.
2009-10-26 00:32:39 +00:00
Mike Bayer eb9763febe - generalized Enum to issue a CHECK constraint + VARCHAR on default platform
- added native_enum=False flag to do the same on MySQL, PG, if desired
2009-10-25 21:27:08 +00:00
Mike Bayer a5f827b12d well great nobody even supports PG enum. 2009-10-25 16:50:09 +00:00
Mike Bayer aa557982fa - Added new ENUM type to the Postgresql dialect, which exists as a schema-level
construct and extends the generic Enum type.  Automatically
associates itself with tables and their parent metadata
to issue the appropriate CREATE TYPE/DROP TYPE
commands as needed, supports unicode labels, supports
reflection.  [ticket:1511]

- MySQL ENUM now subclasses the new generic Enum type, and also handles
unicode values implicitly, if the given labelnames are unicode
objects.

- Added a new Enum generic type, currently supported on
Postgresql and MySQL.  Enum is a schema-aware object
to support databases which require specific DDL in
order to use enum or equivalent; in the case of PG
it handles the details of `CREATE TYPE`, and on
other databases without native enum support can
support generation of CHECK constraints.
[ticket:1109] [ticket:1511]

- types documentation updates

- some cleanup on schema/expression docs
2009-10-25 00:40:34 +00:00
Mike Bayer 0d8ba83046 added a test for #1085 2009-09-30 20:55:00 +00:00
Mike Bayer 3d38969fd4 - Inserting NULL into a primary key + foreign key column
will allow the "not null constraint" error to raise,
not an attempt to execute a nonexistent "col_id_seq"
sequence.  [ticket:1516]

- autoincrement SELECT statements, i.e. those which
select from a procedure that modifies rows, now work
with server-side cursor mode (the named cursor isn't
used for such statements.)
2009-08-31 20:38:14 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00