![]() ![]() It will give us a SQLite prompt like the below: ![]() After that, we created the database with the sqlite3 command. ![]() For this, we will first create a SQLite database with: mkdir nodejs-sqliteįirst, we create a folder called nodejs-sqlite then went into it. We will build a Quotes API with SQLite as our database of choice. There can be many other usages for this demo we will build a simple Quotes API. SQLite can even be leveraged as temporary storage to unblock the user to perform an action offline which can later be synced with another API/database when the device is back online. Another use-case can be if we are building an Electron app and need a database to support any actions offline. Usually, an object-relational mapper (ORM) is utilized to do this kind of seamless database swap. Some people even run integration or end-to-end tests on SQLite where the main database of the application is a client server-based database. If SQLite is not really a client-server architecture relational database would there be any use-case for using Node.js with it? Yes, there are many, for instance, if we create an offline-first application that needs a relational database the only choice would be SQLite. It was developed to work offline in a battleship. It works as a stand-alone file but still packs the punch with a long list of features. Unlike other relational databases that have a server where clients connect to like MySQL or PostgreSQL, SQLite is a self-contained database. There is no doubt that SQLite is the most deployed and used database, every mobile phone has it, every Mac and windows 10 machine has in addition to countless millions of other applications. In the next stop of this Node.js SQLite tutorial, we will set up the database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |