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

AboutMulti-DriverSQL Files
OverviewInstallationMySQLPostgreSQLScylla
DBGetting Started

Installation

Install a NetLifeGuru database driver and use the shared DB layer in your Go project.

The db package is a shared database layer.

It is not used as a standalone database driver. To create a real database connection, install one of the supported driver packages.

Installing a driver also installs the shared dependencies:

github.com/netlifeguru/db
github.com/netlifeguru/mapper

Choose a Driver

Install the driver that matches your database.

MySQL

go get github.com/netlifeguru/db-mysql

Use this driver for MySQL and MySQL-compatible databases such as MariaDB.

import (
	"github.com/netlifeguru/db"
	"github.com/netlifeguru/db-mysql"
)

PostgreSQL

go get github.com/netlifeguru/db-postgres

Use this driver for PostgreSQL-compatible databases.

import (
	"github.com/netlifeguru/db"
	"github.com/netlifeguru/db-postgres"
)

Scylla

go get github.com/netlifeguru/db-scylla

Use this driver for ScyllaDB and CQL-based workloads supported by the driver.

import (
	"github.com/netlifeguru/db"
	"github.com/netlifeguru/db-scylla"
)

Install Multiple Drivers

You can install more than one driver in the same project.

go get github.com/netlifeguru/db-mysql
go get github.com/netlifeguru/db-postgres
go get github.com/netlifeguru/db-scylla

This is useful when:

  • one application can run with different database engines
  • tests use a different database than production
  • a migration tool needs to support multiple databases
  • you are using dialect SQL files

Do Not Install DB Alone

You can technically install the shared package directly:

go get github.com/netlifeguru/db

However, this does not give you a working database connection by itself. The db package defines shared interfaces, helpers, query types, and result mapping behavior. A concrete driver is still required to connect to MySQL, PostgreSQL, or Scylla.

In most applications, install a driver instead:

go get github.com/netlifeguru/db-mysql

or:

go get github.com/netlifeguru/db-postgres

or:

go get github.com/netlifeguru/db-scylla

Requirements

This package requires Go 1.22 or newer.

  • Go: 1.22 or newer
  • Connection driver: MySQL, PostgreSQL, or Scylla
  • Shared database layer: github.com/netlifeguru/db
  • Result mapper: github.com/netlifeguru/mapper

Package Relationship

The packages are intended to be used together.

Application
   ↓
Driver package
   ↓
github.com/netlifeguru/db
   ↓
github.com/netlifeguru/mapper

For example, when you install:

go get github.com/netlifeguru/db-postgres

your project also receives the shared db and mapper packages.

Next Step

After installing a driver, continue with the driver-specific getting started guide:

  • MySQL
  • PostgreSQL
  • Scylla

Overview

Understand how the DB package works with NetLifeGuru database drivers and mapper.

MySQL

Create a MySQL connection using the NetLifeGuru MySQL driver and the shared DB layer.

On this page

Choose a DriverMySQLPostgreSQLScyllaInstall Multiple DriversDo Not Install DB AloneRequirementsPackage RelationshipNext Step