Skip to content

Add sqlcipher #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 22, 2025
Merged

Add sqlcipher #202

merged 15 commits into from
Apr 22, 2025

Conversation

TreatTrick
Copy link
Contributor

将sqlit3.c文件替换为支持sqlcipher的版本
1、通过cmake中ENABLE_SQLITE3_CODEC配合ENABLE_SQLITE3启用sqlcipher。
2、如果不使用ENABLE_SQLITE3_CODEC,根据条件编译和原来的sqlite3版本没有区别。

@qicosmos
Copy link
Owner

看起来不错。iguana里有个文件做了修改是什么原因呢?即使要改,iguana是第三方库不要在ormpp里去改,在iguana项目里改。

@qicosmos
Copy link
Owner

还有个问题,能不能尽量兼容以前的sqlite 版本呢,默认兼容老版本,只有开启了ENABLE_SQLITE3_CODEC 才使用支持sqlcipher版本的sqlite,这样就能实现一个好的向前兼容性了。

@TreatTrick
Copy link
Contributor Author

1、iguana里的修改是我发现本地的 macOS 上用 Clang 编译项目的时候 Clang 的检查机制比较严格,如果不写出尖括号会编译不通过。但其实CI 流程中并没有什么问题。我已经回退了这个修改。

2、根据 sqlcipher 官方的回答

SQLCipher can open/create/modify plain text SQLite databases, so this is likely unnecessary, however it is possible, in essence, largely by not including codec support during your ./configure step.

就是说不开启 codec 的时候就是普通的 sqlite3。然后我的代码里面也用了条件编译和条件预定义宏,只要不开启ENABLE_SQLITE3_CODEC 应该就是完全兼容旧版 sqlite3 的。

3、clang-format 的 CI 过不了好像是因为 sqlite3.c 文件被换成了支持 sqcipher 的版本,文件太大 clang-format 检测这个文件的时候超时还是超资源了。暂时还没找到解决办法

@qicosmos qicosmos merged commit 2a36ed8 into qicosmos:master Apr 22, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants