summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects
Commit message (Collapse)AuthorAgeFilesLines
* SQLite dialect - support relection from affinitypr/65Erich Blume2014-02-031-11/+36
| | | | | | | | | | | | | | | | | | | | | | 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!).
* PEP-8 compliance for dialects/sqlite/base.pyErich Blume2014-01-302-143/+129
|
* - Added new test coverage for so-called "down adaptions" of SQL types,Mike Bayer2014-01-222-8/+10
| | | | | | | | | | | where a more specific type is adapted to a more generic one - this use case is needed by some third party tools such as ``sqlacodegen``. The specific cases that needed repair within this test suite were that of :class:`.mysql.ENUM` being downcast into a :class:`.types.Enum`, and that of SQLite date types being cast into generic date types. The ``adapt()`` method needed to become more specific here to counteract the removal of a "catch all" ``**kwargs`` collection on the base :class:`.TypeEngine` class that was removed in 0.9. [ticket:2917]
* - some test fixesMike Bayer2014-01-191-2/+4
| | | | - clean up some shenanigans in reflection
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-187-33/+77
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - changelog for pullreq:11Mike Bayer2014-01-181-1/+1
| | | | - be specific about version 0.9.2
* Merge branch 'patch-msql-pkc-clustered' of bitbucket.org:dharland/sqlalchemy ↵Mike Bayer2014-01-181-8/+71
|\ | | | | | | into m
| * Bug Fix: Stop generating bad sql if an empty UniqueConstraint() is givendonkopotamus2014-01-171-0/+2
| |
| * Support mssql_clustered option on UniqueConstraint (plus docs and test)donkopotamus2014-01-171-4/+29
| |
| * Remove support for mssql_clustered on Tabledonkopotamus2014-01-171-15/+5
| |
| * Support mssql_clustered option in mssql dialect for both Table and ↵donkopotamus2014-01-141-8/+54
| | | | | | | | PrimaryKeyConstraint
* | - rework Oracle to no longer do its own unicode conversion; this has been ↵Mike Bayer2014-01-171-3/+0
|/ | | | | | | | | | | observed to be very slow. this now has the effect of producing "conditional" unicode conversion for the Oracle backend, as it still returns NVARCHAR etc. as unicode [ticket:2911] - add new "conditional" functionality to unicode processors; the C-level function now uses PyUnicode_Check() as a fast alternative to the isinstance() check in Python
* - The MySQL CAST compilation now takes into account aspects of a stringMike Bayer2014-01-132-10/+50
| | | | | | | | | | | | | | | | | | | | | type such as "charset" and "collation". While MySQL wants all character- based CAST calls to use the CHAR type, we now create a real CHAR object at CAST time and copy over all the parameters it has, so that an expression like ``cast(x, mysql.TEXT(charset='utf8'))`` will render ``CAST(t.col AS CHAR CHARACTER SET utf8)``. - Added new "unicode returns" detection to the MySQL dialect and to the default dialect system overall, such that any dialect can add extra "tests" to the on-first-connect "does this DBAPI return unicode directly?" detection. In this case, we are adding a check specifically against the "utf8" encoding with an explicit "utf8_bin" collation type (after checking that this collation is available) to test for some buggy unicode behavior observed with MySQLdb version 1.2.3. While MySQLdb has resolved this issue as of 1.2.4, the check here should guard against regressions. The change also allows the "unicode" checks to log in the engine logs, which was not previously the case. [ticket:2906]
* - happy new yearMike Bayer2014-01-0547-49/+49
|
* - apply a similar fix for floats to mssql+pyodbc as we did to firebirdMike Bayer2013-12-281-3/+9
| | | | | - wrangle through osx+pyodbc+freetds to get at least test_suite to pass again with mssql+pyodbc. invovled adding some silly requirements
* - rework the JSON expression system so that "astext" is called *after*Mike Bayer2013-12-272-33/+91
| | | | | | | | | 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].
* - Changed the queries used by Firebird to list table and view namesMike Bayer2013-12-271-5/+21
| | | | | | | | | to query from the ``rdb$relations`` view instead of the ``rdb$relation_fields`` and ``rdb$view_relations`` views. Variants of both the old and new queries are mentioned on many FAQ and blogs, however the new queries are taken straight from the "Firebird FAQ" which appears to be the most official source of info. [ticket:2898]
* - The firebird dialect will quote identifiers which begin with anMike Bayer2013-12-271-0/+1
| | | | underscore. Courtesy Treeve Jelbert. [ticket:2897]
* - Fixed bug in Firebird index reflection where the columns within theMike Bayer2013-12-271-1/+1
| | | | | index were not sorted correctly; they are now sorted in order of RDB$FIELD_POSITION.
* - The "asdecimal" flag used with the :class:`.Float` type will nowMike Bayer2013-12-271-1/+8
| | | | | | work with Firebird dialects; previously the decimal conversion was not occurring. - scale back some firebird FP numeric tests
* Merge pull request #51 from sontek/pymssql_handle_terminated_connectionmike bayer2013-12-271-0/+1
|\ | | | | Remove terminated connections from the pool.
| * Remove terminated connections from the pool.pr/51John Anderson2013-12-161-0/+1
| | | | | | | | | | | | In pymssql, if you terminate a long running query manually it will give you a connection reset by peer message, but this connection remains in the pool and will be re-used.
* | - Improvements to the system by which SQL types generate withinMike Bayer2013-12-181-8/+27
| | | | | | | | | | | | | | | | ``__repr__()``, particularly with regards to the MySQL integer/numeric/ character types which feature a wide variety of keyword arguments. The ``__repr__()`` is important for use with Alembic autogenerate for when Python code is rendered in a migration script. [ticket:2893]
* | - make the json serializer and deserializer per-dialect, so that we areMike Bayer2013-12-173-15/+28
| | | | | | | | | | compatible with psycopg2's per-connection/cursor approach. add round trip tests for both native and non-native.
* | - rework JSON expressions to be based off __getitem__ exclusivelyMike Bayer2013-12-173-38/+44
| | | | | | | | | | | | | | | | | | - 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
* | Merge branch 'issue_2581' of github.com:nathan-rice/sqlalchemy into pg_jsonMike Bayer2013-12-174-1/+148
|\ \ | |/ |/|
| * sqlalchemy/dialects/postgresql/pgjson:pr/50nathan2013-12-111-7/+14
| | | | | | | | - Updated documentation for JSON class
| * sqlalchemy/dialects/postgresql/pgjson:nathan2013-12-111-2/+14
| | | | | | | | | | - Added support for additional operators - Made return as json default (rather than text)
| * sqlalchemy/dialects/postgresql/psycopg2:nathan2013-12-101-2/+0
| | | | | | | | - Removed unneeded import of psycopg2.extensions
| * sqlalchemy/dialects/postgresql/pgjson:nathan2013-12-102-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | - Fixed reference to HSTORE - Corrected spelling of SQLAlchemy sqlalchemy/dialects/postgresql/psycopg2: - Added psycopg2 specific wrapper type for JSON which uses inherent json deserialization facilities - Added code to detect and utilize the JSON wrapper if psycopg2 >= 2.5 test/dialect/postgresql/test_types: - removed reference to use_native_hstore
| * Merge branch 'rel_0_9' of https://github.com/nathan-rice/sqlalchemy into rel_0_9nathan2013-12-091-5/+3
| |\
| * | sqlalchemy/dialects/postgresql/__init__.py:nathan2013-12-093-1/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added import references to JSON class sqlalchemy/dialects/postgresql/base.py: - Added visitor method for JSON class sqlalchemy/dialects/postgresql/pgjson (new): - JSON class, supports automatic serialization and deserialization of json data, as well as basic json operators.
* | | - add "force_nocheck" as a way to turn on unicode=force without evenMike Bayer2013-12-151-19/+9
| | | | | | | | | | | | | | | | | | | | | doing the isinstance() check - currently used only by psycopg2 + native enum + py2k. - didn't realize psycopg2 had UNICODEARRAY extension all this time; replace _PGArray with just using UNICODEARRAY instead. - replace unnecessary/inconsistent __import__ in _isolation_lookup.
* | | - round trip testMike Bayer2013-12-091-18/+44
| | | | | | | | | | | | | | | - changelog - some doc rearrangement
* | | Adds tsvector to ischema_names for reflection to work.Noufal Ibrahim2013-12-101-0/+1
| | | | | | | | | | | | Signed-off-by: Noufal Ibrahim <noufal@nibrahim.net.in>
* | | Updates documentation for tsvector type.Noufal Ibrahim2013-12-101-1/+26
| | | | | | | | | | | | Signed-off-by: Noufal Ibrahim <noufal@nibrahim.net.in>
* | | Implements TSVECTOR type for postgresql.Noufal Ibrahim2013-12-102-2/+10
| |/ |/| | | | | Signed-off-by: Noufal Ibrahim <noufal@nibrahim.net.in>
* | Fix MSSQL dialects visit_drop_index to use the correct DDLdonkopotamus2013-12-051-5/+3
|/
* - Added ORA-02396 "maximum idle time" error code to list ofMike Bayer2013-12-031-1/+2
| | | | "is disconnect" codes with cx_oracle. [ticket:2864]
* - Fixed bug where values within an ENUM weren't escaped for singleMike Bayer2013-11-301-1/+3
| | | | | quote signs. Note that this is backwards-incompatible for existing workarounds that manually escape the single quotes. [ticket:2878]
* - add support for bindparam() called from AsFromTextMike Bayer2013-11-291-13/+16
| | | | | - get PG dialect to work around "no nonexistent binds" rule for now, though we might want to reconsider this behavior
* Merge pull request #46 from vrajmohan/mastermike bayer2013-11-292-6/+6
|\ | | | | More fixes for cross references and reducing warnings (3rd wave)
| * Fix cross referencespr/46Vraj Mohan2013-11-172-6/+6
| |
* | - add support for specifying tables or entities for "of"Mike Bayer2013-11-281-2/+3
| | | | | | | | | | - implement Query with_for_update() - rework docs and tests
* | - fix up rendering of "of"Mike Bayer2013-11-282-8/+8
| | | | | | | | | | | | - move out tests, dialect specific out of compiler, compiler tests use new API, legacy API tests in test_selecatble - add support for adaptation of ForUpdateArg, alias support in compilers
* | - work in progress, will squashMike Bayer2013-11-283-59/+29
| |
* | Merge branch 'for_update_of' of github.com:mlassnig/sqlalchemy into ↵Mike Bayer2013-11-283-10/+59
|\ \ | | | | | | | | | for_update_of
| * | added LockmodeArgspr/42Mario Lassnig2013-11-283-16/+45
| | |
| * | added ORM supportMario Lassnig2013-11-142-10/+28
| | |
| * | add psql FOR UPDATE OF functionalityMario Lassnig2013-11-121-0/+2
| | |