Masterminds/squirrel

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

Squirrel is a fluent SQL generator for Go. It helps build SQL queries from composable parts representing the SQL SELECT query clauses: SELECT, FROM, JOIN, WHERE, etc. and also other DML statements.

Installation

go get github.com/Masterminds/squirrel

Programming Model

// Get a database/sql database handle
dbHandle = getDbHandle()

getDbHandle() can be implemented as shown in:

Connect to a PostgreSQL Database with database/sql API and a pgx Driver