# README
Database as a Service
Installation
To install the package, run:
# with go
go install github.com/go-zoox/database-as-a-service/cmd/daas@latest
if you dont have go installed, you can use the install script (zmicro package manager):
curl -o- https://raw.githubusercontent.com/zcorky/zmicro/master/install | bash
zmicro package install daas
Features
- Engine
- MySQL
- PostgreSQL
- SQLite3
- SQL Server
- Oracle
- MongoDB
- Redis
Quick Start
Start DaaS Server
database-as-a-service server
Connect DaaS with Client
database-as-a-service client --server http://127.0.0.1:8838
Connect DaaS with API
# MySQL / PostgreSQL:
curl --location 'http://127.0.0.1:9998' \
--header 'Content-Type: application/json' \
--data-raw '{
"engine": "postgres",
"dsn": "postgres://user:[email protected]:5432/daas?sslmode=disable",
"statement": "select name as label, id as value from my_table limit 1000"
}'
# Sqlite3:
curl --location 'http://127.0.0.1:9998' \
--header 'Content-Type: application/json' \
--data '{
"engine": "sqlite3",
"dsn": "https://sqliteviewer.app/Chinook_Sqlite.sqlite",
"statement": "SELECT * FROM Album"
}'
Usage
Server
database-as-a-service server --help
NAME:
daas server - database as a service server
USAGE:
daas server [command options] [arguments...]
OPTIONS:
--port value, -p value server port (default: 8080) [$PORT]
--path value api path
--username value Username for Basic Auth [$USERNAME]
--password value Password for Basic Auth [$PASSWORD]
--help, -h show help
Client
database-as-a-service client --help
NAME:
daas client - database as a service client
USAGE:
daas client [command options] [arguments...]
OPTIONS:
--server value, -s value server url [$SERVER]
--engine value database engine, e.g. mysql, postgres, sqlite3 [$ENGINE]
--dsn value database dsn [$DSN]
--statement value database statement [$STATEMENT]
--username value Username for Basic Auth [$USERNAME]
--password value Password for Basic Auth [$PASSWORD]
--help, -h show help
License
GoZoox is released under the MIT License.