0
我使用從Bundle.main.path獲取的路徑不能使用db.execute函數插入更新sqlite數據庫 沒有顯示錯誤,我不明白爲什麼,請幫我 下面是我的代碼Swift 3:db.execute不能使用獲取路徑使用Bundle.main.path
var config = Configuration()
config.readonly = false
config.foreignKeysEnabled = false
enter code here
let path1:String = Bundle.main.path(forResource: "data", ofType: "sqlite",inDirectory: "Data")!
db = try DatabaseQueue(path: path1,configuration: config)
--------------
try db.execute("update detail set favorite = \(newDetail.favorite!) where id = \(newDetail.id!)")
謝謝你支持我,我是新手,你能爲我創造一個榜樣嗎? –