来自swift的sqlite连接

时间:2014-09-15 08:39:38

标签: swift sqlite

我的这个库sqlite有问题:https://github.com/ryanfowler/SwiftData

我已使用此代码插入表值:

    let name: String = "test" //user input
    let population: String = "test"//user input 

    if let err = SD.executeChange("INSERT INTO Users (Name, Surname) VALUES (?, ?)", withArgs: [name, population]) {
        //there was an error during the insert, handle it here
    } else {
        //no error, the row was inserted successfully
    }

但是我收到了这个错误:

  

准备期间出错 - > SQLITE代码:1 - SQL错误或缺少数据库

1 个答案:

答案 0 :(得分:0)

最近更新了库SwiftData以打印更详细的错误消息。这是否为您提供了有关错误的更多信息?