1.0.1 • Published 6 years ago

sqlite-conn v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

sqlite-conn

Connect to sqlite3 database and save select queries to JSON format.

Installation

sqlite-conn requires sqlite3 to run.

Install the dependencies and devDependencies and start the server.

$ npm install -sqlite-conn

Example

For production environments... database is exampl from sqlite3 page.

const sqlite3 = require('sqlite3').verbose();
const fs = require('fs');
const dr = require('sqlite-conn');

//file .json to save the result of the sql query
const file = "OneValue.json";

//database file
const mdb = '../../baza/chinook.db';

//sql queries
var sql = 'SELECT distinct FirstName,LastName,InvoiceDate,Total,invoiceId,CustomerId FROM InvoicesTrackCustomerVw WHERE CustomerId = 25';

dr.saveDataToJson(mdb,sql,file);
the end
1.0.1

6 years ago

1.0.0

6 years ago