RunKit + npm: database-js2

node v8.17.0
version: 1.0.0
endpointsharetweet
require("database-js-firebase"); var Database = require('database-js2').Connection; (async function() { let connection, statement, rows; connection = new Database('database-js-firebase://user@example.com:password@statesdemo/ewJviY6wboTKJ57A2dZkvq8kxYo1?apiKey=AIzaSyD1ypTmnJb_d8ZOyfc-KBMe0tw8owYCwjA'); try { statement = await connection.prepareStatement("SELECT * FROM states ORDER BY Ranking"); rows = await statement.query(); console.log(rows); } catch (error) { console.log(error); } finally { await connection.close(); } })();
Created from: https://npm.runkit.com/database-js2
Loading…

2 comments

  • posted 7 years ago by mlaanderson
    Normally you don't need to "require('database-js-firebase')", but RunKit won't include it unless it's required here.
  • posted 7 years ago by mlaanderson
    ORDER BY and LIMIT are supported in the database-js-firebase v1.1.0

sign in to comment