quick.db
  • 🎉Introduction
  • Overview
    • 📝Changelog
    • 💻Migration Guide
    • 📚Documentation
    • 📈More Information
    • Quick.db 9.0.0 pre-release upgrade to NPM
Powered by GitBook
On this page
  • Additional Database Options
  • SQLite
  • MySQL
  • Added functions
  • The use of async/await
  1. Overview

Changelog

This page provides a general summary of what has been changed in the 9.0.0 release of quick.db

PreviousIntroductionNextMigration Guide

Last updated 3 years ago

Additional Database Options

There are two new options you can utilize when initializing your database. The first available option is the driver. Currently, you can either use SQLite (default) or MySQL. The second new option is filePath, which allows you to specify the file you would like to manipulate (default: json.sqlite)

SQLite

// SQLite (default) w/ filePath (optional)
const { QuickDB } = require('quick.db');
const db = new QuickDB({ filePath: 'source/to/path/test.sqlite' });

MySQL

// MySQL
const { QuickDB, MySQLDriver } = require('quick.db');
(async () => {
    const mysql = new MySQLDriver({
        host:     'localhost',
        user:     'me',
        password: 'secret',
        database: 'my_db'
    });
    
    await mysql.connect();
    // It is important to connect MySQL
    
    const db = new QuickDB({ driver: mysql });
})();

Added functions

  • pull - Remove an element from an array (Reverse of push)

  • sub - The subtract function has been renamed to sub

  • deleteAll - Delete everything in the database (or the table)

The use of async/await

Now quick.db uses async and await for all of it's methods

📝
🛠️