Skip to content

Using Bolt Inspector

John Green edited this page Mar 1, 2017 · 2 revisions

Using Bolt Inspector

First, if you don't have Bolt Inspector yet, you can see how to get it from here.

Once you have BoltInspector downloaded and running, it is fairly intuitive to use. If you've ever used a command line before, you'll have no trouble using Bolt Inspector.

Choosing the Database

The first thing you'll see when you launch Bolt Inspector is a prompt for the database:

Database to Read (or exit):

All you need to do is put the path to your BoltDB file. Parsing the path is handled by your OS, so any valid file path (absolute or relative) should work. For example, on Windows, you can put:

Database to Read (or exit): C:\Users\[yourUserFolder]\example.db

or on Linux/Mac:

Database to Read (or exit): /home/[yourUserFolder]/example.db

Note: I do not have a Linux or Mac device handy to test this for certain. However, it should theoretically work. Post an issue thread if you have a problem here.

Finally, relative paths are also accepted. For example, if the database is in the same folder as the Bolt Inspector executable, you could simply put this:

Database to Read (or exit): example.db

Reading the Database (IMPORTANT)

When you enter a filepath into BoltInspector, it uses a simple function exists(path string) (from Functions_Universal) to check if the file exists. This function literally only tests if the file exists, not whether it is a database file or not.

If the file given exists, Bolt Inspector passes that file to BoltDB, which tries to open the file. If the file cannot be read at all, the program will give an error message and terminate.

However, if the file exists and can be read, but is not a BoltDB file, BoltDB tends to overwrite the given file with a blank BoltDB database. I haven't tested it to see when/if it ever doesn't to overwrite the given file, so make sure whatever file you point it to is the right file.

Note: A helpful quirk of this is that you can use it to make databases, which isn't currently a function of Bolt Inspector. You can create an empty file and point BoltInspector at it. Since the file does exist, it will pass to BoltDB, which will create a new database over the file.

Commands

Once Bolt Inspector is reading a database, you will see a simple prompt

[example.db] (~/) $>

This tells you the name of the database you're currently accessing in the first brackets (example.db), and your current location in that database in parentheses next to it (~/). The tilde symbol (~) is used to signify the root of the database.

There are 12 commands built in to Bolt Inspector as of the latest version (February 28, 2017). They are as follows:

For more information on how each of these works, you can visit the commands page.

Important Information

Some of the commands have limitations as a result of how BoltDB works. If you experience any odd behaviour while using a command, please check the commands page before posting an issue thread.

Obviously, BoltInspector isn't perfect. If you come across any issues, please post an issue thread so I can fix it.

Bolt Inspector is still being developed in my free time. As such, expect things to change. I don't generally push code that isn't working at the time of pushing, but mistakes happen. Unfortunately, GitHub doesn't have a versioning system for Go projects, so I can't easily label each new stable release. I'll try and figure something out for that.