- 
                Notifications
    You must be signed in to change notification settings 
- Fork 17
Examples JSON Connection
        Thiago Delgado Pinto edited this page Feb 23, 2018 
        ·
        2 revisions
      
    The JSON file driver connects to a local JSON file. It does not support transactions.
json:///file_path
var Connection = require('database-js2').Connection;
(async () => {
    let connection, statement, rows;
    connection = new Database('json:///test.json');
    
    try {
        statement = await connection.prepareStatement("SELECT * WHERE user_name = ?");
        rows = await statement.query('not_so_secret_user');
        console.log(rows);
    } catch (error) {
        console.log(error);
    } finally {
        await connection.close();
    }
})();See more on Basic Usage
See Advanced Usage