Sqlapi
The SQL API, designed for effortless execution of queries on databases, requires only a straightforward HTTP call, devoid of any additional configuration.
Install / Use
/learn @ciceksepetitech/SqlapiREADME
SQL API
SQL API is designed to be able to run queries on databases without any configuration by simple HTTP call. The request contains the DB credentials and the query as well.
Warning! Do not use it in production. SQL API is suitable for test environments. In particular for integration tests.
Supported Databases
- MySQL
- MSSQL
- MongoDB
Usage
Start the docker container named sqlapi by running the following command.
docker run --rm --name sqlapi -p 8033:8033 techciceksepeti/sqlapi
Example request:
curl -X POST http://localhost:8033/sql \
-d '{
"db": {
"type": "mysql",
"host": "hostname:3306",
"name": "DBName",
"user": "username",
"password": "pass"
},
"query": "SELECT * from TableName LIMIT 1"
}'
Example Response:
The response represents the rows returned from the database.
[
{
"Id": 1,
"Name": "Electronic",
"Type": 2,
"Sequence": 1
}
]
Example request for mongodb:
curl -X POST http://localhost:8033/sql \
-d '{
"db": {
"type": "mongodb",
"host": "localhost:27017",
"name": "DBName",
"user": "mongoadmin",
"password": "secret"
},
"collection": "CollectionName",
"query": "{\"_id\":\"609a80caa23379b236426ad2\", \"$sort\": { \"name\": -1 }, \"name.first\": { \"$regex\": \"/John/i\" }}"
}'
License
The SQL API is open-sourced software licensed under the MIT license.
Related Skills
feishu-drive
351.4k|
things-mac
351.4kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
351.4kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
postkit
PostgreSQL-native identity, configuration, metering, and job queues. SQL functions that work with any language or driver
