Node :: Deleting Data in SQLite Database from a Node.js Application

Summary: in this tutorial, you will learn how to delete data in the SQLite database from a Node.js application. To delete data in the SQLite database from a Node.js application, you use the following steps: Open a database connection. Execute a DELETE statement. Close the database connection. For the demonstration, we will use the langs table in the sample.db database that we created in the previous tutorial. Deleting data example To delete data from a table, you use the DELETE statement as follows:...

July 25, 2021 · 2 min · bynaki

Node :: Updating Data in SQLite Database from a Node.js Application

Summary: this tutorial shows you how to update data in the SQLite database from a Node.js application. To update data in the SQLite database from a Node.js application, you use these steps: Open a database connection. Execute an UPDATE statement. Close the database connection. For the demonstration, we will use the langs table in the sample.db database that we created in the previous tutorial. Updating data example To update data in a table, you use the UPDATE statement as follows:...

July 25, 2021 · 2 min · bynaki

Node :: Inserting Data Into an SQLite Table from a Node.js Application

Summary: in this tutorial, you will learn how to insert one or more row into an SQLite table from a Node.js application. To insert data into an SQLite table from a Node.js application, you follow these steps: Open a database connection. Execute an INSERT statement. Close the database connection. For the demonstration, we will create a new database named sample.db in the db folder. When you open a database connection in the default mode, the database is created if it does not exist....

July 25, 2021 · 3 min · bynaki

Node :: Controlling the Execution Flow of Statements

Summary: in this tutorial, you will learn how to control the execution flow of statements. The sqlite3 module provides you with two methods for controlling the execution flow of statements. The serialize() method allows you to execute statements in serialized mode, while the parallelize() method executes the statements in parallel. Let’s look into each method in detail to understand how it works. Executing statement in serialized mode with Database.serialize The serialize() method puts the execution mode into serialized mode....

July 24, 2021 · 3 min · bynaki

Node :: Querying Data in SQLite Database from Node.js Applications

Summary: in this tutorial, you will learn how to query data from the SQLite database from a Node.js application using sqlite3 API. To query data in SQLite database from a Node.js application, you use these steps: Open a database connection. Execute a SELECT statement and process the result set. Close the database connection. The sqlite3 module provides you with some methods for querying data such as all(), each() and get()....

July 23, 2021 · 4 min · bynaki