Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. ozzo-dbx

ozzo-dbx

MITGov1.5.0

A Go package that enhances database/sql with powerful data retrieval methods and DB-agnostic query building.

GitHubGitHub
667 stars112 forks0 contributors

What is ozzo-dbx?

ozzo-dbx is a Go package that enhances the standard `database/sql` library by adding powerful data retrieval methods and a database-agnostic query builder. It solves the problem of writing repetitive and error-prone SQL code by providing a structured, programmatic way to build and execute queries while maintaining compatibility with major relational databases.

Target Audience

Go developers working with relational databases who need a lightweight, non-ORM tool to simplify query building, reduce boilerplate, and safely interact with SQL databases.

Value Proposition

Developers choose ozzo-dbx because it offers a clean, expressive API for database operations without the overhead of a full ORM, keeps them close to SQL, and ensures DB portability with built-in quoting and parameter binding for security.

Overview

A Go (golang) package that enhances the standard database/sql package by providing powerful data retrieval methods as well as DB-agnostic query building capabilities.

Use Cases

Best For

  • Building database layers in Go applications without a full ORM
  • Writing DB-agnostic SQL queries that work across multiple database systems
  • Reducing boilerplate code for CRUD operations in Go
  • Safely parameterizing SQL queries to prevent injection attacks
  • Programmatically constructing complex SQL conditions and clauses
  • Adding structured logging and instrumentation to database queries

Not Ideal For

  • Applications requiring automatic relationship management and schema migrations offered by full ORMs
  • Projects where database-specific SQL optimizations and features are critical
  • Teams that prefer writing raw SQL without any abstraction layer
  • Systems needing support for databases outside the core five (SQLite, MySQL, PostgreSQL, MS SQL Server, Oracle)

Pros & Cons

Pros

Flexible Data Mapping

Populates query results directly into structs, maps, or slices with configurable field mapping using struct tags, reducing boilerplate for data retrieval as shown in the README's examples for populating nested structs.

DB-Agnostic Query Building

Programmatically constructs SELECT, INSERT, UPDATE, DELETE queries that work across SQLite, MySQL, PostgreSQL, and others, with automatic table and column quoting for portability, demonstrated in the query building sections.

Secure Parameter Binding

Uses named parameters like `{:ParamName}` to prevent SQL injection, ensuring safe query execution without manual escaping, as highlighted in the binding parameters section.

Convenient CRUD Operations

Provides Insert, Read, Update, Delete methods on model structs with minimal code, though limited to simple primary keys, as detailed in the CRUD operations part of the README.

Cons

Limited ORM Features

Lacks advanced ORM capabilities such as automatic relationship handling, schema migrations, and lazy loading, which are common in full-featured ORMs like GORM, forcing developers to handle these manually.

Partial Database Support

Query building only works fully for five databases; the README admits that for other databases, it may not work as expected, requiring custom builder implementation.

Composite Key Limitations

CRUD Model methods do not support composite primary keys—for example, SelectQuery.Model() fails here, forcing use of lower-level query building with Where() clauses, as noted in the Read section.

Frequently Asked Questions

Quick Stats

Stars667
Forks112
Contributors0
Open Issues32
Last commit3 years ago
CreatedSince 2015

Tags

#database-driver#query-builder#crud#database#postgresql#golang#mysql#sqlite#ozzo#orm-alternative#go#sql

Built With

G
Go

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

sqlcsqlc

Generate type-safe code from SQL

Stars17,812
Forks1,047
Last commit2 days ago
SquirrelSquirrel

Fluent SQL generation for golang

Stars7,942
Forks510
Last commit2 years ago
xoxo

Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server

Stars3,892
Forks335
Last commit2 months ago
jetjet

Type safe SQL builder with code generation and automatic query result data mapping

Stars3,706
Forks187
Last commit10 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub