问题标签 [sqlite.swift]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
xcode - 如何在命令行工具中使用“SQLite”(github 上的包装器)?
我在Cocoa 应用程序中成功地使用了来自https://github.com/stephencelis/SQLite.swift的优秀 Swift 包装器。
但是当我尝试在命令行工具项目中使用包装器并遵循相同的详细安装步骤时,我收到以下错误:
检查依赖项
无法运行命令 'PBXCp SQLite.framework' - 此目标可能包含其自己的产品。
我检查了依赖项,但无法弄清楚如何解决这个问题。
sqlite - 在 Swift for 循环中添加“阻塞”
我在一个项目中使用 Swift,并使用SQLite.swift进行数据库处理。我正在尝试从我的数据库中检索最新的条目,如下所示:
我正在尝试测试从上述函数返回的字符串,如下所示:
请注意我如何从函数内部和外部打印值。在内部,它每次都有效。我正在与“来自外部:”部分作斗争。
有时该函数返回正确的电子邮件,但有时它返回“”(推测该值未在 for 循环中设置)。
如何添加“阻塞”功能,以便调用 returnLatestEmailAddressFromEmailsTable() 将始终首先评估 for 循环,然后才返回值?
sqlite.swift - Int64 转换后无法识别更新方法
由于您将库更新为 Int64,我无法再编译我的代码。我不断遇到这样的更新方法问题:
我已将所有表达式从表达式更改为表达式,并且所有绑定到表达式的 Int 都是 Int64。
我得到:如果我删除更改,则找不到成员“更改”我得到:找不到成员“更新”
sqlite.swift - 如何打开使用 sqlcipher 加密的数据库
任何人都可以发布如何打开 sqlcipher 数据库的代码示例吗?我想我们需要以某种方式调用 key 函数。
xcode - Using variables in Filters in SQLite.swift
I am using SQLite.swift (Branch Swift-1-2)
in my app in XCode 6.3 beta.
I am able to create the Database/Tables and insert entries into the tables.
So far so good.
Now when I have a simple scenario as follows:
On the line commented \\ <----ERROR!!!
, I get the compile-time error:
Binary operator '==' cannot be applied to operands of type Expression< Int64 > and Int
If I use an Int
directly on that line, then that works fine. Eg.
But, if I simply do this, it fails with the same error again:
I understand what the error is, but I am not able to resolve it. I looked at the documentation but I am still stuck. So any help is appreciated.
Update:
Explicitly declaring the variable as Int64 solves the issue:
Now I am wondering if I have to change my class definition, which will require changes at multiple places in the code. Also official swift documentation recommends using Int unless an explicit size is required.
You should use the word-sized Int type to store integer values, unless you require a type with a specific size or signedness.
Also, the SQLite.swift documentation states that:
While Int64 is the basic, raw type (to preserve 64-bit integers on 32-bit platforms), Int and Bool work transparently.
So should I be using the Int64
here explicitly in my class definition, since its mapped to a DB?
ios - 无法在 SQLite 中截断和删除表
我使用 SQLite.swift 插件删除表并截断表,但它在设备中不起作用。该代码可以由模拟器执行,但不能由 ios 设备执行:
ios - 'Binding' 不能在 Swift 中使用 SQLite 转换为 UILabel
我第一次在这里遇到与 SQLite.Swift 库有关的 Swift 相关问题。
我有一个用于 db.prepare 语句的 for 循环,但是在尝试将数组值分配给 UILabel 时我被卡住了。
如何将值分配row[1]
给我的 UILabel?如果可能的话,甚至更好地使用 String 变量。
提前致谢!
免责声明:这是我第一次尝试 Swift + 第三方库
sqlite.swift - SQLite API 更改接近 Xcode 6.3 版本?
更新到 Xcode 6.3/Swift 1.2 后,我收到了这些错误。(.NoCase
找不到,.insert
也不接受(Setter, Setter)
.
SQLite swift API 有什么变化吗?
xcode - SQLite.swift 模块文件是由旧版本的编译器创建的
我只使用 xcode 大约一个月。我安装了 xcode 6 并创建了一个项目,该项目使用来自 GitHub 的 stephencelis 的 SQLite.swift 项目。一切都运行良好,我想我今天早上一定是无意中加载了 Xcode 更新。我现在使用的是 xcode 6.3 版。现在,当我打开我的项目并执行构建时,我在我的一个执行“导入 SQLite”的单元中的一行中得到了错误。错误消息显示:“模块文件是由旧版本的编译器创建的”。之前我在 SQLite 源文件中有 50 多个错误,所以我下载了 SQLite 的最新 zip 并打开了该项目并执行了一个没有错误的构建。但是现在如果我回去编译我的项目,我会得到主题中提到的错误。
我想我只是不知道如何正确使用来自 GitHub 的这些库,或者这是否特定于 SQLite。任何帮助将不胜感激。
xcode - 最新版本 SQLite.swift 的文档
今天将 Xcode 更新到 6.3 后,我终于能够完全删除 sqlite.swift 并重新安装它。在修复了由某些变化引起的大约 50 个错误之后,我只剩下大约 15 个错误,所有这些都与新的 sqlite.swift 有关。我搜索了新文档以涵盖语法更改,但无济于事。我在其他帖子中发现了一些错误并且能够修复。
所以这个曾经工作的功能现在抱怨 ? 在 delete()?... 之后,错误消息是“可选链无效,表达式已经产生 Int?”。建议删除 ?
如果我删除 ? 在 delete() 之后,它告诉我“不能在没有参数的情况下调用 'delete'”。我搜索了源代码和代码完成,所有这些都没有显示任何参数。
同样在更新语句上,我现在收到此错误:示例代码:
错误:无法使用类型为“(Setter,Setter,Setter)”的参数列表调用“update”