Firebase for SQL
- Create a free instance of this app on Heroku by clicking this button:
- When it's done deploying, click View App button and record the URL of your heroku app. It'll be something like "https://calm-plateau-12345.herokuapp.com".
- Follow the usage guide on connecting browser and node clients to start reading and writing SQL!
const dbUrl = "https://<APP_NAME>.herokuapp.com"
sqlaas("select * from employees;", dbUrl)
.then(queryResults => console.log("query results", queryResults))
.catch(error => console.error(error))
// expect 3 rows with columns id title name salary start_date
You can also write SQL directly in your browser URL bar:
https://<APP_NAME>.herokuapp.com/?
sql=select * from employees;
npm install --save sqlaas
const sqlaas = require("sqlaas")
<script src="../src/client.js"></script>
<!-- available as window.sqlaas -->
To run your own SQL-as-a-service, clone down this repo and run
npm install
npm start
You'll need postgres running.
npm start
will tell you what to do if anything is missing.
It will also create an example "employees" database if none exists.
- Heroku doesn't allow programmatic database creation, so this has to be per-user.
- No migrations, backups, or sharding; NOT FOR PRODUCTION! Very insecure!