我试过在不同操作系统和体系结构之间通过网络传递二进制 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/