Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benjcal/pgroute


https://github.com/benjcal/pgroute

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# pgroute

Simple library to expose all postgres pubic functions to HTTP.

Uses `chi` and `gorm`

### usage:

```golang
db, _ := gorm.Open(...)
r := chi.NewRouter()

r.Mount("/f", pgroute.MountFunctionRoute(db))
```

```sql
CREATE FUNCTION add_user(username TEXT, age INT) ...
```

```sh
curl -X POST -d '{"username": "foo", "age": 22}'
```