- attached sqlite.percious.patch.diff
support empty inserts on very old SQLite versions without DEFAULT VALUES
create an sqlite database and engine
table = Table('t', Column('i', Integer)) table.create()
insert(table, values={})
Patch is provided.
Comments (5)
-
Account Deleted -
- marked as major
The patch doesn't work:
t = Table('t', m, Column('x', Integer), Column('y', Integer)) t.create() t.insert().execute()
(
OperationalError
)table t has 2 columns but
1 values were supplied
u'INSERT INTO t VALUES(NULL)'
A workaround for older sqlites lacking DEFAULT VALUES is possible. A patch would need to include test cases against sqlite tables created with the different permutations of rowid assignment - pk, pk + autoincrement, etc. to ensure that assigning an explicit NULL still results in autoincrement behavior.
-
repo owner - changed milestone to blue sky
supporting old versions of sqlite is a nice to have at this point.
-
Any reason we don't accept the DEFAULT VALUES implementation with tests of course? We lose nothing by solving this problem now even if older versions are unsupported.
-
repo owner - changed status to wontfix
- changed title to support empty inserts on very old SQLite versions without DEFAULT VALUES
the fact that DEFAULT VALUES was added to SQLite indicates this was really a sqlite bug, that has been fixed. SQLA doesn't need to support working around this.
- Log in to comment
patch to fix empty insert on sqlite