Commit Graph

803 Commits

Author SHA1 Message Date
Mike Bayer 8546153d5d - break out and fix tests for materialized view and foreign tables. foreign tables not working 2014-09-16 17:24:34 -04:00
Mike Bayer ecda5429af Merge remote-tracking branch 'origin/pr/128' into pr128 2014-09-16 16:55:05 -04:00
Mike Bayer 7b766591b0 - MySQL boolean symbols "true", "false" work again. 0.9's change
in 🎫`2682` disallowed the MySQL dialect from making use of the
"true" and "false" symbols in the context of "IS" / "IS NOT", but
MySQL supports this syntax even though it has no boolean type.
MySQL remains "non native boolean", but the :func:`.true`
and :func:`.false` symbols again produce the
keywords "true" and "false", so that an expression like
``column.is_(true())`` again works on MySQL.
fixes #3186
2014-09-05 16:44:42 -04:00
Rodrigo Menezes fd2faa9bc2 Added documentation. Changed my mind - added get_foreign_table_names() only to PGInspect and not in the Dialect. Added tests for PGInspect and removed a bunch of the old test scaffolding. 2014-09-05 13:54:48 -04:00
Rodrigo Menezes fbd2d70a5c Fixing some pep8s and adding get_foreign_tables. 2014-09-03 16:38:43 -04:00
Mike Bayer 4399431b53 - The hostname-based connection format for SQL Server when using
pyodbc will no longer specify a default "driver name", and a warning
is emitted if this is missing.  The optimal driver name for SQL Server
changes frequently and is per-platform, so hostname based connections
need to specify this. DSN-based connections are preferred.
fixes #3182
2014-09-03 10:31:29 -04:00
Mike Bayer 7c6a45c480 - The :func:~.expression.column and :func:~.expression.table
constructs are now importable from the "from sqlalchemy" namespace,
just like every other Core construct.
- The implicit conversion of strings to :func:`.text` constructs
when passed to most builder methods of :func:`.select` as
well as :class:`.Query` now emits a warning with just the
plain string sent.   The textual conversion still proceeds normally,
however.  The only method that accepts a string without a warning
are the "label reference" methods like order_by(), group_by();
these functions will now at compile time attempt to resolve a single
string argument to a column or label expression present in the
selectable; if none is located, the expression still renders, but
you get the warning again. The rationale here is that the implicit
conversion from string to text is more unexpected than not these days,
and it is better that the user send more direction to the Core / ORM
when passing a raw string as to what direction should be taken.
Core/ORM tutorials have been updated to go more in depth as to how text
is handled.
fixes #2992
2014-09-01 20:19:54 -04:00
Mike Bayer e42ced2eca - these tests were squashing deprecation warnings all along... 2014-08-31 18:00:34 -04:00
Rodrigo Menezes b3f7cd8bf4 Merge branch 'master' of https://github.com/zzzeek/sqlalchemy into feature/postgres-relkind 2014-08-26 12:57:00 -04:00
Rodrigo Menezes 2f7dce1d6f Removed all mentions to postgresql_relkind 2014-08-26 12:53:34 -04:00
Mike Bayer b490534657 - pep8 formatting for pg table opts feature, tests
- add support for PG INHERITS
- fix mis-named tests
- changelog
fixes #2051
2014-08-23 15:21:16 -04:00
Malik Diarra 9eacc8d42a Correcting options name from withoids to with_oids 2014-08-17 02:48:21 +02:00
Malik Diarra 8e03430acd quoting tablespace name in create table command in postgresql dialect 2014-08-17 01:56:02 +02:00
Malik Diarra d6873904c4 Adding oids and on_commit table options 2014-08-17 01:56:02 +02:00
Malik Diarra ef6042ff46 Adding a tablespace options for postgresql create table 2014-08-17 01:56:02 +02:00
Rodrigo Menezes 8af9c7670e Merge branch 'master' of https://github.com/rclmenezes/sqlalchemy 2014-08-14 17:08:55 -04:00
Rodrigo Menezes 649f06759d Added support for postgres_relkind. 2014-08-14 14:47:23 -04:00
Mike Bayer 190961157d Merge branch 'pr126'
Conflicts:
	doc/build/changelog/changelog_10.rst
2014-08-13 17:50:50 -04:00
Mike Bayer f39767ad72 - public method name is get_enums()
- return a list of dicts like other methods do
- don't combine 'schema' with 'name', leave them separate
- support '*' argument so that we can retrieve cross-schema
if needed
- remove "conn" argument
- use bound parameters for 'schema' in SQL
- order by schema, name, label
- adapt _load_enums changes to column reflection
- changelog
- module docs for get_enums()
- add drop of enums to --dropfirst
2014-08-13 17:42:33 -04:00
Mike Bayer cca4d8fc73 - add tests for the savepoint recipe 2014-08-09 14:03:17 -04:00
Mike Bayer 17720f306d - oursql doesn't pass this consistently, not sure what the issue is 2014-08-08 14:47:27 -04:00
Mike Bayer f7cc3595ef oursql seems to handle this? unclear, might be dependent on mysql version 2014-08-08 14:40:44 -04:00
Ilya Pekelny a0e0f4c289 Public inspector method to load enum list
Provide opportunity to get enums list via an inspector instance public
interface.
2014-08-08 10:05:30 +03:00
Mike Bayer 3c6ff6adae -Fixed bug where Postgresql JSON type was not able to persist or
otherwise render a SQL NULL column value, rather than a JSON-encoded
``'null'``.  To support this case, changes are as follows:

* The value :func:`.null` can now be specified, which will always
  result in a NULL value resulting in the statement.

* A new parameter :paramref:`.JSON.none_as_null` is added, which
  when True indicates that the Python ``None`` value should be
  peristed as SQL NULL, rather than JSON-encoded ``'null'``.

Retrival of NULL as None is also repaired for DBAPIs other than
psycopg2, namely pg8000.

fixes #3159
2014-08-07 10:43:55 -04:00
Mike Bayer 83326bf44c - The exception wrapping system for DBAPI errors can now accommodate
non-standard DBAPI exceptions, such as the psycopg2
TransactionRollbackError.  These exceptions will now be raised
using the closest available subclass in ``sqlalchemy.exc``, in the
case of TransactionRollbackError, ``sqlalchemy.exc.OperationalError``.
fixes #3075
2014-07-29 14:06:43 -04:00
Mike Bayer 54592942c4 - add support for tags, including include/exclude support.
simplify tox again now that we can exclude tests more easily
2014-07-27 18:46:20 -04:00
Mike Bayer d2358629c9 - scale up for mysql, sqlite 2014-07-26 20:50:57 -04:00
Mike Bayer d92177cede - Fixed bug in :class:.postgresql.array object where comparison
to a plain Python list would fail to use the correct array constructor.
Pull request courtesy Andrew.  fixes #3141
2014-07-25 16:08:21 -04:00
Mike Bayer 31178db914 - flake8 all of test/dialect/postgresql
- add __backend__ to most tests so that pg8000 can start coming in
2014-07-25 16:04:35 -04:00
Mike Bayer 0eb53b2e79 - Fixed bug in oracle dialect test suite where in one test,
'username' was assumed to be in the database URL, even though
this might not be the case.  Fixes #3128
2014-07-18 14:27:59 -04:00
Mike Bayer 0190ede107 - determine the root cause of the mysqlconnector issue, report
it and move on
2014-07-10 16:11:03 -04:00
Mike Bayer 6c81c4c26e - mark tests failing for mysqlconnector, oursql 2014-07-10 11:47:31 -04:00
Mike Bayer bbb81e682c - support __only_on__ and __backend__ at the same time 2014-07-09 18:12:32 -04:00
Mike Bayer 2b85e80d75 - Changed the default value of "raise_on_warnings" to False for
MySQLconnector.  This was set at True for some reason.  The "buffered"
flag unfortunately must stay at True as MySQLconnector does not allow
a cursor to be closed unless all results are fully fetched. fixes #2515
- lots of MySQL tests seemed to not be hitting all backends, so we should
be getting some mysqlconnector failures now
2014-07-09 16:04:07 -04:00
jonathan vanasco c996b76d5b - add postgresql_regconfig argument to PG dialect for match() operator,
implements PG's to_tsquery('regconfig', 'arg') pattern. fixes #3078
2014-07-08 18:18:04 -04:00
mike bayer c9dceb0dfa Merge pull request #101 from ddimmich/master
Postgres 9.4 Jsonb support
2014-07-07 10:40:03 -04:00
Damian Dimmich ceeee81017 jsonb support for <@, ?| and ?& added.
need to see if equality already works.
2014-07-01 13:24:30 +04:00
Damian Dimmich 7f402761d9 it's OK to pass a dict in - it does the right thing, no need to quote it
in the tests.
2014-06-28 23:24:36 +04:00
Damian Dimmich 4eca136e09 minor cleanup of the jsonb - had extraneous operators that where copied
from hstore that don't apply.

Add tests for ? and @> operators.
2014-06-28 23:11:03 +04:00
Damian Dimmich f509260202 and tests for JSONB - as this is a superset of JSON i've subclassed
the JSON tests as all of these should be applicable as well.
2014-06-28 20:02:24 +04:00
Mike Bayer 89a6e34803 - add a test to confirm #3096, we definitely get a timedelta 2014-06-25 14:23:27 -04:00
Mike Bayer 650403ee64 - fix test failures 2014-06-21 18:11:04 -04:00
Mike Bayer 42bbb7163a - Added a new type :class:.postgresql.OID to the Postgresql dialect.
While "oid" is generally a private type within PG that is not exposed
in modern versions, there are some PG use cases such as large object
support where these types might be exposed, as well as within some
user-reported schema reflection use cases.
fixes #3002
2014-06-20 17:58:06 -04:00
Mike Bayer a46932422b - Fixed bug where column names added to `mysql_length` parameter
on an index needed to have the same quoting for quoted names in
order to be recognized.  The fix makes the quotes optional but
also provides the old behavior for backwards compatibility with those
using the workaround.
fixes #3085
2014-06-18 10:56:23 -04:00
Mike Bayer f000161f24 Merge branch 'master' of https://github.com/tlocke/sqlalchemy into tlocke-master 2014-05-30 12:08:26 -04:00
Mike Bayer e384347ffb - Added the `hashable=False flag to the PG :class:.HSTORE` type, which
is needed to allow the ORM to skip over trying to "hash" an ORM-mapped
HSTORE column when requesting it in a mixed column/entity list.
Patch courtesy Gunnlaugur Þór Briem.  Fixes #3053
2014-05-25 13:58:08 -04:00
Mike Bayer 8a4f75e972 - repair oracle compilation for new limit/offset system. 2014-05-24 21:45:15 -04:00
Tony Locke f8f29d0a10 PEP 8 tidy of pg8000 dialect and postgresql/test_dialect.py 2014-05-22 20:36:27 +01:00
Tony Locke 66e0a7771f Autocommit isolation level for postgresql+pg8000
As with postgresql+psycopg2,
execution_options(isolation_level='AUTOCOMMIT') now works for the
postgresql+pg8000 dialect.

Also enabled the autocommit test in test_dialect.py for pg8000.
2014-05-22 20:13:10 +01:00
Tony Locke fc4e113cf1 pg8000 now passes test_extract() test 2014-05-21 19:17:41 +01:00