Commit Graph

151 Commits

Author SHA1 Message Date
Mike Bayer 062b8c0eb1 - added extra fk override test
- proper error message is raised when trying to
access expired instance attributes with no session
present
2008-01-10 18:05:20 +00:00
Jason Kirtland bf36c648f2 Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. No surprises. 2008-01-10 02:37:39 +00:00
Jason Kirtland 84576e3258 test suite deprecation rampage 2008-01-09 22:54:51 +00:00
Mike Bayer eefd1f78a2 redid the _for_ddl String/Text deprecation warning correctly [ticket:912] 2008-01-09 18:09:49 +00:00
Mike Bayer 57201ca878 - added is_disconnect() support for oracle
- fixed _handle_dbapi_error to detect endless loops, doesn't call rollback/cursor.close
etc. in case of disconnect
2007-12-29 20:13:50 +00:00
Mike Bayer b9b0aca757 - auto-reconnect support improved; a Connection can now automatically
reconnect after its underlying connection is invalidated, without
needing to connect() again from the engine.  This allows an ORM session
bound to a single Connection to not need a reconnect.
Open transactions on the Connection must be rolled back after an invalidation
of the underlying connection else an error is raised.  Also fixed
bug where disconnect detect was not being called for cursor(), rollback(),
or commit().
2007-12-19 19:51:46 +00:00
Lele Gaifax fee8fe3391 Use an explicit ordering in the query 2007-12-18 13:06:24 +00:00
Lele Gaifax c0f48e8383 Firebird does use qmark style params 2007-12-13 20:16:23 +00:00
Jason Kirtland 8128a6378a - Removed @testing.supported. Dialects in development or maintained outside
the tree can now run the full suite of tests out of the box.
- Migrated most @supported to @fails_on, @fails_on_everything_but, or (last
  resort) @unsupported.  @fails_on revealed a slew of bogus test skippage,
  which was corrected.
- Added @fails_on_everything_but.  Yes, the first usage *was*
  "fails_on_everything_but('postgres')".  How did you guess!
- Migrated @supported in dialect/* to the new test-class attribute __only_on__.
- Test classes can also have __unsupported_on__ and __excluded_on__.
2007-12-13 09:59:14 +00:00
Lele Gaifax 16810e4011 New simple test for Dialect.has_sequence() 2007-12-12 17:24:56 +00:00
Mike Bayer a5f2aab9e0 - tables with schemas can still be used in sqlite, firebird,
schema name just gets dropped [ticket:890]
2007-12-05 21:14:09 +00:00
Mike Bayer 6ed4645f02 opened up the test for "reflection with convert_unicode=True". this is since convert_unicode by default has assert_unicode, want to ensure that other dialects (at least oracle) support this (i.e. not unicode schema names themselves, just that they dont sent thru bytestrings to a String).
if maxdb or sybase *should* be able to handle this too though I can't test on this end.
2007-11-27 16:23:02 +00:00
Jason Kirtland ea627ebe5c Migrated Connection.properties to Connection.info ('info' is the new standard name for user-writable property collections that came out of [ticket:573]). 'properties' is now an alias, will be removed in 0.5. 2007-11-18 18:19:52 +00:00
Mike Bayer 43d476ce60 - oracle will now reflect "DATE" as an OracleDateTime column, not
OracleDate

- added awareness of schema name in oracle table_names() function,
fixes metadata.reflect(schema='someschema') [ticket:847]
2007-11-18 02:44:15 +00:00
Jason Kirtland 7f85c1e443 - Pool listeners preserved on pool.recreate()
- Docstring rampage
2007-11-10 19:31:06 +00:00
Mike Bayer f9c8d1cf34 fixed the previous TLTransaction checkin 2007-11-07 21:46:48 +00:00
Mike Bayer af070d037b - fixed the close() method on Transaction when using strategy='threadlocal' 2007-11-07 18:31:35 +00:00
Mike Bayer 1fee09fd07 - inlined a couple of context variables
- PG two phase was calling text() without the correct bind param format, previous compiler checkin revealed issue
2007-10-27 18:45:20 +00:00
Jason Kirtland 6378c34799 - Added initial version of MaxDB dialect.
- All optional test Sequences are now optional=True
2007-10-23 07:38:07 +00:00
Mike Bayer f32131dac2 - added test coverage for unknown type reflection, fixed
sqlite/mysql handling of type reflection for unknown types
2007-10-18 17:56:18 +00:00
Ants Aasma 6bbc7dd157 change the in_ API to accept a sequence or a selectable [ticket:750] 2007-10-16 22:57:05 +00:00
Mike Bayer cc0e7c796f - string-based query param parsing/config file parser understands
wider range of string values for booleans [ticket:817]
2007-10-16 21:33:21 +00:00
Mike Bayer 5b92c3d097 - PG reflection, upon seeing the default schema name being used explicitly
as the "schema" argument in a Table, will assume that this is the the
  user's desired convention, and will explicitly set the "schema" argument
  in foreign-key-related reflected tables, thus making them match only
  with Table constructors that also use the explicit "schema" argument
  (even though its the default schema).
  In other words, SA assumes the user is being consistent in this usage.
2007-10-14 19:15:09 +00:00
Jason Kirtland be6f2a9c5b Added test for DBAPIError exception wrapping. 2007-10-14 16:31:21 +00:00
Jason Kirtland c1a8db6791 - sqlite housekeeping- added dialect test & moved tests there, pruned the dialect's reserved words. 2007-10-11 17:35:13 +00:00
Mike Bayer ddf875dd0c - initial sybase support checkin, [ticket:785] 2007-10-10 15:19:28 +00:00
Ants Aasma 47d3f45d58 - fix multiple consequent two phase transactions not working with postgres. For some reason implicit transactions are not enough. [ticket:810]
- add an option to scoped session mapper extension to not automatically save new objects to session.
2007-10-08 15:25:51 +00:00
Roger Demetrescu 11c70f9d8d Firebird dialect now uses SingletonThreadPool as its poolclass.
(this fixes all "unsuccessful metadata update\n  object XXXXX is in use" test errors)

Minor fixes in tests
2007-10-07 00:06:05 +00:00
Mike Bayer 29291f4c32 - oracle does not implicitly convert to unicode for non-typed result
sets (i.e. when no TypeEngine/String/Unicode type is even being used;
  previously it was detecting DBAPI types and converting regardless).
  should fix [ticket:800]
- fixed oracle out_parameters, likely broke in beta6
- fixed oracle _normalize_case for encoded names, gets unicode reflection test to work
- a few extra tests tweaked/unsupported for oracle
2007-10-06 16:12:58 +00:00
Mike Bayer 6695831403 - fixed sqlite reflection of BOOL/BOOLEAN [ticket:808] 2007-10-05 18:14:11 +00:00
Jason Kirtland 6fb5f1047c Adjusted reserved word reflection test for oracle-style identifier dialects. But probably the CheckConstraint part of this test should just be removed, as it's testing a non-extant feature. 2007-10-04 18:31:31 +00:00
Roger Demetrescu 35ff8ed25e Some fixes on reflection tests (firebird):
* firebird doesn't support create table tablename (columnname type NULL)" syntax (only NOT NULL)
 * firebird doesn't support schemas
2007-10-02 04:44:20 +00:00
Jason Kirtland 30f0f0cf5d - Explicitly close connections in the FOR UPDATE tests.
- Minor housekeeping.
2007-09-27 23:23:27 +00:00
Mike Bayer fbd0a0c725 [ticket:728] foreign key checks for existing reflected FK and replaces itself 2007-09-08 21:09:50 +00:00
Jason Kirtland 3d9d21cc14 Extended 'engine_from_config' coercion for QueuePool size / overflow. [ticket:763]
Added a set of coercion tests.
2007-08-29 23:17:36 +00:00
Jason Kirtland b11fde9cff Fixed OrderedProperties pickling [ticket:762] 2007-08-28 15:17:26 +00:00
Mike Bayer d3917532bc - tightened down the screws on logging a little bit 2007-08-22 18:08:10 +00:00
Jason Kirtland fba14f6047 from foo import (name, name) isn't valid syntax for 2.3. ah well.
omitting modules from sqlalchemy.__all__...
2007-08-21 22:20:52 +00:00
Mike Bayer 04e70c708f changing Pool to use weakref callback for auto-cleanup, instead of __del__.
Still leaving the RLock in Queue however since I see no guarantee that the weakref callback
isn't called at an arbitrary time.
2007-08-21 18:18:21 +00:00
Mike Bayer 531faf0e18 - Engine and TLEngine assume "threadlocal" behavior on Pool; both use connect()
for contextual connection, unique_connection() for non-contextual.
- Pool use_threadlocal defaults to True, can be set to false at create_engine()
level with pool_threadlocal=False
- made all logger statements in pool conditional based on a flag calcualted once.
- chagned WeakValueDictionary() used for "threadlocal" pool to be a regular dict
referencing weakref objects.  WVD had a lot of overhead, apparently.  *CAUTION* -
im pretty confident about this change, as the threadlocal dict gets explicitly managed
anyway, tests pass with PG etc., but keep a close eye on this one regardless.
2007-08-20 19:07:07 +00:00
Mike Bayer 7c6c1b99c2 1. Module layout. sql.py and related move into a package called "sql".
2. compiler names changed to be less verbose, unused classes removed.
3. Methods on Dialect which return compilers, schema generators, identifier preparers
have changed to direct class references, typically on the Dialect class itself
or optionally as attributes on an individual Dialect instance if conditional behavior is needed.
This takes away the need for Dialect subclasses to know how to instantiate these
objects, and also reduces method overhead by one call for each one.
4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now).  The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument.

5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
2007-08-18 21:37:48 +00:00
Mike Bayer 721f291406 add a test for dupe tables in MetaData 2007-08-17 22:20:55 +00:00
Mike Bayer de1712a211 - added close() method to Transaction. closes out a transaction using rollback
if it's the outermost transaction, otherwise just ends without affecting
  the outer transaction.

- transactional and non-transactional Session integrates better with bound
  connection; a close() will ensure that connection transactional state is
  the same as that which existed on it before being bound to the Session.
2007-08-17 21:20:49 +00:00
Mike Bayer 27cf3a232d - threadlocal TLConnection, when closes for real, forces parent TLSession
to rollback/dispose of transaction
2007-08-17 19:13:51 +00:00
Mike Bayer 95748cfc02 - added extra argument con_proxy to ConnectionListener interface checkout/checkin methods
- changed testing connection closer to work on _ConnectionFairy instances, resulting in
pool checkins, not actual closes
- disabled session two phase test for now, needs work
- added some two-phase support to TLEngine, not tested
- TLTransaction is now a wrapper
2007-08-17 17:59:08 +00:00
Mike Bayer 5be79a6e32 adjustment to table_names test such that the DB can have extra tables around 2007-08-14 15:10:42 +00:00
Mike Bayer 054e76df44 removed assertion for "no tables in db" 2007-08-14 14:32:50 +00:00
Mike Bayer 0285ec6beb added engine_from_config() function for helping to create_engine()
from an .ini style config
2007-08-14 00:40:23 +00:00
Mike Bayer 62410adeb9 - fixed compiler bug in mssql
- marked as unsupported for mssql all two-phase and nested transcation tests
- marked as unsupported for mssql various transactional/session tests which require two connections looking at uncommitted/external data at the same time (ms-sql cant handle it)
- put better explicit closeout step in unitofwork.py tests to appease ms-sqls hard locking
2007-08-12 21:36:33 +00:00
Paul Johnston 0013b84f8b MSSQL: disable new 0.4 tests that cause hangs 2007-08-12 20:52:07 +00:00