开发者

Does SQLite have a machine portable file format that the C API can read/write?

I've tried passing binary SQLite DBs over the network between different OSes and architectures - it didn't开发者_StackOverflow社区 work.

What format are you all using? I've tried an unholy hack of copying SQLite's shell.c and calling shell_main() with a hacked up argc, argv, stdin with success on Mac. Pity I'm developing for the iPhone and it fails only there.

Does everyone do such awful things?


This is one of the core features of 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

Check the code that's passing the databases. Do a byte-by-byte comparison to make sure they're equal after transfer. This definitely should be working.

Beyond Compare has good binary file comparison support.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜