Commit Graph

94 Commits

Author SHA1 Message Date
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
Mike Bayer 687d9342e6 - a new mutex that was added in 0.3.9 causes the pool_timeout
feature to fail during a race condition; threads would
raise TimeoutError immediately with no delay if many threads
push the pool into overflow at the same time.  this issue has been
fixed.
2007-07-20 15:10:56 +00:00
Jason Kirtland 7fed906a9b Better quoting of identifiers when manipulating schemas
Merged from r2981
2007-07-19 20:44:19 +00:00
Paul Johnston a966505992 Properly escape table names when reflecting for mssql and sqlite [ticket:653] 2007-07-17 20:13:36 +00:00
Jason Kirtland 23d0188749 - Added basic schema reflection coverage to main tests
- Fix stupid mysql typo (#662)
- Merged mysql osx/multibyte has_table from 0.4 (r2943)
2007-07-17 13:21:46 +00:00
Mike Bayer a3f25674fc - fixes for connection bound sessions, connection-bound compiled objects via metadata 2007-07-16 21:29:27 +00:00
Mike Bayer 3a9af19d14 - columns can be overridden in a reflected table with a "key"
attribute different than the column's name, including for primary key
columns [ticket:650]
- more docs
2007-07-15 04:50:11 +00:00
Mike Bayer d115a8c94e - the various "engine" arguments, such as "engine", "connectable",
"engine_or_url", "bind_to", etc. are all present, but deprecated.
they all get replaced by the single term "bind".  you also
set the "bind" of MetaData using
metadata.bind = <engine or connection>.  this is part of 0.4
forwards compatibility where "bind" is the only keyword.
[ticket:631]
2007-07-12 22:03:48 +00:00
Paul Johnston 81fd0c8bb9 mssql now able to reflect start and increment values for identity columns 2007-07-11 17:58:45 +00:00
Jason Kirtland 177d30cc01 - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData instead
- Deprecated BoundMetaData- use MetaData instead
- Removed DMD and BMD from documentation
2007-07-06 00:58:09 +00:00
Mike Bayer dc19e4eda6 - adjustments to pool locking test to fail on OSX
- restored conditional locking to pool, for all conditions of max_overflow > -1
2007-06-30 16:35:54 +00:00
Mike Bayer de61eb3509 - added a mutex to QueuePool's "overflow" calculation to prevent a race
condition that can bypass max_overflow; merged from 0.4 branch r2736-2738.
also made the locking logic simpler, tried to get the test to create a
failure on OSX (not successful)
2007-06-30 01:14:15 +00:00
Mike Bayer abd257eb8c - MetaData and all SchemaItems are safe to use with pickle. slow
table reflections can be dumped into a pickled file to be reused later.
Just reconnect the engine to the metadata after unpickling. [ticket:619]
2007-06-30 00:20:26 +00:00
Mike Bayer 3f3d84e754 postgres:
- added support for reflection of domains [ticket:570]
    - types which are missing during reflection resolve to Null type
      instead of raising an error
    - moved reflection/types/query unit tests specific to postgres to new
      postgres unittest module
2007-06-29 23:50:25 +00:00
Mike Bayer cbc33de2fe pg test wasnt really working with that particular default..its a TODO 2007-06-02 20:33:15 +00:00
Jason Kirtland 2aa07d6d4d - Pulling pyformat test for MySQL-python, which fails on 3 driver versions
(1.2.2b3, 1.2.2c1, 1.2.2)
2007-06-01 01:24:27 +00:00
Jason Kirtland 0a713f408d - Emit BOOL rather than BOOLEAN for MySQL booleans in DDL, for old versions
of MySQL (#583)
- MySQL columns (such as times) with colons in their default values couldn't
  be roundtripped, fixed  (also in Postgres, but not fixed here.)
- BINARY/VARBINARY columns aren't really binary at all on ancient versions
  of MySQL.  The type.Binary(123) passthrough now always makes BLOBs.
  Removed the short-lived MSBaseBinary.
- Added mysql.get_version_info, given a connectable returns a tuple of server
  version info.
- Backed off on the reflection tests for older versions of MySQL, for now.
2007-05-31 22:56:24 +00:00
Mike Bayer 4004bf6a0a normalized PG test schema name to "alt_schema" 2007-05-26 19:51:35 +00:00
Jason Kirtland 5b8e4947d7 - Setup/teardown out test table properly 2007-05-25 22:32:34 +00:00
Jason Kirtland 98207edf30 - Connections can be detached from their pool, closing on dereference instead of returning to the pool for reuse 2007-05-09 22:39:50 +00:00
Mike Bayer a74232c70c - added 'url' attribute to Engine
- added docstring to 'echo' attribute
2007-04-29 16:56:11 +00:00
Mike Bayer 6d6c546b0e a rudimental reconnect/pool auto-dispose test. not super-comprehensive but better
than nothing, will close #516
2007-04-22 00:30:39 +00:00
Mike Bayer eaad320a85 - some docstrings
- some more test scenarios for raw bind params
2007-04-20 00:43:56 +00:00
Mike Bayer 42df71d215 support positional parameters at the execute level even for DBs where we dont expect positional 2007-04-19 23:34:53 +00:00
Mike Bayer 16e9315e9b unit test with just one param 2007-04-19 23:24:07 +00:00
Mike Bayer aabb6e530b - the dialects within sqlalchemy.databases become a setuptools
entry points. loading the built-in database dialects works the
same as always, but if none found will fall back to trying
pkg_resources to load an external module [ticket:521]
2007-04-17 20:49:35 +00:00
Mike Bayer b81a0132a8 added "recreate()" argument to connection pool classes
this method is called when the invalidate() occurs for a disconnect condition,
so that the entire pool is recreated, thereby avoiding repeat errors on
remaining connections in the pool.
dispose() called as well (also fixed up) but cant guarantee all connections closed.
2007-04-17 00:21:25 +00:00
Mike Bayer 73732b8a80 - some cleanup of reflection unit tests
- removed silly behavior where sqlite would reflect UNIQUE indexes
as part of the primary key (?!)
- added __contains__ support to ColumnCollection; contains_column() method should be removed
2007-04-04 23:06:39 +00:00
Mike Bayer 01683efe1d - slight tweak to raw execute() change to also support tuples,
not just lists [ticket:523]
2007-04-03 18:08:51 +00:00
Mike Bayer cdceb3c371 - merged the "execcontext" branch, refactors engine/dialect codepaths
- much more functionality moved into ExecutionContext, which impacted
the API used by dialects to some degree
- ResultProxy and subclasses now designed sanely
- merged patch for #522, Unicode subclasses String directly,
MSNVarchar implements for MS-SQL, removed MSUnicode.
- String moves its "VARCHAR"/"TEXT" switchy thing into
"get_search_list()" function, which VARCHAR and CHAR can override
to not return TEXT in any case (didnt do the latter yet)
- implements server side cursors for postgres, unit tests, #514
- includes overhaul of dbapi import strategy #480, all dbapi
importing happens in dialect method "dbapi()", is only called
inside of create_engine() for default and threadlocal strategies.
Dialect subclasses have a datamember "dbapi" referencing the loaded
module which may be None.
- added "mock" engine strategy, doesnt require DBAPI module and
gives you a "Connecition" which just sends all executes to a callable.
can be used to create string output of create_all()/drop_all().
2007-04-02 21:36:11 +00:00
Mike Bayer c249066dbf "alltests" runners call testbase.main(), which takes an optional suite,
so that exit code is propigated
2007-03-15 18:11:05 +00:00
Rick Morrison 30b20e3c56 MSSQL now passes still more unit tests [ticket:481]
Fix to null FLOAT fields in mssql-trusted.patch
MSSQL: LIMIT with OFFSET now raises an error
MSSQL: can now specify Windows authorization
MSSQL: ignores seconds on DATE columns (DATE fix, part 1)
2007-03-15 02:31:15 +00:00
Mike Bayer 6a3c374b95 - for hackers, refactored the "visitor" system of ClauseElement and
SchemaItem so that the traversal of items is controlled by the
ClauseVisitor itself, using the method visitor.traverse(item).
accept_visitor() methods can still be called directly but will
not do any traversal of child items.  ClauseElement/SchemaItem now
have a configurable get_children() method to return the collection
of child elements for each parent object. This allows the full
traversal of items to be clear and unambiguous (as well as loggable),
with an easy method of limiting a traversal (just pass flags which
are picked up by appropriate get_children() methods). [ticket:501]
- accept_schema_visitor() methods removed, replaced with
get_children(schema_visitor=True)
- various docstring/changelog cleanup/reformatting
2007-03-11 20:52:02 +00:00
Mike Bayer b59f4d1a4a restored sequence back, needed by PG for the unit test 2007-02-22 03:51:21 +00:00
Rick Morrison e7ac502b81 Completed previously missed patches from tickets 422 and 415
get unit tests to work with pyodbc [ticket:481]
fix blank password on adodbapi [ticket:371]
2007-02-18 19:43:05 +00:00
Mike Bayer 2019974544 - fixes to tometadata() operation to propigate Constraints at column and table level 2007-02-17 19:08:36 +00:00
Rick Morrison 66a74c136f revert old unittest patch for MSSQL 2007-02-15 00:22:07 +00:00
Mike Bayer e7aaeb2852 - fixed argument passing to straight textual execute() on engine, connection.
can handle *args or a list instance for positional, **kwargs or a dict instance
for named args, or a list of list or dicts to invoke executemany()
2007-02-13 22:53:05 +00:00
Mike Bayer ffc7dbdae6 make sure auto-reflection of remote tables working too... 2007-02-04 23:52:21 +00:00