An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 9.0% on proxy.golang.org

proxy.golang.org : github.com/go-on/pj

Package pj offers a very simple and thin opiniated layer over postgresql database queries. Therefor it makes several assumptions. 1. Each query returns a single row and a single column that is the result of a calls of a postgres function that gets one parameter that is a json string and returns a json string. This is most easily achieved by using the plv8 extension to define the functions. 2. All validation occurs inside the postgresql function. 3. The parameter to the function is a json map created from the url query. 4. The returned json will be returned to the client. 5. The returned json may have a property "http_status_code" to indicate errors. If it does the corresponding status code is sent to the client in addition to the json. 6. The returned json may have a property "http_headers" that must be convertible to a map[string]string. If it does, the http headers will be set accordingly. 7. Authentication and authorization will be handled by middleware surrounding the http.Handler returned from pj.New - no mapping server<->database necessary for rows and tables - single point of truth for structures/tables - validation near the data - easier schema migration: start with a function that returns static testdata and change the function to query tables when the schema has settled - fast development of client and database without having to restart or recompile server - you are bound to postgres - need pg users for access roles - need different connections for different access roles - learn postgres

Registry - Source - Documentation - JSON - codemeta.json
purl: pkg:golang/github.com/go-on/pj
License: MIT
Latest release: over 7 years ago
First release: over 7 years ago
Namespace: github.com/go-on
Stars: 0 on
Forks: 0 on
Last synced: 3 months ago

    Loading...
    Readme
    Loading...