Concepts in Focus
- Application Programming Interface (API)
- Database
- SQLite
- SQLite CLI
- SQLite Methods
- Open
- Executing SQL Queries
- SQL Third-party packages
- Connecting SQLite Database from Node JS to get the books from Goodreads Website
- SQLite Database Initialization
- Goodreads Get Books API
1. Application Programming Interface (API)
An API is a software intermediary that allows two applications to talk to each other.
For example, OLA, and UBER use Google Maps API to provide their services.
All the Network calls that we added are also the APIs.
2. Database
Express apps can use any database supported by Node JS.
There are many popular options, including SQLite, PostgreSQL, MySQL, Redis, and MongoDB.
3. SQLite
The SQLite provides a command-line tool sqlite3.
It allows the user to enter and execute SQL statements against an SQLite database.
3.1 SQLite CLI
3.1.1 Listing Existing Tables
The
3.1.2 Selecting Table Data
Syntax:
4. SQLite Methods
4.1 Open
The SQLite
Syntax:
It returns a promise object. On resolving the promise object, we will get the database connection object.
4.2 Executing SQL Queries
SQLite package provides multiple methods to execute SQL queries on a database.
Some of them are:
- all()
- get()
- run()
- exec(), etc.
4.2.1 all()
The
5. SQL Third-party packages
We can use
Installation Commands
6. Connecting SQLite Database from Node JS to get the books from Goodreads Website
- Install the SQL third-party packages sqliteandsqlite3.
- Initialize the SQLite Database