A lightweight Go library that eliminates boilerplate code for MySQL and PostgreSQL database operations.
dbq is a Go library that simplifies database operations by eliminating boilerplate code. It allows developers to execute SQL queries, perform bulk inserts, manage transactions, and automatically unmarshal results into structs with minimal effort. It solves the problem of repetitive and verbose database code in Go applications.
Go developers working with MySQL or PostgreSQL who want to reduce database boilerplate without adopting a heavy ORM. It's ideal for those building applications where clean, efficient database interactions are a priority.
Developers choose dbq because it offers a lightweight, no-fuss alternative to ORMs, providing essential features like automatic unmarshaling, bulk operations, and transaction management with significantly less code. Its compatibility with both MySQL and PostgreSQL adds to its flexibility.
Zero boilerplate database operations for Go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports any SQL query, allowing developers to write raw SQL without restrictions, as highlighted in the 'Any Query Support' feature.
Automatically maps query results to Go structs using the mapstructure package, reducing manual parsing code and boilerplate.
Provides seamless bulk insert and update functions, such as INSERTStmt and BulkUpdate, handling multiple rows in single queries for performance.
Offers automatic rollback for transactions unless explicitly committed, simplifying error handling in complex database operations.
Only compatible with MySQL and PostgreSQL, excluding other popular databases like SQLite or SQL Server, which restricts its use in diverse environments.
Uses reflection for unmarshaling, which can impact performance; while ScanFaster is available, it requires manual implementation for each struct, adding complexity.
Requires writing raw SQL for all queries, which might be error-prone and less convenient compared to libraries with declarative query builders.