LevelDataStudio » Use cases » Create a LevelDB database
Download LevelDataStudio Free Trial » Buy LevelDataStudio Now »
The situation
There is no database yet. A library is being tested against LevelDB, an application needs a populated store before it will start, or a development environment should look like production without containing production data.
Creating the store usually means writing a small program that opens a path with the LevelDB API and writes a few keys - which is a fine thing to do once and an annoying thing to do on every machine that needs it.
What you do
- Choose create and point the tool at a folder. If the folder is not a database yet, an empty LevelDB is created there.
- Add the entries the store needs - a key at a time from the editor, or many at once by importing a JSON, CSV or XML file.
- Check the result in the tree view, then close the tool so the application can take the lock and open the store.

For a team, the useful artefact is the file rather than the store: keep the seed data as CSV or JSON in the repository, and each machine creates its own LevelDB from it in one import. That also keeps the seed data reviewable, which a binary store never is.
What it will not do
- It does not configure LevelDB's options. Block size, compression, bloom filters and the rest are set by the application that opens the store. This creates a default database, and refuses to overwrite one that already exists in the folder.
- It does not design keys for you. Key ordering, prefixes and naming are the application's contract with its data, and they are yours to decide.
- It does not make the store portable across versions. The format is LevelDB's, and very old or very new versions of the library have their own expectations - the tool supports 1.18 through 1.23 and older legacy formats, but the application still has the last word.
- It will not open a database that is already locked by a running application, whether creating a neighbour or adding data.
Related
The mode itself: open / create LevelDB. Filling it in bulk: load keys from files, or a key at a time: edit a key. Reading it back: look inside the database, export the keys.