Skip to content

bekindsoft/sql-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql-proxy

Run sql queries via HTTP.

Example

Send a query string to be executed against your postgres DB.

curl -X "POST" "http:https://127.0.0.1:3000/v1/query" \
     -H 'Accept: application/json' \
     -H 'Content-Type: application/json' \
     -d $'{
  "query_string": "SELECT * from accounts_user;"
}'

Returns

{
  "query_string": "SELECT * from accounts_user;",
  "metadata": {
    "id": "text",
    "name": "text",
    "email": "text",
    "email_verified": "timestamptz",
    "image": "text",
    "created_at": "timestamptz",
    "updated_at": "timestamptz"
  },
    "data": [
    [
      "usr_1234",
      "Ken Masters",
      "[email protected]",
      "2023-01-25T06:21:53.161Z",
      "test",
      "2023-01-25T06:21:53.161Z",
      "2023-01-25T06:21:53.161Z"
    ]
  ]
}