sqlite3: insert multiple values

378 views
Skip to first unread message

Edward Ruggeri

unread,
Jan 20, 2012, 4:37:05 PM1/20/12
to Korma
sqlite doesn't allow multiple values to be inserted in the usual way:
(http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-
multiple-rows-at-a-time-in-an-sqlite-database).

Korma generates the usual SQL, with predictable results when trying to
insert multiple values to a sqlite db: SQLException. It might be nice
if Korma noticed sqlite and generated something it could handle.

In the meantime, I decided to use postgres.

-- Ned Ruggeri

Edward Ruggeri

unread,
Jan 20, 2012, 6:34:52 PM1/20/12
to Korma
I wrote a patch to handle this. Not the prettiest, but seems to work.

-- Ned Ruggeri

Edward Ruggeri

unread,
Jan 26, 2012, 1:22:09 PM1/26/12
to Korma
Let me know what I can do to possibly merge this upstream.

-- Ned Ruggeri

Chris Granger

unread,
Jan 26, 2012, 2:05:14 PM1/26/12
to sqlk...@googlegroups.com
Hey Ned,

It's currently a non-goal to abstract away all the differences between SQL implementations in Korma. To do so would require a great deal of thought to prevent thousands of little changes like this from stacking up into the monstrosity that a lot of database layers end up being :) At its core would be something robust enough to compile queries where certain parts might be swapped out based on db types.

If you wanted, you could start trying to establish a base that would enable such a system to be built. korma.incubator would be a good place to try it out: https://github.com/ibdknox/korma.incubator

Cheers,
Chris.

Edward Ruggeri

unread,
Jan 27, 2012, 9:42:15 PM1/27/12
to Korma
Thanks, Chris; makes sense. Korma's been working out great for me;
thanks so much for your work.

-- Ned Ruggeri

On Jan 26, 11:05 am, Chris Granger <ibdk...@gmail.com> wrote:
> Hey Ned,
>
> It's currently a non-goal to abstract away all the differences between SQL
> implementations in Korma. To do so would require a great deal of thought to
> prevent thousands of little changes like this from stacking up into the
> monstrosity that a lot of database layers end up being :) At its core would
> be something robust enough to compile queries where certain parts might be
> swapped out based on db types.
>
> If you wanted, you could start trying to establish a base that would enable
> such a system to be built. korma.incubator would be a good place to try it
> out:https://github.com/ibdknox/korma.incubator
>
> Cheers,
> Chris.
>
Reply all
Reply to author
Forward
0 new messages