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
Project InformationExamples
DBProject

Examples

Practical examples for DB usage with MySQL, PostgreSQL, Scylla, and shared database helpers.

Practical examples are available in the official examples repository:

https://github.com/netlifeguru/examples/db

The repository contains standalone examples covering database connections, typed queries, maps, scalar values, inserts, updates, deletes, dialect SQL, SQL files, transactions, Scylla batches, lightweight transactions, and shared DB helper behavior.

MySQL Examples

MySQL examples are available at:

https://github.com/netlifeguru/examples/db/mysql

These examples demonstrate the shared DB API with the MySQL driver, including MySQL placeholders, LastInsertId, SQL transactions, and MySQL SQL files.

  • Connect
  • Ping
  • Create schema
  • Insert
  • Select list
  • Select get
  • Select value
  • Select map
  • Query list
  • Query get
  • Query value
  • Query map
  • Dialect list
  • Dialect get
  • Dialect value
  • Dialect map
  • Update
  • Delete
  • SQL files
  • SQL files dialect
  • SQL files insert
  • SQL files update delete
  • Transactions
  • Low-level transactions

PostgreSQL Examples

PostgreSQL examples are available at:

https://github.com/netlifeguru/examples/db/postgresql

These examples demonstrate the shared DB API with the PostgreSQL driver, including numbered placeholders, RETURNING inserts, SQL transactions, PostgreSQL SQL files, and multi-driver SQL files.

  • Connect
  • Ping
  • Create schema
  • Insert
  • Select list
  • Select get
  • Select value
  • Select map
  • Query list
  • Query get
  • Query value
  • Query map
  • Dialect list
  • Dialect get
  • Dialect value
  • Dialect map
  • Update
  • Delete
  • SQL files
  • SQL files dialect
  • SQL files insert
  • SQL files update delete
  • Transactions
  • Low-level transactions
  • Multi-driver SQL files

Scylla Examples

Scylla examples are available at:

https://github.com/netlifeguru/examples/db/scylla

These examples demonstrate the shared DB API with the Scylla driver, including CQL placeholders, keyspaces, query tables, batches, SQL files, and lightweight transactions.

  • Connect
  • Ping
  • Create schema
  • Insert
  • Select list
  • Select get
  • Select value
  • Select map
  • Query list
  • Query get
  • Query value
  • Query map
  • Dialect list
  • Dialect get
  • Dialect value
  • Dialect map
  • Update
  • Delete
  • SQL files
  • SQL files dialect
  • SQL files insert
  • SQL files update delete
  • Batch
  • Low-level batch
  • Lightweight transaction
  • Lightweight transaction map
  • Lightweight transaction low-level

DB Dumb Examples

DB dumb examples are available at:

https://github.com/netlifeguru/examples/db/dumb

These examples demonstrate shared DB helper behavior without focusing on a specific production driver.

  • Dumb examples

Recommended Starting Points

Start with the driver you use:

  • MySQL connect
  • PostgreSQL connect
  • Scylla connect

Then continue with the shared query examples:

  • 05_select_list
  • 06_select_get
  • 07_select_value
  • 08_select_map

For SQL files and multi-driver usage, see:

  • PostgreSQL multi-driver SQL files

Project Information

Documentation links, versioning policy, contribution guidelines, licensing, and project resources for the NLG DB package.

On this page

MySQL ExamplesPostgreSQL ExamplesScylla ExamplesDB Dumb ExamplesRecommended Starting Points