Commit Graph

447 Commits

Author SHA1 Message Date
Mike Bayer 3e55ed778b - [feature] Connection event listeners can
now be associated with individual
Connection objects, not just Engine
objects.  [ticket:2511]
2012-07-18 20:23:01 -04:00
Mike Bayer eaec7fd2b0 try to loosen the times up here to reduce failures due to latency 2012-07-17 09:32:11 -04:00
Mike Bayer 844831c14f notify_all workaround for 2.5 2012-06-25 14:25:36 -04:00
Mike Bayer 7b1a1a66cd - change notify to notify_all() so all waiters exit immediately,
continuing [ticket:2522]
2012-06-25 11:15:50 -04:00
Mike Bayer e597d3d145 - [bug] Fixed bug whereby if a database restart
affected multiple connections, each
connection would individually invoke a new
disposal of the pool, even though only
one disposal is needed.  [ticket:2522]
2012-06-22 12:42:01 -04:00
Mike Bayer 5f0a7bb152 - [bug] Fixed bug whereby
a disconnect detect + dispose that occurs
when the QueuePool has threads waiting
for connections would leave those
threads waiting for the duration of
the timeout on the old pool.   The fix
now notifies those waiters with a special
exception case and has them move onto
the new pool.  This fix may or may
not be ported to 0.7.  [ticket:2522]
2012-06-22 12:24:08 -04:00
Mike Bayer 3ebb7d8e94 - [bug] The ResultProxy methods inserted_primary_key,
last_updated_params(), last_inserted_params(),
postfetch_cols(), prefetch_cols() all
assert that the given statement is a compiled
construct, and is an insert() or update()
statement as is appropriate, else
raise InvalidRequestError.  [ticket:2498]

- ResultProxy.last_inserted_ids is removed,
replaced by inserted_primary_key.
2012-06-16 18:41:54 -04:00
Mike Bayer 5cc0bb0474 - [bug] Fixed bug affecting Py3K whereby
string positional parameters passed to
engine/connection execute() would fail to be
interpreted correctly, due to __iter__
being present on Py3K string.
[ticket:2503].  Also in 0.7.8.
2012-06-11 20:11:05 -04:00
Mike Bayer 2925167550 - [feature] The "deferred declarative
reflection" system has been moved into the
declarative extension itself, using the
new DeferredReflection class.  This
class is now tested with both single
and joined table inheritance use cases.
[ticket:2485]
- [bug] The autoload_replace flag on Table,
when False, will cause any reflected foreign key
constraints which refer to already-declared
columns to be skipped, assuming that the
in-Python declared column will take over
the task of specifying in-Python ForeignKey
or ForeignKeyConstraint declarations.
2012-05-17 11:45:05 -04:00
Mike Bayer 1fe06a551c - [feature] Inspector.get_primary_keys() is
deprecated; use Inspector.get_pk_constraint().
Courtesy Diana Clarke.  [ticket:2422]
- restored default get_primary_keys()/get_pk_constraint() wrapper
to help maintain compatibility with third party dialects
created against 0.6 or 0.7
2012-04-24 16:25:20 -04:00
Diana Clarke 3cbe90efbe deprecate inspector.get_primary_keys() in favor of inspector.get_pk_constraint()
- see #2422
2012-04-02 21:07:37 -04:00
Mike Bayer 71c0011574 - [feature] Added a new system
for registration of new dialects in-process
without using an entrypoint.  See the
docs for "Registering New Dialects".
[ticket:2462]
2012-04-24 13:00:30 -04:00
Mike Bayer 998c66fa8b - [feature] The column_reflect event now
accepts the Inspector object as the first
argument, preceding "table".   Code which
uses the 0.7 version of this very new
event will need modification to add the
"inspector" object as the first argument.
[ticket:2418]
2012-04-24 12:01:04 -04:00
Mike Bayer 54017d9de2 merge patch for [ticket:2208]. This still needs documentation. 2012-04-23 12:03:54 -04:00
Mike Bayer 9273cdd638 - [bug] If conn.begin() fails when calling
"with engine.begin()", the newly acquired
Connection is closed explicitly before
propagating the exception onward normally.
2012-04-12 14:38:52 -04:00
Mike Bayer 5280f26d45 - [feature] Added new connection event
dbapi_error(). Is called for all DBAPI-level
errors passing the original DBAPI exception
before SQLAlchemy modifies the state
of the cursor.
2012-04-10 19:38:22 -04:00
Mike Bayer f1bdd4e4bb begin implementing inspection system for #2208 2012-04-03 18:53:39 -04:00
Philip Jenvey 94e05e3d87 cleanup test_processors, modeling the PEP 399 style 2012-03-07 21:48:36 -08:00
Mike Bayer 7feaad21e6 test failures 2012-02-15 10:13:47 -05:00
Mike Bayer df15546cb8 - [feature] Added "no_parameters=True" execution
option for connections.   If no parameters
    are present, will pass the statement
    as cursor.execute(statement), thereby invoking
    the DBAPIs behavior when no parameter collection
    is present; for psycopg2 and mysql-python, this
    means not interpreting % signs in the string.
    This only occurs with this option, and not
    just if the param list is blank, as otherwise
    this would produce inconsistent behavior
    of SQL expressions that normally escape percent
    signs (and while compiling, can't know ahead of
    time if parameters will be present in
    some cases).  [ticket:2407]
2012-02-13 20:07:44 -05:00
Mike Bayer 04c7bae308 - test failures. one in particular seems to be a weird oursql bug, oh well 2012-02-12 20:00:44 -05:00
Mike Bayer d101c597f5 - [feature] Added support for the "isolation_level"
parameter to all MySQL dialects.  Thanks
to mu_mind for the patch here. [ticket:2394]
- add documentation examples for mysql, postgresql
- pep8ing
2012-02-12 18:07:41 -05:00
Mike Bayer 345de2ee1d - [bug] Fixed bug in new "autoload_replace" flag
which would fail to preserve the primary
key constraint of the reflected table.
[ticket:2402]
2012-02-12 17:14:34 -05:00
Mike Bayer c710f6cbf6 - add a context manager availble via Engine.begin()
- add a test suite for all the Engine/Connection/TLEngine transaction/begin
helpers/context managers
- update docs
2012-02-12 16:43:26 -05:00
Mike Bayer 132f5c7e04 - [feature] Added pool_reset_on_return argument
to create_engine, allows control over
"connection return" behavior.  Also added
new arguments 'rollback', 'commit', None
to pool.reset_on_return to allow more control
over connection return activity. [ticket:2378]
2012-02-01 10:14:28 -05:00
Mike Bayer 96dce7686c - [feature] New reflection feature "autoload_replace";
when set to False on Table, the Table can be autoloaded
without existing columns being replaced.  Allows
more flexible chains of Table construction/reflection
to be constructed, including that it helps with
combining Declarative with table reflection.
See the new example on the wiki.  [ticket:2356]

- [bug] Improved the API for add_column() such that
if the same column is added to its own table,
an error is not raised and the constraints
don't get doubled up.  Also helps with some
reflection/declarative patterns. [ticket:2356]
2012-01-28 15:54:28 -05:00
Mike Bayer b7f7ed2105 fix a few py3k bugs 2012-01-28 15:32:53 -05:00
Mike Bayer 780cd9dce4 - [bug] Fixed bug in "mock" strategy whereby
correct DDL visit method wasn't called, resulting
in "CREATE/DROP SEQUENCE" statements being
duplicated [ticket:2384]
2012-01-28 14:29:26 -05:00
Mike Bayer 3e6d1b0845 exception pickling fails on cx_oracle 2012-01-22 22:37:23 -05:00
Mike Bayer 09a503e497 - [bug] Fixed bug whereby a table-bound Column
object named "<a>_<b>" which matched a column
labeled as "<tablename>_<colname>" could match
inappropriately when targeting in a result
set row.  [ticket:2377]
- requires that we change the tuple format in RowProxy.
Makes an improvement to the cases tested against
an unpickled RowProxy as well though doesn't solve the
problem there entirely.
2012-01-22 14:04:20 -05:00
Mike Bayer 959d7cbe33 - [bug] Improved error messages when a non-string
or invalid string is passed to any of the
date/time processors used by SQLite, including
C and Python versions.  [ticket:2382]
- changed the import model of processors.py so that we can
get at the pure python versions and C versions simultaneously
in tests.
2012-01-22 12:11:13 -05:00
Mike Bayer 7026ffe57c another serializable for [ticket:2371] 2012-01-12 00:49:02 -05:00
Mike Bayer 26625d897f further fixes for column/table errors 2012-01-11 20:47:53 -05:00
Mike Bayer 70383385d2 some adjustments for py3k 2012-01-11 20:45:28 -05:00
Mike Bayer b4fcdc19a8 fix failures for oursql, python 2.4 2012-01-11 20:35:57 -05:00
Mike Bayer d78d2d60aa - [bug] Added __reduce__ to StatementError,
DBAPIError so that exceptions are pickleable,
as when using multiprocessing.  However, not
all DBAPIs support this yet, such as
psycopg2. [ticket:2371]
2012-01-10 11:15:11 -05:00
Mike Bayer a4a81f7b96 - [bug] the "name" of an FK constraint in SQLite
is reflected as "None", not "0" [ticket:2364].
SQLite does not appear to support constraint
naming in any case (the names are ignored).
2012-01-07 15:37:51 -05:00
Mike Bayer 8ad65d0ee1 - [bug] Decode incoming values when retrieving
list of index names and the names of columns
within those indexes.  [ticket:2269]
- rewrite unicode reflection test to be of more general use on
broken backends
2011-12-06 16:31:52 -05:00
Mike Bayer df9e3f2fb9 - reflection process always resets the primary key constraint
first, fixes extend_existing
2011-12-04 15:57:08 -05:00
Mike Bayer 632043bc8a - [bug] Fixed bug whereby transaction.rollback()
would throw an error on an invalidated
connection if the transaction were a
two-phase or savepoint transaction.
For plain transactions, rollback() is a no-op
if the connection is invalidated, so while
it wasn't 100% clear if it should be a no-op,
at least now the interface is consistent.
[ticket:2317]
2011-12-04 14:25:00 -05:00
Mike Bayer 81945d7a0c - [feature] The "extend_existing" flag on Table
now allows for the reflection process to take
effect for a Table object that's already been
defined; when autoload=True and extend_existing=True
are both set, the full set of columns will be
reflected from the Table which will then
*overwrite* those columns already present,
rather than no activity occurring.  Columns that
are present directly in the autoload run
will be used as always, however.
[ticket:1410]
2011-12-04 14:16:42 -05:00
Mike Bayer 896bc4c5b6 - [bug] Fixed bug whereby "order_by='foreign_key'"
option to Inspector.get_table_names
wasn't implementing the sort properly, replaced
with the existing sort algorithm
- clean up metadata usage in reflection tests
2011-12-01 14:21:43 -05:00
Mike Bayer 8301651428 - [feature] Added new support for remote "schemas":
- MetaData() accepts "schema" and "quote_schema"
      arguments, which will be applied to the same-named
      arguments of a Table
      or Sequence which leaves these at their default
      of ``None``.
    - Sequence accepts "quote_schema" argument
    - tometadata() for Table will use the "schema"
      of the incoming MetaData for the new Table
      if the schema argument is explicitly "None"
    - Added CreateSchema and DropSchema DDL
      constructs - these accept just the string
      name of a schema and a "quote" flag.
    - When using default "schema" with MetaData,
      ForeignKey will also assume the "default" schema
      when locating remote table.  This allows the "schema"
      argument on MetaData to be applied to any
      set of Table objects that otherwise don't have
      a "schema".
    - a "has_schema" method has been implemented
      on dialect, but only works on Postgresql so far.
    Courtesy Manlio Perillo, [ticket:1679]
2011-10-23 16:57:48 -04:00
Mike Bayer 88cb44ceee some mssql stuff, though unicode is really not working still... 2011-10-16 11:34:48 -04:00
Mike Bayer 0c6f6e2b77 fix this test for oursql 2011-10-15 15:22:21 -04:00
Mike Bayer f1eea63468 - Added an exception catch + warning for the
"return unicode detection" step within connect,
allows databases that crash on NVARCHAR to
continue initializing, assuming no NVARCHAR
type implemented.  [ticket:2299]
2011-10-15 12:10:31 -04:00
Mike Bayer a0cc36c239 - adjust some tests and such to work better with a mysql 5.5 install
- Added mysql_length parameter to Index construct,
    specifies "length" for indexes.  [ticket:2293]
2011-10-11 00:15:43 -04:00
Mike Bayer 36e2b2d875 ensure sa_pool_key isn't passed to connect 2011-09-21 10:26:49 -04:00
Mike Bayer d3c1f245ef - Improvement to multi-param statement logging,
long lists of bound parameter sets will be
compressed with an informative indicator
of the compression taking place.  Exception
messages use the same improved formatting.
[ticket:2243]
2011-08-22 11:12:36 -04:00
Mike Bayer 9a2edbf3eb - The recreate() method in all pool classes uses
self.__class__ to get at the type of pool
    to produce, in the case of subclassing.  Note
    there's no usual need to subclass pools.
    [ticket:2254]
2011-08-14 11:55:32 -04:00