https://github.com/croc-code/sql-boot
Advanced REST-wrapper for your SQL-queries (actually not only SQL)
https://github.com/croc-code/sql-boot
code-generator db db-generator db-ide db-manager db-migration db-swiss-knife db-tool dba ddl devops java nosql rdbms schema sql sql-generation
Last synced: about 2 months ago
JSON representation
Advanced REST-wrapper for your SQL-queries (actually not only SQL)
- Host: GitHub
- URL: https://github.com/croc-code/sql-boot
- Owner: croc-code
- License: bsd-3-clause
- Created: 2016-11-21T15:05:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T22:41:03.000Z (almost 3 years ago)
- Last Synced: 2024-05-21T18:12:13.681Z (11 months ago)
- Topics: code-generator, db, db-generator, db-ide, db-manager, db-migration, db-swiss-knife, db-tool, dba, ddl, devops, java, nosql, rdbms, schema, sql, sql-generation
- Language: Kotlin
- Homepage:
- Size: 2.99 MB
- Stars: 59
- Watchers: 4
- Forks: 4
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - croc-code/sql-boot - Advanced REST-wrapper for your SQL-queries (actually not only SQL) (Kotlin)
README
[](https://travis-ci.org/crocinc/sql-boot)
[](https://ci.appveyor.com/project/mgramin/sql-boot)
[](https://codecov.io/gh/CrocInc/sql-boot)
[](https://github.com/sql-boot/sql-boot/blob/master/LICENSE)
[](https://codebeat.co/projects/github-com-mgramin-sql-boot-master)
[](https://www.codacy.com/manual/mgramin/sql-boot?utm_source=github.com&utm_medium=referral&utm_content=CrocInc/sql-boot&utm_campaign=Badge_Grade)
[](https://hub.docker.com/r/mgramin/sql-boot/)
[](https://github.com/sql-boot/sql-boot/releases/latest)
[](https://gitter.im/sqlboot/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://www.elegantobjects.org/)
[](http://www.rultor.com/p/CrocInc/sql-boot)
[](https://hitsofcode.com/view/github/CrocInc/sql-boot)
[](https://github.com/CrocInc/sql-boot/)
[](https://github.com/mgramin/awesome-db-tools)# Treat your database as Code
There are many awesome REST-wrappers for your Databases (e.g. [PostgREST](https://github.com/PostgREST/postgrest), [pREST](https://github.com/prest/prest), [sandman2](https://github.com/jeffknupp/sandman2) and many others), but how about REST-wrapper for your own SQL-queries?
The `sql-boot` tool is a REST-like wrapper for your own SQL-queries.
No ETLs, no generated SQL, no "automagic" - sql-boot simply transform your own SQL-query to Web resources.`sql-boot` recursively finds every *.sql files in your folders and start REST-like service and runs scripts against live databases in response to http requests.
Example
-------
Save you SQL-query to `big_cities.sql`:
````sql
select a.airport_code as code
, a.airport_name
, a.city
, a.coordinates
, a.timezone
from bookings.airports a
where a.city in (select aa.city
from bookings.airports aa
group by aa.city
having count(*) > 1)
order by
a.city
, a.airport_code
````Now `sql-boot` is ready to receive http requests (without restarting and other actions).
[Execute](http://81.23.10.106:8008/api/master_db/big_cities.sql) query on "master_db" database:
````bash
master_db/big_cities.sql
````[Execute](http://81.23.10.106:8008/api/.*/big_cities.sql) query against all registered databases:
````bash
.*/big_cities.sql
````[Execute](http://81.23.10.106:8008/api/.*/big_cities.sql?select=code,endpoint) query against all registered databases with specified columns:
````bash
.*/big_cities.sql?select=code,endpoint
````[Execute](http://81.23.10.106:8008/api/master_db/big_cities.sql?select=code&orderby=code-desc) query with ordering:
````bash
master_db/big_cities.sql?select=code&orderby=code-desc
````[Execute](http://81.23.10.106:8008/api/master_db/big_cities.sql?select=code&orderby=code-desc&page=1,3) query with pagination:
````bash
master_db/big_cities.sql?select=code&orderby=code-desc&page=1,3
````Self-documentation
------------------
sql-boot uses the [OpenAPI](https://github.com/OAI/OpenAPI-Specification) standard to generate up-to-date documentation for APIs based your SQL-queries metadata.
You can use a tool like [Swagger-UI](https://github.com/swagger-api/swagger-ui) or [Swagger-Editor](https://github.com/swagger-api/swagger-editor) to render interactive documentation (for demo requests) or [generate client API](https://github.com/swagger-api/swagger-codegen) against the live API server.How to pronounce
----------------
It is pronounced "sequelboot" - https://translate.google.com/?source=osdd#en/en/sequelbootTry with Docker and embedded (H2) demo db:
------------------------------------------
```
docker run -t -p 8007:8007 mgramin/sql-boot
```Build from source:
------------------
```
git clone https://github.com/mgramin/sql-boot
cd sql-boot
mvn package
```