From 1fb6c4a33d67229847aafd45c783094152553936 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 2 Jul 2013 18:10:08 -0400 Subject: [PATCH] Added :class:`.BIGINT` to the list of type names that can be reflected by the SQLite dialect; courtesy Russell Stuart. [ticket:2764] --- doc/build/changelog/changelog_08.rst | 7 +++++++ doc/build/changelog/changelog_09.rst | 8 ++++++++ lib/sqlalchemy/dialects/sqlite/base.py | 6 ++++-- test/dialect/test_sqlite.py | 4 +++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst index d25cb8d676..f4dd923d6e 100644 --- a/doc/build/changelog/changelog_08.rst +++ b/doc/build/changelog/changelog_08.rst @@ -6,6 +6,13 @@ .. changelog:: :version: 0.8.2 + .. change:: + :tags: bug, sqlite + :tickets: 2764 + + Added :class:`.BIGINT` to the list of type names that can be + reflected by the SQLite dialect; courtesy Russell Stuart. + .. change:: :tags: feature, orm, declarative :tickets: 2761 diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index d86510e73f..ba39a91756 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -6,6 +6,14 @@ .. changelog:: :version: 0.9.0 + .. change:: + :tags: bug, sqlite + :tickets: 2764 + + Added :class:`.BIGINT` to the list of type names that can be + reflected by the SQLite dialect; courtesy Russell Stuart. + Also in 0.8.2. + .. change:: :tags: feature, orm, declarative :tickets: 2761 diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index 787fdec175..a9a81394f8 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -137,8 +137,9 @@ from sqlalchemy import util from sqlalchemy.sql import compiler from sqlalchemy import processors -from sqlalchemy.types import BLOB, BOOLEAN, CHAR, DATE, DATETIME, DECIMAL,\ - FLOAT, REAL, INTEGER, NUMERIC, SMALLINT, TEXT, TIME, TIMESTAMP, VARCHAR +from sqlalchemy.types import BIGINT, BLOB, BOOLEAN, CHAR,\ + DECIMAL, FLOAT, REAL, INTEGER, NUMERIC, SMALLINT, TEXT,\ + TIMESTAMP, VARCHAR class _DateTimeMixin(object): @@ -384,6 +385,7 @@ colspecs = { } ischema_names = { + 'BIGINT': sqltypes.BIGINT, 'BLOB': sqltypes.BLOB, 'BOOL': sqltypes.BOOLEAN, 'BOOLEAN': sqltypes.BOOLEAN, diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index 4ede13ff63..d75211a714 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -9,7 +9,7 @@ from sqlalchemy import Table, String, select, Text, CHAR, bindparam, Column,\ Unicode, Date, MetaData, UnicodeText, Time, Integer, TIMESTAMP, \ Boolean, func, NUMERIC, DateTime, extract, ForeignKey, text, Numeric,\ DefaultClause, and_, DECIMAL, TypeDecorator, create_engine, Float, \ - INTEGER, UniqueConstraint, DATETIME, DATE, TIME, BOOLEAN + INTEGER, UniqueConstraint, DATETIME, DATE, TIME, BOOLEAN, BIGINT from sqlalchemy.util import u, ue from sqlalchemy import exc, sql, schema, pool, types as sqltypes, util from sqlalchemy.dialects.sqlite import base as sqlite, \ @@ -137,6 +137,8 @@ class TestTypes(fixtures.TestBase, AssertsExecutionResults): (Numeric(10, 2), NUMERIC(10, 2)), (DECIMAL, DECIMAL()), (DECIMAL(10, 2), DECIMAL(10, 2)), + (INTEGER, INTEGER()), + (BIGINT, BIGINT()), (Float, Float()), (NUMERIC(), ), (TIMESTAMP, TIMESTAMP()), -- 2.47.3