json-to-sqlite
Convert a JSON file to an SQLite database right from VSCode!
Install in VSCode.

Quick Start
- Open your VSCode project.
- Right-click a JSON file such as
example.json
.
- Select the context menu Convert JSON to SQLite.
- A new file
example.sqlite
will be saved in the same directory. The database table name is the same as the filename example.
To preview an SQLite file contents:
- Right-click a SQLite file such as
example.sqlite
.
- Select the context menu Preview SQLite File.
- A message will display showing the top 3 records in the database.
Settings
To change the name of the table saved in the sqlite file, use the following steps.
- In VSCode, select File->Preferences->Settings.
- Search for json-to-sqlite.
- Enter a value for Custom Table Name.
- Uncheck the option Use Filename As Table Name.
Features
- Convert any JSON file to SQLite.
- Right-click a JSON file or use the command pallete Ctrl-Shift-P->Convert JSON to SQLite and choose a file.
- Preview SQLite file contents.
- Customize the table name stored in sqlite.
The following JSON file formats are supported for conversion to SQLite:
This results in a single table with the name of the JSON file or as configured in settings.
[
{
"id": 1,
"first_name": "Loella",
"last_name": "Albers",
},
{
"id": 2,
"first_name": "Laurie",
"last_name": "Strongman"
}
]
This results in a single table with the name "locations".
{
"locations": [
{
"id": 0,
"name": "Acme Fresh Start Housing",
"city": "Chicago",
"state": "IL",
},
{
"id": 1,
"name": "A113 Transitional Housing",
"city": "Santa Monica",
"state": "CA"
}
]
}
This results in two tables with the names "table1" and "table2".
[
{
"table1": [
{
"id": 0,
"name": "Acme Fresh Start Housing",
"city": "Chicago",
"state": "IL",
},
{
"id": 1,
"name": "A113 Transitional Housing",
"city": "Santa Monica",
"state": "CA",
}
]
},
{
"table2": [
{
"id": 0,
"name": "Acme Fresh Start Housing",
"city": "Chicago",
"state": "IL",
},
{
"id": 1,
"name": "A113 Transitional Housing",
"city": "Santa Monica",
"state": "CA",
}
]
}
]
License
MIT
Author
Kory Becker http://www.primaryobjects.com/kory-becker