
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
database-js-firebase
Advanced tools
Database-js interface for Firebase
Database-js-firebase is a database-js wrapper around the Firebase database library. It creates a Promises around an SQL to Firebase (NoSQL) interpreter. It significantly restricts the structure Firebase as well as the access to Firebase. Right now access is limited to email and password. Data must be stored using Firebase's ref.push. SQL commands are limited to SELECT, UPDATE, INSERT and DELETE. WHERE works well. JOINs are not allowed. ORDER BY is in progress. While a SELECT command can return a JSON object for a given field, JSON values cannot be UPDATEd or INSERTed, or be part of a WHERE clause. You probably should not use this, it was built as an experiment.
If your Firebase data is structured as:
"$uid": {
"users": {
"firebase-autogenerated-key": {
"username": "dduck",
"fullname": "Donald Duck",
...
},
"firebase-autogenerated-key": {
"username": "mmouse",
"fullname": "Mickey Mouse",
...
},
...
}
}
Then your access will be like:
var Database = require('database-js');
(async () => {
let connection, statement, rows;
connection = new Database('database-js-firebase://[my_email]:[my_password]@[project_id]/[root_node_path]?apiKey=[API KEY]');
try {
statement = await connection.prepareStatement("SELECT * FROM users WHERE username = ?");
rows = await statement.query('dduck');
console.log(rows);
} catch (error) {
console.log(error);
} finally {
await connection.close();
}
})();
FAQs
Database-js interface for Firebase
We found that database-js-firebase demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.