sqlite - SQLite 是否具有 C API 可以读/写的机器可移植文件格式?

标签 sqlite portability file-format

我试过在不同操作系统和体系结构之间通过网络传递二进制 SQLite DB - 它没有用。

大家都用什么格式?我已经尝试了一种邪恶的黑客攻击,即复制 SQLite 的 shell.c 并使用破解的 argc、argv、stdin 调用 shell_main(),并在 Mac 上取得了成功。可惜我正在为 iPhone 开发,它只在那里失败了。

是不是每个人都做过这么可怕的事?

最佳答案

这是 SQLite 的核心特性之一。

Stable Cross-Platform Database File

The SQLite file format is cross-platform. A database file written on one machine can be copied to and used on a different machine with a different architecture. Big-endian or little-endian, 32-bit or 64-bit does not matter. All machines use the same file format. Furthermore, the developers have pledged to keep the file format stable and backwards compatible, so newer versions of SQLite can read and write older database files.

Most other SQL database engines require you to dump and restore the database when moving from one platform to another and often when upgrading to a newer version of the software.


http://sqlite.org/different.html
检查传递数据库的代码。进行逐字节比较以确保它们在传输后相等。这绝对应该有效。
Beyond Compare具有良好的二进制文件比较支持。

关于sqlite - SQLite 是否具有 C API 可以读/写的机器可移植文件格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2157330/

相关文章:

未创建 Android SQLite 表

android - SQLite:无法在索引 1 处绑定(bind)参数,因为索引超出范围。该语句有 0 个参数

android - 从 Inner Joins SQLite 获取单条记录

bash - 可移植的 shell 脚本有什么用?

java - 用于图片文件格式转换的开源 Java/Groovy 库?

video - 什么视频格式在不损失质量的情况下最小?

mysql - 未知的 SQL 错误

c++ - 命名空间嵌套函数的最佳实践和语义以及extern "C"的使用

c++ - Windows 与 Linux 上 std::string 的可移植性和长度

php - 哪个是用 PHP 解析 Excel 文件的最佳库?