You can check out the installation details on the DB4S website here. You can download the latest versions for both Windows and macOS. It’s also available for Linux based distributions.
If you have Homebrew on macOS, you can also install the latest release with this line:
brew cask install db-browser-for-sqlite
Once you’ve gotten DB4S installed on your machine, open the application and you’re ready to begin!
When you open DB4S, on the top left you see a button labeled “New Database”. Click on it, type out a name for your database, and hit “Save” to your desired folder.
That’s it! You’ve created your first SQL database. You should now see this:
Now let’s create our first table. To do so, we’re going to import a CSV file with metadata for pieces featured on Medium’s popular page. I got the data in an earlier Python project that you can check out here.
The CSV looks like this:
To create a table with this file, on DB4S, you do:
File > Import > Table from CSV file...
After that, select your desired CSV file and hit “Open”.
This will prompt another window for a couple of customization options. Change the name to something that’s easy to remember. If the column headers are already in the first line of your CSV file, tick the box to make sure DB4S recognizes that. It will shift the first row to become the column names. Then hit “Ok”.
And boom! You’ve created your first table.
Exporting the database file to CSV is just as easy. All you have to do is right-click on the table and click “Export as CSV file”.
Or to bulk export more than one table, do this:
File > Export > Table(s) as CSV file...
Now let’s take a look at our table on DB4S. Right-click the table and select “Browse Table”.
You will now see the table in a classic spreadsheet-like format.
If you want to add a new row, just click “New Record”, and DB4S will create a new row (already with a primary key) for you to fill in with values, just like you would on Excel. In this case, we may want to do so every time a new piece is added to Medium’s popular page. DB4S will even suggest a row value based on the first letters you type in if the value already exists in the database.
To delete a row, you just need to select a row (click on a primary key on the leftmost column) and then click “Delete Record”.
Once you’re done with all your changes, click “Write Changes” to save all your modifications and update the table in your database.