How to see a SQLite database content with Visual Studio Code
Solution 1
I published an extension to query and explore sqlite3 databases
Solution 2
- Just install the sqlite extension in your visual studio code: VSCode-SQLite
- Then you can right-click on the database file and click "Open Database". SQLite database in visual studio code
- Expand the database. expanded sqlite database in vscode
- Click the play button in front of each table to view table contents. SQLite table in visual studio code
Solution 3
For anyone that is still confused..
Follow the first 3 steps in Puya's answer, and at the very bottom of the Explorer panel there should be a tab called: > SQLITE EXPLORER
(mine was minimised, even after clicking 'Open Database' - making it hard to notice)
In here, you should be able to see the contents of your database file. You can then right click a table and 'Show Table':
Solution 4
Obviously, there is not yet a corresponding extension for vscode. Me, if necessary, I use "SQLite-Database-Browser". Very simple and sufficient for my purposes.
If you want to give it a try: SQLite-Database-Browser
By the way, using Django with another database, such as PostgreSQL
or MySQL
, is not too difficult.
DEADBEEF
DSP & Software engineer, signal/audio processing lover with a French accent who codes faster than Einstein!
Updated on July 09, 2022Comments
-
DEADBEEF almost 2 years
I'm new to
Django
and try to see aSQLite3
file. I'm looking for a way to open and view a database content withvisual studio code
like Pycharm can do (see picture)Does an extension could do that? Is it possible to achieve this in VSC?
-
DEADBEEF about 6 yearsThanks for sharing "SQLite-Database-Browser". I use it too and it's very convenient and useful. But I was looking for something embedded inside vsc. Anyway I will wait for it. It could happen soon maybe.
-
Diego over 4 yearsI downloaded your extension, but nothing seems to happen when I try to open the database. I am new to this and created a toy database with db browser, but I haven't been able to create a "connection profile" as required by visual studio code. Could this be the problem as to why I am not able to run your extension?
-
MJimitater about 4 yearsThanks for your Extension @Alex Covizzi ! I installed it, but if I open a very simple SQLite database, it just says
The file is not displayed in the editor because it is either binary or uses an unsupported text encoding. Do you want to open it anyway?
. This is weird, I used to open sqlite3 db quite easily within vsc with an older version of vsc, even without any extension. But since I reinstalled, its somehow not allowing me to open databases, with or without extension. Do you have an idea? -
Alex Covizzi about 4 years@MJimitater You probably already figured it out, but to open the database you need to Right Click > Open Database.
-
MJimitater about 4 years@AlexCovizzi thank you. Well, if I do that, then I run into the message I wrote above.. really don't know how to open the database
-
Bruce almost 4 yearsOn my version the play button is to the right of each table and can be seen only if the table is highlighted/selected or hovered over. Otherwise good summary, as it was not obvious how to use this.
-
gunardilin about 3 years@Puya Fazlali thank you, your screenshots are helpful.
-
wildernessfamily about 3 yearsThanks for that explanation! I was looking all over for it. Right in front of my face but it's so far down in the explorer it's hard to see. I almost removed it. From reading reviews others are having a problem finding it. Look to the far left of your VSCose at the bottom. Just to the right of the gear icon.
-
MZB almost 3 yearsAnd if you accidentally hide the view (like me), scroll down the View / Open View... menu dialog until you find SQLite Explorer view...
-
Benyamin Jafari - aGn about 2 yearsI also needed this installation:
sudo apt install sqlite