Commit Graph

50 Commits

Author SHA1 Message Date
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 f1bdd4e4bb begin implementing inspection system for #2208 2012-04-03 18:53:39 -04: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 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 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 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 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 8b505e7c24 - Narrowed the assumption made when reflecting
a foreign-key referenced table with schema in
the current search path; an explicit schema will
be applied to the referenced table only if
it actually matches that of the referencing table,
which also has an explicit schema.   Previously
it was assumed that "current" schema was synonymous
with the full search_path.  [ticket:2249]
2011-08-09 19:45:20 -04:00
Mike Bayer 4d92dc9730 ARG 2011-06-02 21:35:27 -04:00
Mike Bayer 16073ae044 - adjust further for unix-style casing, also this is mysql not just mysqldb 2011-06-02 20:11:47 -04:00
Mike Bayer 9211ecb6cf - Unit tests pass 100% on MySQL installed
on windows, after aggressive exclusion of a wide variety
of tests.   Not clear to what degree the failures are related to
version 5.5 vs. the usage of windows, in particular the ON UPDATE CASCADE
immediately crashes the server.   The features being tested here are all
edge cases not likely to be used in typical MySQL environments.
- Removed the "adjust casing" step that would
fail when reflecting a table on MySQL
on windows with a mixed case name.  After some
experimenting with a windows MySQL server, it's
been determined that this step wasn't really
helping the situation much; MySQL does not return
FK names with proper casing on non-windows
platforms either, and removing the step at
least allows the reflection to act more like
it does on other OSes.   A warning here
has been considered but its difficult to
determine under what conditions such a warning
can be raised, so punted on that for now -
added some docs instead. [ticket:2181]

- supports_sane_rowcount will be set to False
if using MySQLdb and the DBAPI doesn't provide
the constants.CLIENT module.
2011-06-02 19:52:26 -04:00
Mike Bayer fae54b27db - Fixed bug whereby metadata.reflect(bind)
would close a Connection passed as a
    bind argument.  Regression from 0.6.
2011-06-01 17:46:17 -04:00
Mike Bayer d34bc7da31 - The 'useexisting' flag on Table has been superceded
by a new pair of flags 'keep_existing' and
'extend_existing'.   'extend_existing' is equivalent
to 'useexisting' - the existing Table is returned,
and additional constructor elements are added.
With 'keep_existing', the existing Table is returned,
but additional constructor elements are not added -
these elements are only applied when the Table
is newly created.   [ticket:2109]
2011-04-05 12:04:42 -04:00
Mike Bayer 7b24e458c7 - move all the comments that got shoved below the fixture grabs back up 2011-03-27 17:19:00 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer ebd0fdad73 - convert @provide_metadata to use self access
- having occasional issues with BasicEntity grabbing, if it persists
may have to pass an explicit base class into setup_classes()/setup_mappers()
2011-03-26 21:40:05 -04:00
Mike Bayer 2bd01b2dda - add tests, CHANGES for [ticket:2095] 2011-03-15 17:31:19 -04:00
Michael Trier 1f93d2b7b6 Associated was spelled wrong. 2011-03-14 00:20:34 -04:00
Mike Bayer 33eae4a140 make it more explicit in tests which dialect we want to use for things 2011-02-11 11:24:54 -05:00
Mike Bayer 9122268ed0 - new dialect for Drizzle [ticket:2003]
- move mysqldb to a connector, can be shared among mysql/drizzle
2011-01-26 10:44:00 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 041a329e69 - adapt initial patch from [ticket:1917] to current tip
- raise TypeError for immutability
2010-11-16 15:53:14 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 15442ed1f4 - added "views=True" option to metadata.reflect(),
will add the list of available views to those
being reflected.  [ticket:1936]
2010-10-02 18:05:19 -04:00
Mike Bayer 761b4f29e2 - *Major* cleanup / modernization of the Informix
dialect for 0.6, courtesy Florian Apolloner.
[ticket:1906]
2010-10-01 21:26:05 -04:00
Mike Bayer 83c9b0dcdc - Fixed bug whereby replacing composite foreign key
columns in a reflected table would cause an attempt
to remove the reflected constraint from the table
a second time, raising a KeyError.  [ticket:1865]
- fixed test of error message now that we've improved it
(didn't know that msg had an assertion)
2010-08-04 21:30:53 -04:00
Mike Bayer a6b62cc3fe Python-tidy test/engine and test/aaa_profiling, 80% auto + 20% manual intervention 2010-07-11 13:15:51 -04:00
Mike Bayer 27781263d9 - Inspector hits bind.connect() when invoked to ensure
initialize has been called.  the internal name ".conn"
is changed to ".bind", since that's what it is.
2010-06-11 11:38:06 -04:00
Mike Bayer 82d194c9a6 - Added get_pk_constraint() to reflection.Inspector, similar
to get_primary_keys() except returns a dict that includes the
name of the constraint, for supported backends (PG so far).
[ticket:1769]
- Postgresql reflects the name of primary key constraints,
if one exists.  [ticket:1769]
2010-04-15 19:05:41 -04:00
Mike Bayer 57335697c6 - EdgeCollection can now go away
- fix reflection test
2010-04-06 13:20:31 -04:00
Mike Bayer cd6af2e03b working on pyodbc / mxodbc 2010-02-27 20:03:33 +00:00
Michael Trier 8056006f06 Support for the mysql+oursql dialect. Thank you Taavi Burns. 2010-02-25 10:07:59 +00:00
Mike Bayer dd01f817b7 - oracle + firebird: "case sensitivity" feature will detect an all-lowercase
case-sensitive column name during reflect and add
"quote=True" to the generated Column, so that proper
quoting is maintained.
2010-01-24 18:41:30 +00:00
Mike Bayer fc92d14bbe - types.Binary is renamed to types.LargeBinary, it only
produces BLOB, BYTEA, or a similar "long binary" type.
New base BINARY and VARBINARY
types have been added to access these MySQL/MS-SQL specific
types in an agnostic way [ticket:1664].
2010-01-23 19:44:06 +00:00
Mike Bayer 3188ad6043 - implement dynamic type_affinity for Oracle.NUMBER
- standardize type tests on type affinity matches
2010-01-17 21:29:03 +00:00
Mike Bayer 2b1937a31e - reorganized and re-documented Oracle schema tests to assume
test user has DBA privs, and all objects can be created /dropped.
- added ORDER BY to oracle column listing
- Oracle all_tables always limits to current user if schema not given.
- views reflect - added documentation + a unit test for this.
- Table(autoload) with no bind produces an error message specific to
the fact that autoload_with should be the first option to try.
2010-01-17 20:32:45 +00:00
Mike Bayer 5d711348da - have inspector properly return default_schema_name [ticket:1626] 2010-01-03 18:27:38 +00:00
Mike Bayer 6acbb4fb93 - simplify default schema name test
- MySQL + zxjdbc *is* unicode by default.  it was the broken initialize()
2009-11-03 19:48:07 +00:00
Mike Bayer 7115454c70 added test for [ticket:1450] 2009-11-01 21:08:12 +00:00
Mike Bayer 4a7f889d8a oracle test fixes 2009-10-26 01:20:38 +00:00
Mike Bayer 5a140299b3 - Corrected the "has_sequence" query to take current schema,
or explicit sequence-stated schema, into account.
[ticket:1576]
2009-10-21 04:47:02 +00:00
Philip Jenvey 5a9c1b8824 merge from branches/clauseelement-nonzero
adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash
collisions (which only occur on Jython)
fixes #1547
2009-09-24 02:11:56 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00