Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mluby/sql-as-a-service
Firebase for SQL
https://github.com/mluby/sql-as-a-service
saas service sql
Last synced: about 2 months ago
JSON representation
Firebase for SQL
- Host: GitHub
- URL: https://github.com/mluby/sql-as-a-service
- Owner: mLuby
- License: mit
- Created: 2017-07-26T01:31:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-27T18:21:59.000Z (over 7 years ago)
- Last Synced: 2024-04-29T11:46:13.485Z (8 months ago)
- Topics: saas, service, sql
- Language: JavaScript
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sqlaas: SQL-as-a-service
Firebase for SQL## Quick Start
1. Create a free instance of this app on Heroku by clicking this button:
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
2. 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".
3. Follow the usage guide on connecting browser and node clients to start reading and writing SQL!## Usage
```js
const dbUrl = "https://.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://.herokuapp.com/?`sql=select * from employees;`## Installation
### Node:
```sh
npm install --save sqlaas
```
```js
const sqlaas = require("sqlaas")
```
### Browser:
```html```
## Server
To run your own SQL-as-a-service, clone down this repo and run
```sh
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.## Notes
- Heroku doesn't allow programmatic database creation, so this has to be per-user.
- No migrations, backups, or sharding; NOT FOR PRODUCTION! Very insecure!