Closed aleclarson closed 2 years ago
No, the db-lock files are only used for (runtime) locks, and don't contain any "real" data, so you can freely omit/delete them and treat them as optional.
Also of note, and this might not be relevant or you may already be aware of this, but it is considered unsafe to copy (or commit) a database file while you are actively writing to it (the copy can end up with out of sync pages that are corrupt), and lmdb-js has a backup
method for copying a database file while it is in use.
And more potentially irrelevant information, but just in case: lmdb databases are not 100% portable, the format does use the architecture's native "word" format, so I believe the format is dependent on little endian vs big endian and 32-bit vs 64-bit. Of course, anything but 64-bit LE is quite rare these days, so practically it is pretty portable, but just how rare depends on your application, I suppose. Also, lmdbx-js does feature a platform-independent format (but I would stick with lmdb-js unless you really need that).
Thanks!
If I'm keeping my database in a git repo, should I commit the db-lock or is that wholly optional?