Perfect + SQLiteStORM,如何多次插入

时间:2017-03-21 00:35:02

标签: swift sqlite perfect

我使用perfect SQLite驱动程序和StORM作为连接器。我可以逐个保存(创建)多行。为了加快速度,我想一次创建多行,我该怎么做?

1 个答案:

答案 0 :(得分:0)

根据完美SQLite-StORMPerfect-SQLite的源代码判断 - 目前似乎没有处理多行插入语句的逻辑。抛出这样的原始语句似乎是目前perfect的唯一方法。

INSERT INTO notifications (id, text, date, isRead)
VALUES
('7888968F-7817-4386-BAD3-20094A10A0EF', 'this is notification 1', 10000, "true"),
('C161335B-865D-42F8-9468-5942F4579AE5', 'this is notification 2', 20000, "true"),
('527F425A-618A-4C92-9B12-96B781F54819', 'this is notification 3', 30000, "false"),
('76AC88BA-304B-45D4-853B-DE482B1D1916', 'this is notification 4', 40000, "true"),