Skip to content

vk0/dbprc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbrpc

GoCard GitHub license

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

Features

  • 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

ToDo

  • 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)

Install

go get github.com/LeKovr/dbrpc

Download

See Latest release

Acknowledgements

License

The MIT License (MIT), see LICENSE.

Copyright (c) 2016 Alexey Kovrizhkin ak@elfire.ru

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published