[RAILS] If you use SQLite with VSCode, use the extension (how to see the binary file of sqlite3)

I've been studying Ruby on Rails recently and use SQLite a lot.

I wanted to use the binary file **. sqlite3 ** that comes out there in VS Code, so I investigated how to do it.

environment

Can't open sqlite3?

It came when I was doing Chapter 6 of the Rails tutorial.

Target Rails tutorial → https://railstutorial.jp/chapters/modeling_users?version=5.1

Make a model ...

$ rails generate model User name:string email:string

After applying the migration ...

$ rails db:migrate

There was a file called db / development.sqlite3.

スクリーンショット 2020-11-04 15.10.43.png

However, this is a binary file and cannot be opened with VS Code. .. ..

Install extension SQLite

Therefore, we will introduce an extension called "SQLite".

Try installing as usual from the VScode Marketplace. スクリーンショット 2020-11-04 15.12.27.png

How to use SQLite

It's easy to use.

Open the command palette and type "sql".

(How to open the command palette) Windows:Ctrl+Shift+P Mac:Command+Shift+P

Select "SQLite: Open Database" in the search results. スクリーンショット 2020-11-04 15.17.55.png

Since it will be a file selection, select the target file (this time select db / development.sqlite3) スクリーンショット 2020-11-04 15.19.32.jpg

It looks like nothing is happening on the screen, but if you look closely at the Explorer tab, you will see an increase in the item "SQLITE EXPLORER", where each table and column is displayed. スクリーンショット 2020-11-04 15.27.13.png

Yeah, it feels like it.

If you want to see the data registered in the table, click "▶" next to each table name. スクリーンショット 2020-11-04 15.33.51.png

You could see it.

Now you can use SQLite on VS Code without opening any other tools!

Digression

Of course, even if you don't use VScode, there is a wonderful tool called DB Browser for SQLite, so you can choose which one to use.

Official site: https://sqlitebrowser.org/

Recommended Posts

If you use SQLite with VSCode, use the extension (how to see the binary file of sqlite3)
[Java] How to use the File class
Output of how to use the slice method
If you want to use Mockito with Kotlin, use mockito-kotlin
How to use git with the power of jgit in an environment without git commands
How to save a file with the specified extension under the directory specified in Java to the list
[Docker] How to see the contents of Volumes. Start a container with root privileges.
Summary of how to use the proxy set in IE when connecting with Java
Use a binary search to see if there are any values in the array
How to use trained model of tensorflow2.0 with Kotlin / Java
[Easy] How to automatically format Ruby erb file with vsCode
Uppercase only the specified range with substring. (How to use substring)
How to change the contents of the jar file without decompressing
How to check the extension and size of uploaded files
What to do if you can't use the rails command
How to change the file name with Xcode (Refactor Rename)
[Ruby] Conditional expression without if? Meaning of (question mark). How to use the ternary operator.
How to use the link_to method
How to use the include? method
How to use the form_with method
How to use the wrapper class
How to use setDefaultCloseOperation () of JFrame
How to use mssql-tools with alpine
[chown] How to change the owner of a file or directory
How to use MinIO with the same function as S3 Use docker-compose
How to get the length of an audio file in java
How to realize huge file upload with Rest Template of Spring
How to decorate the radio button of rails6 form_with (helper) with CSS
How to access Socket directly with the TCP function of Spring Integration
How to convert an array of Strings to an array of objects with the Stream API
How to find out the Java version of a compiled class file
If you want to make a zip file with Ruby, it's rubyzip.
[swift5] How to change the color of TabBar or the color of item of TabBar with code
I want you to use Enum # name () for the Key of SharedPreference
How to adjustTextPosition with iOS Keyboard Extension
How to compile Java with VsCode & Ant
How to delete the wrong migration file
[Java] How to use the hasNext function
If you dare to compare Integer with "==" ...
How to use BootStrap with Play Framework
[Rails] How to use rails console with docker
[Java] How to use the HashMap class
How to delete the migration file NO FILE
[Rails] How to use the map method
[Java] How to use the toString () method
Studying how to use the constructor (java)
[Processing × Java] How to use the loop
How to use Docker in VSCode DevContainer
How to determine the number of parallels
How to achieve file download with Feign
[Java] [Maven3] Summary of how to use Maven3
[Processing × Java] How to use the class
How to sort the List of SelectItem
[Processing × Java] How to use the function
[Java] How to use the Calendar class
How to achieve file upload with Feign
What to do if you have enabled Use the WSL2 based engine in Docker Desktop with insufficient WSL2 installation
[Rails] How to read the XML file uploaded from the screen with Hash type
If you want to satisfy the test coverage of private methods in JUnit
How to make @Transactional work that does not work if you use it incorrectly
How to get the ID of a user authenticated with Firebase in Swift