Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't open SQLite db file in VSCode

Although I have installed SQLite extension on my VSCode, I can't open any db files. The app 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?' I updated SQLite extension, reinstalled it and even reinstalled VSCode but nothing changed. I opened the file with SqliteStudio, there is no problem with the file. What's wrong with the app?

like image 739
narcissus313 Avatar asked Mar 24 '26 17:03

narcissus313


2 Answers

When you are using a linux distro (or WSL) you will have to install SQLite before you can use the Visual Studio Code extension. On a debian based OS you can use:

sudo apt install sqlite3

I had to restart Visual Studio Code before it worked.

like image 167
Rubanov Avatar answered Mar 26 '26 07:03

Rubanov


I had the same problem. After you install SQLite extension, in order to open your database in VS you have to press CRTL+SHIFT+P, write "SQLite", select "SQLite: Open Database", and then you choose the database you want to open (ex: "./db/mydb.sqlite"). Finally, you click there to see your database.enter image description here

like image 41
Diomedes97 Avatar answered Mar 26 '26 07:03

Diomedes97