NetLife Guru

Open source Go packages for fast, maintainable web systems. Built with a documentation-first approach.

Product
OverviewGolang packagesNews
Documentation
DocumentationGo LoggerGo RouterGo DB Form
Company
OverviewContactNewsGitHub
Community / Support
Supportinfo@netlife.guru
© 2026 NetLife Guru. All rights reserved.
GitHubinfo@netlife.guru
NetLife GuruNetLife GuruNetLife Guru
NetLife GuruNetLife GuruNetLife Guru
OverviewDocumentationNewsSupportContact

Golang packages

About
InstallationQuick Start
MappingDynamic RowsEdge Cases
MapperGetting Started

Installation

Install the mapper package into your Go project.

The mapper package requires Go 1.22 or newer.

mapper is a lightweight standalone package for scanning database rows into Go structs, maps, or custom row handlers.

It helps you map database results by column name instead of scan position, while staying independent from any specific database driver.

It supports:

  • struct mapping using db and json tags
  • scanning rows into []T
  • scanning rows into map[string]any
  • filling structs from maps
  • nullable values and pointer fields
  • custom row mapping through the ScanMapper interface
  • database-agnostic row scanning through the mapper.Rows interface

Install

Install the package using go get:

go get github.com/netlifeguru/mapper

After installation, import the package into your application:

import "github.com/netlifeguru/mapper"

The package is standalone and does not require the NetLifeGuru database layer.

You can use it directly with rows from MySQL, PostgreSQL, ScyllaDB, CockroachDB, MariaDB, or any other database driver that can be adapted to the mapper.Rows interface.

For clarity and consistency, the examples in this documentation use MySQL, but the same mapping concepts apply to other supported database systems.

Once installed, continue with the Quick Start guide to scan your first database rows into Go structs.

About

Mapper is a lightweight Go package for scanning database rows into structs, maps, or custom row handlers.

Quick Start

Scan database rows into a typed Go slice.

On this page

Install