Skip to content

Latest commit

 

History

History
112 lines (89 loc) · 2.92 KB

README.md

File metadata and controls

112 lines (89 loc) · 2.92 KB

norm (NoORM)

Build Status Go Report Card go.dev reference Apache 2 licensed

This repository provides a no frills, no bloat and no magic collection of utilities for working with SQL code and databases in Go. It relies solely on standard library packages and focuses on simplicity, stability and performance.

Packages

A simple and performant SQL query builder for Go which doesn't hide or obscures SQL code and logic but rather makes them explicit and a fundamental part of the application code.

It handles the all parameter interpolation at the package level using the ? placeholder, so queries are mostly portable across databases.

Features

* Select
	* Comment
	* Columns
	* From (table or statement.SelectStatement)
	* Join
	* Where
	* WhereIn
	* With (statement.SelectStatement)
	* WithRecursive (statement.SelectStatement)
	* Having
	* GroupBy
	* Order
	* Limit
	* Offset
	* Distinct
	* ForUpdate
	* SkipLocked
	* Union (statement.SelectStatement)
	* UnionAll (statement.SelectStatement)
* Insert
	* Comment
	* Into
	* With (statement.SelectStatement)
	* Returning
	* Record (from struct)
	* ValuesSelect (statement.SelectStatement)
	* OnConflict
* Update
	* Comment
	* Table
	* Set
	* SetMap
	* With (statement.SelectStatement)
	* Where
	* WhereIn
	* Returning
* Delete
	* Comment
	* From
	* With (statement.SelectStatement)
	* Where
	* WhereIn
	* Returning
* DDL
	* Comment
	* Create
	* Alter
	* Truncate
	* Drop

A safe sql.DB wrapper which enforces transactional access to the database, transaction query caching and operation logging and plays nicely with norm/statement.

Features

* Contextual operation logging
* Transactional access with default isolation level
* Cursor for traversing large result sets
* Row scanning into structs or []struct
* Transaction scoped query caching
* Transaction ids for request tracing

A simple database migration package which does the necessary, not less, not more.

Features

* Migration sequence management
* Migrate Up/Down/Apply(<version>)
* Apply/discard migrations
* Transactional apply/discard migrations

Motivation

I like simple, efficient and clean code. There is too much ORM stuff floating around these days.

Install

go get -u -v github.com/brunotm/norm

Test

go test -v -cover ./...