dbrpc - Database RPC service written in go language.
This service
- gets http request
http://hostname/api/function?arg1=val1&arg2=val2
- loads database function signature like
CREATE FUNCTION function(arg1 TYPE, arg2 TYPE) RETURNS SETOF ...
- calls sql
select * from function(val1, val2)
- and returns query result as json:
curl "http://localhost:8081/api/public.echo?id=1&name=op" | jq "." { "result": [ { "name": "op", "id": 1 } ], "success": true } ```
Also, the same functionality may be used via JSON-RPC interface
- configurable limit of simultaneous database connections
- caching with groupcache
- gracefull restart
- CORS support
- JSON-RPC over HTTP interface
- required args checking
- RPC interface
- Cache control
- Authentication
- Access control
- Metrics for Prometheus
- Integrated templates
- i18n
- endless uses syscall.Kill which is not portable to Windows yet.
- improve tests
- add
--index
arg - proc name to fetch functions list (and name -> function mapping)
go get github.com/LeKovr/dbrpc
See Latest release
- Marcio Castilho for his blog post
- groupcache authors
- Julio Capote for his groupcache sample
The MIT License (MIT), see LICENSE.
Copyright (c) 2016 Alexey Kovrizhkin ak@elfire.ru