https://github.com/7bridges-eu/remys
Rest APIs for MySQL databases
https://github.com/7bridges-eu/remys
clojure mysql rest-api
Last synced: 8 months ago
JSON representation
Rest APIs for MySQL databases
- Host: GitHub
- URL: https://github.com/7bridges-eu/remys
- Owner: 7bridges-eu
- License: apache-2.0
- Created: 2017-12-06T08:06:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-05-09T09:46:14.000Z (over 6 years ago)
- Last Synced: 2025-04-08T01:42:16.811Z (9 months ago)
- Topics: clojure, mysql, rest-api
- Language: Clojure
- Size: 204 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# remys
Interact with MySQL databases using REST APIs.
## Usage
``` shell
$ lein run -- -u -p -d start
```
The server will be listening on port `3000`.
You can specify the hostname and the port of the MySQL database you wish to
interact with:
``` shell
$ lein run -- -H -P -u -p -d start
```
Now you can interact with your database via REST. Examples:
- get all the records from `departments` table:
``` shell
$ curl -i -X GET 'http://localhost:3000/api/departments'
```
- get a specific record from `departments` table:
``` shell
$ curl -i -X GET 'http://localhost:3000/api/departments/d009'
```
- get only some columns from `departments` table:
``` shell
$ curl -i -X GET 'http://localhost:3000/api/departments?fields=dept-no,dept-name'
```
- run a custom query:
``` shell
$ curl -i -X POST 'http://localhost:3000/api/dynamic'\
-H "Content-Type: application/json"\
-d '{"query":"select * from salaries limit 100"}'
```
- update a record:
``` shell
$ curl -i -X PUT 'http://localhost:3000/api/employees/10001'\
-H "Content-Type: application/json" -d '{"gender": "F"}'
```
For further details check the [APIs
documentation](https://7bridges-eu.github.io/remys/).
remys has been tested using the freely available
[test_db](https://github.com/datacharmer/test_db).
## License
Copyright © 2017 7bridges s.r.l.
Distributed under the Apache License 2.0.