| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
If autoloading of a table fails, don't register it in a metadata
instance. It seems that the original behaviour was accidentally
changed in f6198d9abf453182f4b111e0579a7a4ef1614e79, restore it.
Closes issue #2988
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is currently being supported in addition to nose, and will likely
be preferred to nose going forward. The nose plugin system used
by SQLAlchemy has been split out so that it works under pytest as
well. There are no plans to drop support for nose at the moment
and we hope that the test suite itself can continue to remain as
agnostic of testing platform as possible. See the file
README.unittests.rst for updated information on running tests
with pytest.
The test plugin system has also been enhanced to support running
tests against mutiple database URLs at once, by specifying the ``--db``
and/or ``--dburi`` flags multiple times. This does not run the entire test
suite for each database, but instead allows test cases that are specific
to certain backends make use of that backend as the test is run.
When using pytest as the test runner, the system will also run
specific test suites multiple times, once for each database, particularly
those tests within the "dialect suite". The plan is that the enhanced
system will also be used by Alembic, and allow Alembic to run
migration operation tests against multiple backends in one run, including
third-party backends not included within Alembic itself.
Third party dialects and extensions are also encouraged to standardize
on SQLAlchemy's test suite as a basis; see the file README.dialects.rst
for background on building out from SQLAlchemy's test platform.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
SQLite allows column types that aren't technically understood in sqlite
by using 'data affinity', which is an algorithm for converting column
types in to some sort of useful type that can be stored and retrieved
from the db. Unfortunatly, this breaks reflection since we (previously)
expected a sqlite db to reflect column types that we permit in the
`ischema_names` for that dialect.
This patch changes the logic for 'unknown' column types during
reflection to instead run through SQLite's data affinity algorithm, and
assigns appropriate types from that.
It also expands the matching for column type to include column types
with spaces (strongly discouraged but allowed by sqlite) and also
completely empty column types (in which case the NullType is assigned,
which sqlite will treat as a Blob - or rather, Blob is treated as
NullType). These changes mean that SQLite will never raise an error for
an unknown type during reflection - there will always be some 'useful'
type returned, which follows the spirit of SQLite (accomodation before
sanity!).
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
applied to :class:`.Constraint` and :class:`.Index` objects. Based
on a recipe in the wiki, the new feature uses schema-events to set up
names as various schema objects are associated with each other. The
events then expose a configuration system through a new argument
:paramref:`.MetaData.naming_convention`. This system allows production
of both simple and custom naming schemes for constraints and indexes
on a per-:class:`.MetaData` basis. [ticket:2923]
commit 7e65e52c086652de3dd3303c723f98f09af54db8
Author: Mike Bayer <mike_mp@zzzcomputing.com>
Date: Sat Feb 1 15:09:04 2014 -0500
- first pass at new naming approach
|
|
|
|
|
|
|
|
|
|
|
|
| |
reflection now updates the PKC in place.
- support the use case of the empty PrimaryKeyConstraint in order to specify
constraint options; the columns marked as primary_key=True will now be gathered
into the columns collection, rather than being ignored. [ticket:2910]
- add validation such that column specification should only take place
in the PrimaryKeyConstraint directly, or by using primary_key=True flags;
if both are present, they have to match exactly, otherwise the condition is
assumed to be ambiguous, and a warning is emitted; the old behavior of
using the PKC columns only is maintained.
|
|
|
|
|
|
| |
parameters are now available on the :meth:`.MetaData.reflect`
method.
- starting to use paramref and need newer paramlinks version.
|
|
|
|
|
|
| |
https://bitbucket.org/zzzeek/sqlalchemy_informixdb
- remove informix, maxdb, access symbols from tests etc.
|
|
|
|
| |
- don't use locals()
|
| |
|
|
|
|
| |
exposes it
|
| |
|
|
|
|
| |
in-python only cols
|
|
|
|
|
|
| |
of the incoming :class:`.Column` would prevent primary key constraints,
indexes, and foreign key constraints from being correctly reflected.
Also in 0.8.3. [ticket:2811]
|
|
|
|
|
|
| |
- version (0.9 for now)
- changelog
- move the test into the test suite so that all dialects can take advantage of it
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inspection API already supports reflection of table
indexes information and those also include unique
constraints (at least for PostgreSQL and MySQL).
But it could be actually useful to distinguish between
indexes and plain unique constraints (though both are
implemented in the same way internally in RDBMS).
This change adds a new method to Inspection API - get_unique_constraints()
and implements it for SQLite, PostgreSQL and MySQL dialects.
|
|
|
|
| |
- add oracle profile counts
|
|
|
|
|
|
| |
schema as well as a local schema could produce wrong results
in the case where both schemas had a table of the same name.
[ticket:2728]
|
| |
|
| |
|
|
|
|
| |
- went through examples/ and cleaned out excess list() calls
|
|
|
|
| |
- get test_naturalpks to be more generalized
|
|
|
|
|
|
| |
the given :class:`.Connection`, if given, without
opening a second connection from that connection's
:class:`.Engine`. [ticket:2604]
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
- see #2422
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]
|
|/ |
|
|
|
|
|
|
| |
which would fail to preserve the primary
key constraint of the reflected table.
[ticket:2402]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
| |
is reflected as "None", not "0" [ticket:2364].
SQLite does not appear to support constraint
naming in any case (the names are ignored).
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
first, fixes extend_existing
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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]
|
| |
|
|
|
|
|
| |
- Added mysql_length parameter to Index construct,
specifies "length" for indexes. [ticket:2293]
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
would close a Connection passed as a
bind argument. Regression from 0.6.
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
|
|
|
|
|
|
| |
classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
|