summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/sqlite/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/pr/230'Mike Bayer2016-03-301-1/+9
|\
| * same logic, but without the inner functionpr/230Diana Clarke2016-01-281-4/+3
| |
| * sqlite: reflect primary key constraint names, fixes #3629Diana Clarke2016-01-271-1/+10
| |
* | - happy new yearMike Bayer2016-01-291-1/+1
|/
* - The workaround for right-nested joins on SQLite, where they are rewrittenMike Bayer2016-01-261-6/+13
| | | | | | | | | | as subqueries in order to work around SQLite's lack of support for this syntax, is lifted when SQLite version 3.7.16 or greater is detected. fixes #3634 - The workaround for SQLite's unexpected delivery of column names as ``tablename.columnname`` for some kinds of queries is now disabled when SQLite version 3.10.0 or greater is detected. fixes #3633
* - documenation updates to clarify specific SQLite versionsMike Bayer2016-01-211-2/+14
| | | | | | | | | that have problems with right-nested joins and UNION column keys; references #3633 references #3634. backport from 1.1 to 0.9 announcing 1.1 as where these behaviors will be retired based on version-specific checks - fix test_resultset so that it passes when SQLite 3.10.0 is present, references #3633
* - for DB's w/o a real "autoincrement", reflection should be returningMike Bayer2015-10-071-1/+1
| | | | "auto", doesn't matter if there's a default here
* - The system by which a :class:`.Column` considers itself to be anMike Bayer2015-10-071-7/+15
| | | | | | | | | | | | | | | | | "auto increment" column has been changed, such that autoincrement is no longer implicitly enabled for a :class:`.Table` that has a composite primary key. In order to accommodate being able to enable autoincrement for a composite PK member column while at the same time maintaining SQLAlchemy's long standing behavior of enabling implicit autoincrement for a single integer primary key, a third state has been added to the :paramref:`.Column.autoincrement` parameter ``"auto"``, which is now the default. fixes #3216 - The MySQL dialect no longer generates an extra "KEY" directive when generating CREATE TABLE DDL for a table using InnoDB with a composite primary key with AUTO_INCREMENT on a column that isn't the first column; to overcome InnoDB's limitation here, the PRIMARY KEY constraint is now generated with the AUTO_INCREMENT column placed first in the list of columns.
* - limit the search for schemas to not include "temp", which is sort of an ↵Mike Bayer2015-09-281-6/+20
| | | | | | | | | | implicit schema - repair the CREATE INDEX ddl for schemas - update provisioning to include support for setting up ATTACH DATABASE up front for the test_schema; enable "schemas" testing for SQLite - changelog / migration notes for new SQLite schema support - include the "schema" as the "remote_schema" when we reflect SQLite FKs
* Support get_schema_names for SQLiteBrian Van Klaveren2015-09-091-0/+7
|
* - Fixed bug in SQLite dialect where reflection of UNIQUE constraintsMike Bayer2015-07-211-1/+1
| | | | | | that included non-alphabetic characters in the names, like dots or spaces, would not be reflected with their name. fixes #3495
* - document SQlite dotted name issue, fixes #3441Mike Bayer2015-06-051-0/+101
|
* - document fully how to use autoincrement w/ SQLite includingMike Bayer2015-05-221-7/+67
| | | | non-Integer column types, fixes #2075
* - The "auto close" for :class:`.ResultProxy` is now a "soft" close.Mike Bayer2015-03-171-1/+1
| | | | | | | | | | | That is, after exhausing all rows using the fetch methods, the DBAPI cursor is released as before and the object may be safely discarded, but the fetch methods may continue to be called for which they will return an end-of-result object (None for fetchone, empty list for fetchmany and fetchall). Only if :meth:`.ResultProxy.close` is called explicitly will these methods raise the "result is closed" error. fixes #3330 fixes #3329
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - repair doclevelMike Bayer2015-03-101-1/+1
|
* - changelog / doc for sqlite partial indexesMike Bayer2015-03-101-0/+20
|
* Partial index support with sqlite dialects.Kai Groner2015-01-261-2/+16
| | | | | | | | | | | From https://www.sqlite.org/partialindex.html > Partial indexes have been supported in SQLite since version 3.8.0. Reflection does not expose the predicate of partial indexes. The postgresql dialect does detect such indexes and issue a warning. I looked into matching this level of support, but the sqlite pragma index_info does not expose the predicate. Getting this data would probably require parsing the CREATE INDEX statement from sqlite_master.
* - Added new user-space accessors for viewing transaction isolationMike Bayer2015-01-201-0/+2
| | | | | | | | | levels; :meth:`.Connection.get_isolation_level`, :attr:`.Connection.default_isolation_level`. - enhance documentation inter-linkage between new accessors, existing isolation_level parameters, as well as in the dialect-level methods which should be fully covered by Engine/Connection level APIs now.
* - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-161-5/+6
| | | | | | | | | | | | | | now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
* - restate sort_tables in terms of a more fine grainedMike Bayer2015-01-011-0/+12
| | | | | | | | | | | | | sort_tables_and_constraints function. - The DDL generation system of :meth:`.MetaData.create_all` and :meth:`.Metadata.drop_all` has been enhanced to in most cases automatically handle the case of mutually dependent foreign key constraints; the need for the :paramref:`.ForeignKeyConstraint.use_alter` flag is greatly reduced. The system also works for constraints which aren't given a name up front; only in the case of DROP is a name required for at least one of the constraints involved in the cycle. fixes #3282
* - squash-merge the improve_toc branch, which moves all the Sphinx stylingMike Bayer2014-12-171-3/+3
| | | | | | and extensions into an external library, and also reorganizes most large documentation pages into many small areas to reduce scrolling and better present the context into a more fine-grained hierarchy.
* - rework sqlite FK and unique constraint system to combine both PRAGMAMike Bayer2014-12-131-112/+187
| | | | | | 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
* - fix unique constraint parsing for sqlite -- may return '' for name, howeverJon Nelson2014-12-131-1/+1
|
* - The SQLite dialect, when using the :class:`.sqlite.DATE`,Mike Bayer2014-12-051-1/+59
| | | | | | | | | | | | :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
* - The behavioral contract of the :attr:`.ForeignKeyConstraint.columns`Mike Bayer2014-11-251-2/+2
| | | | | | | | collection has been made consistent; this attribute is now a :class:`.ColumnCollection` like that of all other constraints and is initialized at the point when the constraint is associated with a :class:`.Table`. fixes #3243
* - rework tests for attached databases into individual tests,Mike Bayer2014-09-291-3/+5
| | | | | | | | | | | | | 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
* Merge branch 'sqlite-temp-table-reflection' of ↵Mike Bayer2014-09-171-10/+18
|\ | | | | | | https://bitbucket.org/jerdfelt/sqlalchemy/branch/sqlite-temp-table-reflection into pr31
| * Handle sqlite get_unique_constraints() call for temporary tablesJohannes Erdfelt2014-09-171-10/+18
| | | | | | | | | | | | | | 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.
* | - Added :meth:`.Inspector.get_temp_table_names` andMike Bayer2014-09-171-26/+23
|/ | | | | | | | | | | | :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
* - ensure literal_binds works with LIMIT clause, FOR UPDATEMike Bayer2014-09-031-5/+5
|
* - rewrite all the sqlite/pysqlite transaction isolation docsMike Bayer2014-08-091-34/+100
|
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-53/+61
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - add link to dialect docs for SQLite autoincrement from column autoincrement,Mike Bayer2014-07-031-2/+4
| | | | fixes #3110
* Merge branch 'issue_3034' of ↵Mike Bayer2014-05-161-5/+5
|\ | | | | | | https://bitbucket.org/dobesv/sqlalchemy/branch/issue_3034 into ticket_3034
| * Remove unused importDobes Vandermeer2014-04-251-1/+0
| |
| * Use _offset_clause and _limit_clause, which are always Visitable and usually ↵Dobes Vandermeer2014-04-251-5/+5
| | | | | | | | a BindParameter, instead of _offset and _limit in GenerativeSelect.
| * Proof-of-concept implementation of supporting bindparam for offset and limit ↵Dobes Vandermeer2014-04-241-2/+3
| | | | | | | | on a query.
* | Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-5/+5
|/ | | | Found using: https://github.com/intgr/topy
* fix typorel_0_9_3Mike Bayer2014-02-191-1/+1
|
* - rewrite SQLite reflection tests into one consistent fixture, which testsMike Bayer2014-02-161-25/+31
| | | | both _resolve_type_affinity() directly as well as round trip tests fully.
* - The SQLite dialect will now skip unsupported arguments when reflectingMike Bayer2014-02-161-1/+8
| | | | | | types; such as if it encounters a string like ``INTEGER(5)``, the :class:`.INTEGER` type will be instantiated without the "5" being included, based on detecting a ``TypeError`` on the first attempt.
* - changelog + documentation for pullreq github:65Mike Bayer2014-02-161-6/+57
|
* Merge branch 'master' of https://github.com/eblume/sqlalchemy into tMike Bayer2014-02-161-145/+158
|\
| * 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-301-134/+122
| |
* | - Fixed bug whereby SQLite compiler failed to propagate compiler argumentsMike Bayer2014-01-311-2/+2
|/ | | | | | | | | | such as "literal binds" into a CAST expression. - Fixed bug whereby binary type would fail in some cases if used with a "test" dialect, such as a DefaultDialect or other dialect with no DBAPI. - Fixed bug where "literal binds" wouldn't work with a bound parameter that's a binary type. A similar, but different, issue is fixed in 0.8.
* - Added new test coverage for so-called "down adaptions" of SQL types,Mike Bayer2014-01-221-5/+6
| | | | | | | | | | | 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]
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-10/+16
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey