summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql
Commit message (Collapse)AuthorAgeFilesLines
* - use provide_metadata for new unique constraint / index testsMike Bayer2014-10-041-23/+51
| | | | | | | | | | | | | | - 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
* Reflect unique constraints when reflecting a Table objectJohannes Erdfelt2014-09-171-2/+35
| | | | | | | | | | | | | | | 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.
* - repair get_foreign_table_names() for PGInsp/dialect levelpr128Mike Bayer2014-09-171-3/+22
| | | | | - repair get_view_names() - changelog + migration note
* - the actual round trip requires password authent set up for the user;Mike Bayer2014-09-171-25/+7
| | | | we don't actually need a round trip test here as we're only testing reflection.
* - break out and fix tests for materialized view and foreign tables. foreign ↵Mike Bayer2014-09-161-72/+86
| | | | tables not working
* Merge remote-tracking branch 'origin/pr/128' into pr128Mike Bayer2014-09-161-1/+101
|\
| * Added documentation. Changed my mind - added get_foreign_table_names() only ↵pr/128Rodrigo Menezes2014-09-051-0/+6
| | | | | | | | to PGInspect and not in the Dialect. Added tests for PGInspect and removed a bunch of the old test scaffolding.
| * Fixing some pep8s and adding get_foreign_tables.Rodrigo Menezes2014-09-031-6/+11
| |
| * Merge branch 'master' of https://github.com/zzzeek/sqlalchemy into ↵Rodrigo Menezes2014-08-261-0/+84
| |\ | | | | | | | | | feature/postgres-relkind
| * | Removed all mentions to postgresql_relkindRodrigo Menezes2014-08-261-22/+11
| | |
| * | Merge branch 'master' of https://github.com/rclmenezes/sqlalchemyRodrigo Menezes2014-08-141-0/+66
| |\ \
| * | | Added support for postgres_relkind.Rodrigo Menezes2014-08-141-1/+101
| | | |
* | | | - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-011-2/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | - pep8 formatting for pg table opts feature, testsMike Bayer2014-08-231-22/+73
| | | | | | | | | | | | | | | | | | | | | - add support for PG INHERITS - fix mis-named tests - changelog fixes #2051
* | | Correcting options name from withoids to with_oidsMalik Diarra2014-08-171-3/+3
| | |
* | | quoting tablespace name in create table command in postgresql dialectMalik Diarra2014-08-171-0/+5
| | |
* | | Adding oids and on_commit table optionsMalik Diarra2014-08-171-0/+22
| | |
* | | Adding a tablespace options for postgresql create tableMalik Diarra2014-08-171-0/+6
| |/ |/|
* | - public method name is get_enums()Mike Bayer2014-08-131-12/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | Public inspector method to load enum listpr/126Ilya Pekelny2014-08-081-0/+21
|/ | | | | Provide opportunity to get enums list via an inspector instance public interface.
* -Fixed bug where Postgresql JSON type was not able to persist orMike Bayer2014-08-071-5/+98
| | | | | | | | | | | | | | | | | 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
* - The exception wrapping system for DBAPI errors can now accommodateMike Bayer2014-07-291-0/+10
| | | | | | | | 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
* - add support for tags, including include/exclude support.Mike Bayer2014-07-272-2/+2
| | | | simplify tox again now that we can exclude tests more easily
* - Fixed bug in :class:`.postgresql.array` object where comparisonMike Bayer2014-07-252-0/+29
| | | | | to a plain Python list would fail to use the correct array constructor. Pull request courtesy Andrew. fixes #3141
* - flake8 all of test/dialect/postgresqlMike Bayer2014-07-255-758/+995
| | | | - add __backend__ to most tests so that pg8000 can start coming in
* - add postgresql_regconfig argument to PG dialect for match() operator,jonathan vanasco2014-07-081-0/+81
| | | | implements PG's to_tsquery('regconfig', 'arg') pattern. fixes #3078
* jsonb support for <@, ?| and ?& added.pr/101Damian Dimmich2014-07-011-0/+19
| | | | need to see if equality already works.
* it's OK to pass a dict in - it does the right thing, no need to quote itDamian Dimmich2014-06-281-1/+1
| | | | in the tests.
* minor cleanup of the jsonb - had extraneous operators that where copiedDamian Dimmich2014-06-281-1/+15
| | | | | | from hstore that don't apply. Add tests for ? and @> operators.
* and tests for JSONB - as this is a superset of JSON i've subclassedDamian Dimmich2014-06-281-1/+15
| | | | the JSON tests as all of these should be applicable as well.
* - Added a new type :class:`.postgresql.OID` to the Postgresql dialect.Mike Bayer2014-06-201-0/+13
| | | | | | | | 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
* Merge branch 'master' of https://github.com/tlocke/sqlalchemy into tlocke-masterMike Bayer2014-05-302-64/+53
|\
| * PEP 8 tidy of pg8000 dialect and postgresql/test_dialect.pypr/88Tony Locke2014-05-221-50/+40
| |
| * Autocommit isolation level for postgresql+pg8000Tony Locke2014-05-221-7/+13
| | | | | | | | | | | | | | | | 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.
| * pg8000 now passes test_extract() testTony Locke2014-05-211-1/+0
| |
| * Two tests now work for pg800 in EnumTestTony Locke2014-05-211-6/+0
| | | | | | | | | | The two tests, test_create_table() and test_unicode_labels() previously failed under pg8000, but now they pass, so this commit opens them up.
* | - Added the ``hashable=False`` flag to the PG :class:`.HSTORE` type, whichMike Bayer2014-05-251-0/+15
|/ | | | | | 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
* - changelog for #2785Mike Bayer2014-05-161-29/+15
| | | | | - refactor tests a bit fixes #2785
* zero_indexes-param-for-postgresql-ARRAY-typeAlexey Terentev2014-05-131-0/+53
|
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-263-3/+3
| | | | Found using: https://github.com/intgr/topy
* - Fixed regression caused by release 0.8.5 / 0.9.3's compatibilityMike Bayer2014-03-251-1/+1
| | | | | | | | | enhancements where index reflection on Postgresql versions specific to only the 8.1, 8.2 series again broke, surrounding the ever problematic int2vector type. While int2vector supports array operations as of 8.1, apparently it only supports CAST to a varchar as of 8.3. fix #3000
* pytest calls all the descriptors. and we can't call this one unconditionallyMike Bayer2014-03-041-7/+6
|
* - Support has been added for pytest to run tests. This runnerMike Bayer2014-03-032-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* - Support has been improved for Postgresql reflection behavior on very oldMike Bayer2014-02-184-7/+12
| | | | | | | | | | | | (pre 8.1) versions of Postgresql, and potentially other PG engines such as Redshift (assuming Redshift reports the version as < 8.1). The query for "indexes" as well as "primary keys" relies upon inspecting a so-called "int2vector" datatype, which refuses to coerce to an array prior to 8.1 causing failures regarding the "ANY()" operator used in the query. Extensive googling has located the very hacky, but recommended-by-PG-core-developer query to use when PG version < 8.1 is in use, so index and primary key constraint reflection now work on these versions.
* - Added :paramref:`.MetaData.reflect.**dialect_kwargs`Mike Bayer2014-02-021-88/+175
| | | | | | | | | | | | | | | | | | to support dialect-level reflection options for all :class:`.Table` objects reflected. - Added a new dialect-level argument ``postgresql_ignore_search_path``; this argument is accepted by both the :class:`.Table` constructor as well as by the :meth:`.MetaData.reflect` method. When in use against Postgresql, a foreign-key referenced table which specifies a remote schema name will retain that schema name even if the name is present in the ``search_path``; the default behavior since 0.7.3 has been that schemas present in ``search_path`` would not be copied to reflected :class:`.ForeignKey` objects. The documentation has been updated to describe in detail the behavior of the ``pg_get_constraintdef()`` function and how the ``postgresql_ignore_search_path`` feature essentially determines if we will honor the schema qualification reported by this function or not. [ticket:2922]
* - rework the JSON expression system so that "astext" is called *after*Mike Bayer2013-12-271-7/+25
| | | | | | | | | the indexing. this is for more natural operation. - also add cast() to the JSON expression to complement astext. This integrates the CAST call which will be needed frequently. Part of [ticket:2687]. - it's a little unclear how more advanced unicode attribute-access is going to go, some quick attempts at testing yielded strange error messages from psycopg2. - do other cross linking as mentioned in [ticket:2687].
* - make the json serializer and deserializer per-dialect, so that we areMike Bayer2013-12-171-22/+69
| | | | | compatible with psycopg2's per-connection/cursor approach. add round trip tests for both native and non-native.
* this test appears to be failing with pg 9.3, not sure how to restore itMike Bayer2013-12-171-1/+3
|
* - using AssertsCompiledSQL so need __dialect__Mike Bayer2013-12-171-0/+3
|
* - rework JSON expressions to be based off __getitem__ exclusivelyMike Bayer2013-12-171-29/+78
| | | | | | | | | - add support for "standalone" JSON objects; this involves getting CAST to upgrade the given type of a bound parameter. should add a core-only test for this. - add tests for "standalone" json round trips both with and without unicode - add mechanism by which we remove psycopg2's "json" handler in order to get the effect of using our non-native result handlers