Commit Graph

803 Commits

Author SHA1 Message Date
Mike Bayer 9a4a8a8684 - totally skip on mysqlconnector for now 2015-03-21 15:14:47 -04:00
Mike Bayer 10593e7768 - oursql is unsupported on this 2015-03-21 09:57:01 -04:00
Mike Bayer 3ae00fea90 - Repaired the commit for issue #2771 which was inadvertently commented
out.
- add __backend__ to the dialect suite so that it runs on CI.
- will be 1.0.0b3
2015-03-20 19:53:12 -04:00
Mike Bayer e429f9ebe7 - test fix 2015-03-20 16:07:09 -04:00
Mike Bayer 58ce4d53bf - add a test for #2771, fixes #2771
- changelog for #2771
2015-03-20 15:08:23 -04:00
Mike Bayer 71b8df2e53 - The Postgresql :class:.postgresql.ENUM type will emit a
DROP TYPE instruction when a plain ``table.drop()`` is called,
assuming the object is not associated directly with a
:class:`.MetaData` object.   In order to accomodate the use case of
an enumerated type shared between multiple tables, the type should
be associated directly with the :class:`.MetaData` object; in this
case the type will only be created at the metadata level, or if
created directly.  The rules for create/drop of
Postgresql enumerated types have been highly reworked in general.
fixes #3319
2015-03-11 11:41:52 -04:00
Mike Bayer 7ac81f6d0a Merge branch 'postgres-concurrently' of https://bitbucket.org/iurisilvio/sqlalchemy into pr45 2015-03-10 15:00:21 -04:00
Mike Bayer ddf35e2f04 Merge branch 'sqlite-partial-indexes' of https://bitbucket.org/groner/sqlalchemy into pr42 2015-03-10 14:12:58 -04:00
Mike Bayer 7c9a0e18be - fix some more result_map calls 2015-03-08 14:16:59 -04:00
Mike Bayer 17b2fd3fba - the change for #918 was of course not nearly that simple.
The "wrapping" employed by the mssql and oracle dialects using the
"iswrapper" argument was not being used intelligently by the compiler,
and the result map was being written incorrectly, using
*more* columns in the result map than were actually returned by
the statement, due to "row number" columns that are inside the
subquery.   The compiler now writes out result map on the
"top level" select in all cases
fully, and for the mssql/oracle wrapping case extracts out
the "proxied" columns in a second step, which only includes
those columns that are proxied outwards to the top level.

This change might have implications for 3rd party dialects that
might be imitating oracle's approach.   They can safely continue
to use the "iswrapper" kw which is now ignored, but they may
need to also add the _select_wraps argument as well.
2015-03-07 23:03:27 -05:00
Mike Bayer cfb2eee0f3 - add a skip for JSONB on pg8000 if we are on 1.10.1 or earlier 2015-03-02 19:16:37 -05:00
Mike Bayer d140983148 Merge remote-tracking branch 'origin/pr/132' into pr132 2015-03-02 19:00:19 -05:00
Iuri de Silvio 955576fcf6 Dialect option postgresql_concurrently to Index construct. 2015-02-25 21:05:31 -03:00
Mike Bayer 3c46eb17ed - additional mysql cast-related test fixes 2015-02-09 20:49:19 -05:00
Mike Bayer af42398742 - The MySQL dialect now supports CAST on types that are constructed
as :class:`.TypeDecorator` objects.
2015-02-09 20:43:28 -05:00
Mike Bayer 1ad236127c - A warning is emitted when :func:.cast is used with the MySQL
dialect on a type where MySQL does not support CAST; MySQL only
supports CAST on a subset of datatypes.   SQLAlchemy has for a long
time just omitted the CAST for unsupported types in the case of
MySQL.  While we don't want to change this now, we emit a warning
to show that it's taken place.   A warning is also emitted when
a CAST is used with an older MySQL version (< 4) that doesn't support
CAST at all, it's skipped in this case as well.
fixes #3237
2015-02-09 15:29:14 -05:00
Mike Bayer 03038f7e75 - flake8 2015-02-09 15:08:52 -05:00
Kai Groner 4a42bd5a2c Test for partial index support in sqlite dialects. 2015-01-26 14:48:23 -05:00
Mike Bayer f5d4f2685f - rework assertsql system, fixes #3293 2015-01-18 20:57:26 -05:00
Mike Bayer 469b6fabaf - add an exclusion here that helps with the case of 3rd party
test suite redefining an existing test in test_suite
2015-01-17 12:46:20 -05:00
Mike Bayer 79fa69f1f3 - Fixed bug where Postgresql dialect would fail to render an
expression in an :class:`.Index` that did not correspond directly
to a table-bound column; typically when a :func:`.text` construct
was one of the expressions within the index; or could misinterpret the
list of expressions if one or more of them were such an expression.
fixes #3174
2015-01-16 18:03:45 -05:00
Mike Bayer a324164933 - this is passing, no idea why 2015-01-04 21:05:53 -05:00
Mike Bayer 93742b3d5c - The :class:.mysql.SET type has been overhauled to no longer
assume that the empty string, or a set with a single empty string
value, is in fact a set with a single empty string; instead, this
is by default treated as the empty set.  In order to handle persistence
of a :class:`.mysql.SET` that actually wants to include the blank
value ``''`` as a legitimate value, a new bitwise operational mode
is added which is enabled by the
:paramref:`.mysql.SET.retrieve_as_bitwise` flag, which will persist
and retrieve values unambiguously using their bitflag positioning.
Storage and retrieval of unicode values for driver configurations
that aren't converting unicode natively is also repaired.
fixes #3283
2015-01-03 20:43:45 -05:00
Mike Bayer 01a22a673e - clean up SET tests 2015-01-03 18:49:14 -05:00
Tony Locke 8038cfa077 pg8000 client_encoding in create_engine()
The pg8000 dialect now supports the setting of the PostgreSQL parameter
client_encoding from create_engine().
2014-12-16 20:55:55 +00:00
Mike Bayer 468db416db - rework sqlite FK and unique constraint system to combine both PRAGMA
and regexp parsing of SQL in order to form a complete picture of
constraints + their names.  fixes #3244 fixes #3261
- factor various PRAGMA work to be centralized into one call
2014-12-13 19:24:56 -05:00
Jon Nelson 85c04dd0bb - add test_get_unnamed_unique_constraints to SQLite reflection tests 2014-12-13 18:34:50 -05:00
Mike Bayer c8817e6087 - SQL Server 2012 now recommends VARCHAR(max), NVARCHAR(max),
VARBINARY(max) for large text/binary types.  The MSSQL dialect will
now respect this based on version detection, as well as the new
``deprecate_large_types`` flag.
fixes #3039
2014-12-06 13:43:39 -05:00
Mike Bayer 95cd2003bb pep8 2014-12-06 12:39:18 -05:00
Mike Bayer 0ce045bd85 - The SQLite dialect, when using the :class:.sqlite.DATE,
:class:`.sqlite.TIME`,
or :class:`.sqlite.DATETIME` types, and given a ``storage_format`` that
only renders numbers, will render the types in DDL as
``DATE_CHAR``, ``TIME_CHAR``, and ``DATETIME_CHAR``, so that despite the
lack of alpha characters in the values, the column will still
deliver the "text affinity".  Normally this is not needed, as the
textual values within the default storage formats already
imply text.
fixes #3257
2014-12-05 14:46:43 -05:00
Mike Bayer ec6214457e - pep8 2014-12-05 14:19:36 -05:00
Mike Bayer edef953797 - New Oracle DDL features for tables, indexes: COMPRESS, BITMAP.
Patch courtesy Gabor Gombas.
fixes #3127
2014-12-04 20:08:07 -05:00
Mike Bayer e46c71b419 - Added support for CTEs under Oracle. This includes some tweaks
to the aliasing syntax, as well as a new CTE feature
:meth:`.CTE.suffix_with`, which is useful for adding in special
Oracle-specific directives to the CTE.
fixes #3220
2014-12-04 19:35:00 -05:00
Mike Bayer f5ff86983f - The :meth:.Operators.match operator is now handled such that the
return type is not strictly assumed to be boolean; it now
returns a :class:`.Boolean` subclass called :class:`.MatchType`.
The type will still produce boolean behavior when used in Python
expressions, however the dialect can override its behavior at
result time.  In the case of MySQL, while the MATCH operator
is typically used in a boolean context within an expression,
if one actually queries for the value of a match expression, a
floating point value is returned; this value is not compatible
with SQLAlchemy's C-based boolean processor, so MySQL's result-set
behavior now follows that of the :class:`.Float` type.
A new operator object ``notmatch_op`` is also added to better allow
dialects to define the negation of a match operation.
fixes #3263
2014-12-04 18:29:56 -05:00
Mike Bayer 87bfcf91e9 - The :meth:.PGDialect.has_table method will now query against
``pg_catalog.pg_table_is_visible(c.oid)``, rather than testing
for an exact schema match, when the schema name is None; this
so that the method will also illustrate that temporary tables
are present.  Note that this is a behavioral change, as Postgresql
allows a non-temporary table to silently overwrite an existing
temporary table of the same name, so this changes the behavior
of ``checkfirst`` in that unusual scenario.
fixes #3264
2014-12-04 12:01:19 -05:00
Mike Bayer a19b2f419c - The :attr:.Column.key attribute is now used as the source of
anonymous bound parameter names within expressions, to match the
existing use of this value as the key when rendered in an INSERT
or UPDATE statement.   This allows :attr:`.Column.key` to be used
as a "substitute" string to work around a difficult column name
that doesn't translate well into a bound parameter name.   Note that
the paramstyle is configurable on :func:`.create_engine` in any case,
and most DBAPIs today support a named and positional style.
fixes #3245
2014-11-10 17:37:26 -05:00
Mike Bayer e04b693e7c - this test passes now in more recent mysqlconnector 2014-10-13 12:34:41 -04:00
Mike Bayer cc29c4afff - Fixed long-standing bug in Oracle dialect where bound parameter
names that started with numbers would not be quoted, as Oracle
doesn't like numerics in bound parameter names.
fixes #2138
2014-10-11 18:25:21 -04:00
Mike Bayer b510b99094 - use provide_metadata for new unique constraint / index tests
- add a test for PG reflection of unique index without any unique
constraint
- for PG, don't include 'duplicates_constraint' in the entry
if the index does not actually mirror a constraint
- use a distinct method for unique constraint reflection within table
- catch unique constraint not implemented condition; this may
be within some dialects and also is expected to be supported by
Alembic tests
- migration + changelogs for #3184
- add individual doc notes as well to MySQL, Postgreql
fixes #3184
2014-10-04 19:06:35 -04:00
Mike Bayer f7dee1380c Merge branch 'reflect-unique-constraints' of https://bitbucket.org/jerdfelt/sqlalchemy into pr30 2014-10-04 17:47:53 -04:00
Mike Bayer 4da020dae3 - rework tests for attached databases into individual tests,
test both memory and file-based
- When selecting from a UNION using an attached database file,
the pysqlite driver reports column names in cursor.description
as 'dbname.tablename.colname', instead of 'tablename.colname' as
it normally does for a UNION (note that it's supposed to just be
'colname' for both, but we work around it).  The column translation
logic here has been adjusted to retrieve the rightmost token, rather
than the second token, so it works in both cases.   Workaround
courtesy Tony Roberts.
fixes #3211
2014-09-29 18:09:25 -04:00
Mike Bayer e3f07f7206 - Added support for the Oracle table option ON COMMIT. This is being
kept separate from Postgresql's ON COMMIT for now even though ON COMMIT
is in the SQL standard; the option is still very specific to temp tables
and we eventually would provide a more first class temporary table
feature.
- oracle can apparently do get_temp_table_names() too, so implement that,
fix its get_table_names(), and add it to #3204.  fixes #3204 again.
2014-09-17 19:43:45 -04:00
Johannes Erdfelt 7fa21b2298 Reflect unique constraints when reflecting a Table object
Calls to reflect a table did not create any UniqueConstraint objects.
The reflection core made no calls to get_unique_constraints and as
a result, the sqlite dialect would never reflect any unique constraints.

MySQL transparently converts unique constraints into unique indexes, but
SQLAlchemy would reflect those as an Index object and as a
UniqueConstraint. The reflection core will now deduplicate the unique
constraints.

PostgreSQL would reflect unique constraints as an Index object and as
a UniqueConstraint object. The reflection core will now deduplicate
the unique indexes.
2014-09-17 13:19:50 -07:00
Mike Bayer 7864f80a62 Merge branch 'sqlite-temp-table-reflection' of https://bitbucket.org/jerdfelt/sqlalchemy/branch/sqlite-temp-table-reflection into pr31 2014-09-17 15:16:33 -04:00
Mike Bayer cb23fa243f - Added :meth:.Inspector.get_temp_table_names and
:meth:`.Inspector.get_temp_view_names`; currently, only the
SQLite dialect supports these methods.    The return of temporary
table and view names has been **removed** from SQLite's version
of :meth:`.Inspector.get_table_names` and
:meth:`.Inspector.get_view_names`; other database backends cannot
support this information (such as MySQL), and the scope of operation
is different in that the tables can be local to a session and
typically aren't supported in remote schemas.
fixes #3204
2014-09-17 15:15:21 -04:00
Mike Bayer 3a6cd72bea Merge branch 'pr128' 2014-09-17 13:11:49 -04:00
Mike Bayer be57def4b9 - repair get_foreign_table_names() for PGInsp/dialect level
- repair get_view_names()
- changelog + migration note
2014-09-17 13:11:22 -04:00
Mike Bayer 414bc1c64d - the actual round trip requires password authent set up for the user;
we don't actually need a round trip test here as we're only testing reflection.
2014-09-17 12:41:08 -04:00
Johannes Erdfelt 9d402e204d Handle sqlite get_unique_constraints() call for temporary tables
The sqlite get_unique_constraints() implementation did not do a union
against the sqlite_temp_master table like other code does. This could
result in an exception being raised if get_unique_constraints() was
called against a temporary table.
2014-09-17 08:01:01 -07:00
Mike Bayer a985f84ed6 - Fixed the version string detection in the pymssql dialect to
work with Microsoft SQL Azure, which changes the word "SQL Server"
to "SQL Azure".
fixes #3151
2014-09-16 17:40:06 -04:00