Commit Graph

632 Commits

Author SHA1 Message Date
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
Mike Bayer 41c734b5a3 attempting to get oracle XID to work. not there yet. 2007-08-11 01:08:42 +00:00
Mike Bayer 1391efea78 repaired oracle savepoint implementation 2007-08-11 00:03:26 +00:00
Mike Bayer b852fcbce0 - oracle reflection of case-sensitive names all fixed up
- other unit tests corrected for oracle
2007-08-10 23:24:06 +00:00
Mike Bayer 219bcf8cb1 - fixes to PG unicode table/sequence reflection/create/drops 2007-08-10 18:07:46 +00:00
Jason Kirtland 1223cd15c9 Added explicit Unicode table_names test 2007-08-04 21:25:29 +00:00
Jason Kirtland 4b0c6aff01 Rearranged engine initialization, its now easy to make ad-hoc testing engines that preserve all of the --options requested
Promoted the 'utf8 bind' logic for tests needing utf8 connections into testlib
Added a pause before issuing DROPs to rid the testing db of clutter
2007-08-03 20:08:26 +00:00
Jason Kirtland b8588ef4f7 - Dialects can be queried for the server version (sqlite and mysql only with this commit)
- Mark everything in a test suite as failed when setUpAll fails.
- Added test coverage for Unicode table names in metadata.reflect()
- @testing.exclude() filters out tests by server version
- Applied exclude to the test suite, MySQL 4.1 passes again (no XA or SAVEPOINT)
- Removed MySQL charset-setting pool hook- charset=utf8&use_unicode=0 works just as well.  (Am I nuts?  I'd swear this didn't work before.)
- Finally migrated some old MySQL-tests into the dialect test module
- Corrected 'commit' and 'rollback' logic (and comment) for ancient MySQL versions lacking transactions entirely
- Deprecated the MySQL get_version_info in favor of server_version_info
- Added a big hunk-o-doc for MySQL.
2007-08-03 02:38:00 +00:00
Mike Bayer 23140c926b -merged 0.3 pool threadlocal fix from r3139 2007-08-02 00:02:16 +00:00
Jason Kirtland 04e8a839b4 MetaData can now reflect() all tables in the database en-masse thanks to table_names().
table_names changed to accept an explicit connection
ThreadLocalMetaData constructor now takes no arguments. If case_sensitive is needed in a multi-bind context, move it to Table or subclass TLMD to force it.
Banished **kwargs from MetaData
Lots of class doc and docstring improvements around MetaData and TLMD.
Some engine->bind internal naming updates + reorg in schema.
MySQL table_names now return Unicode. (Also, a unicode reflect() unit test is needed.)
2007-07-31 00:19:23 +00:00
Jonathan Ellis 47406ca924 test for table_names 2007-07-30 19:14:08 +00:00
Mike Bayer 9b1ccb29d4 clearer error for ForeignKey cant locate parent table, [ticket:565] 2007-07-29 02:26:42 +00:00
Mike Bayer 33fa7019fb - removed auto_close_cursors and disallow_open_cursors arguments from Pool;
reduces overhead as cursors are normally closed by ResultProxy and Connection.
2007-07-29 00:42:49 +00:00
Jason Kirtland 9f10023179 Added pool hooks for connection creation, check out and check in. 2007-07-28 19:51:55 +00:00
Mike Bayer 5b7363c338 - merged ants' derived attributes example from 0.4 branch
- disabled PG schema test for now (want to see the buildbot succeed)
2007-07-27 04:12:07 +00:00
Mike Bayer ed4fc64bb0 merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3. 2007-07-27 04:08:53 +00:00
Mike Bayer bdf8f4ca80 postgres cant do this particular test b.c. the default "public" schema is taken
as a blank "schema" argument on Table
2007-07-20 21:01:51 +00:00
Mike Bayer 9aa1b946ed hopefully resolved all the PG deadlocks occuring here 2007-07-20 20:22:35 +00:00
Jason Kirtland 834c0e9056 Merged lower case caching, fetching from r2955
Be sure to close rows fetched in reflection (if not autoclosed)
Fixed bind test, needed transactional storage engine for mysql
2007-07-20 19:43:46 +00:00
Mike Bayer c1bf74462f assert timeout is 3 seconds, not 2 2007-07-20 15:41:42 +00:00