Ecosyste.ms: Packages

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

Top 5.8% on proxy.golang.org
Top 3.4% dependent packages on proxy.golang.org
Top 3.5% dependent repos on proxy.golang.org

proxy.golang.org : github.com/andrewpillar/query

Package query provides an extensible SQL query builder for PostgreSQL. It works by using first class functions to allow for queries to be built up. This does not support the entire dialect for PostgreSQL, only a subset that would be necessary for CRUD operations. Let's look at how a simple SELECT query can be built up using this library, we can then use the above to pass a query to our database driver, along with the arguments passed to the query, Calling Build on the query will build up the query string and correctly set the parameter arguments in the query. Args will return an interface slice containing the arguments given to the query via query.Arg. We can do even more complex SELECT queries too, This library makes use of the type Option which is a first class function, which takes the current Query an Option is being applied to and returns it. With this we can define our own Option functions to clean up some of the queries we want to build.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/andrewpillar/query
Keywords: go, sql, sql-builder
License: MIT
Latest release: about 2 years ago
First release: about 2 years ago
Namespace: github.com/andrewpillar
Dependent packages: 4
Dependent repositories: 2
Stars: 68 on GitHub
Forks: 2 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 5 days ago

    Loading...
    Readme
    Loading...