Making SQLite Easy with Codesphere!

Working with SQLite just got a whole lot easier! Codesphere is happy to announce a new UI for creating and managing your SQLite databases!

Let’s talk about how!

Setting Up Your Database

To create a new database file, navigate to the inf…


This content originally appeared on DEV Community and was authored by Saji Wang

Working with SQLite just got a whole lot easier! Codesphere is happy to announce a new UI for creating and managing your SQLite databases!

Let's talk about how!

Setting Up Your Database

To create a new database file, navigate to the infrastructure tab in Codesphere's IDE and select SQLite.

Alt Text

You can then create and name a new database, and Codesphere will automatically create the DB file for your database:

Alt Text

We'll name our database user_info, and then click on it to enter the SQL Query Editor Tab

Alt Text

The Query Editor Tab will allow you to easily run SQL queries to make ad-hoc insertions and deletions, view data, and set up and organize tables.

Making Queries in the Codesphere UI

To start off, we can create a table with:

CREATE TABLE user_info (
 name varchar(255),
 age int,
 active boolean
)

Alt Text

To populate that table with a row:

INSERT INTO user_info
VALUES ('John Doe', 25, true);

Alt Text

And then we can grab those values with:

SELECT * FROM user_info

Making Queries from NodeJS

You'll notice that the .db file is in your file tree.

In NodeJS, you can access this database by installing sqlite3

npm install sqlite3

And running the following code

So what project are you going to use SQLite for?
Let us know down below!

Happy Coding from your friends at Codesphere.


This content originally appeared on DEV Community and was authored by Saji Wang


Print Share Comment Cite Upload Translate Updates
APA

Saji Wang | Sciencx (2021-09-24T12:27:32+00:00) Making SQLite Easy with Codesphere!. Retrieved from https://www.scien.cx/2021/09/24/making-sqlite-easy-with-codesphere/

MLA
" » Making SQLite Easy with Codesphere!." Saji Wang | Sciencx - Friday September 24, 2021, https://www.scien.cx/2021/09/24/making-sqlite-easy-with-codesphere/
HARVARD
Saji Wang | Sciencx Friday September 24, 2021 » Making SQLite Easy with Codesphere!., viewed ,<https://www.scien.cx/2021/09/24/making-sqlite-easy-with-codesphere/>
VANCOUVER
Saji Wang | Sciencx - » Making SQLite Easy with Codesphere!. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/24/making-sqlite-easy-with-codesphere/
CHICAGO
" » Making SQLite Easy with Codesphere!." Saji Wang | Sciencx - Accessed . https://www.scien.cx/2021/09/24/making-sqlite-easy-with-codesphere/
IEEE
" » Making SQLite Easy with Codesphere!." Saji Wang | Sciencx [Online]. Available: https://www.scien.cx/2021/09/24/making-sqlite-easy-with-codesphere/. [Accessed: ]
rf:citation
» Making SQLite Easy with Codesphere! | Saji Wang | Sciencx | https://www.scien.cx/2021/09/24/making-sqlite-easy-with-codesphere/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.