Commit Graph

463 Commits

Author SHA1 Message Date
Mike Bayer b9ea55f861 - more tests, move some tests out of test_reflection, test_query 2012-09-27 16:11:32 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer 444abbe847 - got firebird running
- add some failure cases
- [bug] Firebird now uses strict "ansi bind rules"
so that bound parameters don't render in the
columns clause of a statement - they render
literally instead.

- [bug] Support for passing datetime as date when
using the DateTime type with Firebird; other
dialects support this.
2012-09-23 18:09:18 -04:00
Mike Bayer 7e815c67a9 finished fixes for mxodbc; need to use at least version 3.2.1 2012-09-21 17:43:22 -04:00
Mike Bayer df7a3792f5 - add req's for predictable gc 2012-09-05 12:46:28 -04:00
Mike Bayer 626ae5b7a1 - fixes for mxODBC, some pyodbc
- enhancements to test suite including ability to set up a testing engine
for a whole test class, fixes to how noseplugin sets up/tears
down per-class context
2012-09-02 15:14:09 -04:00
Mike Bayer 764c9fee72 with statement 2012-09-01 22:24:19 -04:00
Mike Bayer 73d5b74f26 - get all tests within -w engine + pyodbc:mssql on windows to pass 2012-09-01 19:16:17 -04:00
Mike Bayer d1c2b7aff8 adjust this test which passes on some psycopg2s, fails on others, and we dont have a good
testing decorator to check this
2012-08-28 17:50:12 -04:00
Mike Bayer 326f2e4f60 - [feature] The "required" flag is set to
True by default, if not passed explicitly,
on bindparam() if the "value" or "callable"
parameters are not passed.
This will cause statement execution to check
for the parameter being present in the final
collection of bound parameters, rather than
implicitly assigning None. [ticket:2556]
2012-08-27 15:11:53 -04:00
Mike Bayer 393b294776 - [feature] Added support for .info dictionary argument to
column_property(), relationship(), composite().
All MapperProperty classes have an auto-creating .info
dict available overall.
2012-08-24 18:48:42 -04:00
Mike Bayer a113c7b3a7 future for with statement 2012-08-24 18:42:28 -04:00
Mike Bayer 28bfc3d5df - [feature] The before_cursor_execute event
fires off for so-called "_cursor_execute"
    events, which are usually special-case
   executions of primary-key bound sequences
    and default-generation SQL
    phrases that invoke separately when RETURNING
    is not used with INSERT.  [ticket:2459]
2012-08-23 15:40:09 -04:00
Mike Bayer 819ec8e13f - add new C extension "utils", so far includes distill_params
- repair test_processors which wasn't hitting the python functions
- add another suite to test_processors that does distill_params
2012-08-07 15:23:11 -04:00
Mike Bayer 5a02c9e73f - break out engine/base.py into base, interfaces, result, util.
- remove deprecated 0.7 engine methods
2012-08-07 12:01:19 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
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