A lightweight Go query builder for SQLite, PostgreSQL, MySQL, and others with simple syntax and automatic parameter handling.
BQB is a lightweight Go library for building SQL queries with safe parameterization. It allows developers to write raw SQL strings while automatically handling parameter placeholders, slice expansion for IN clauses, and JSON serialization. It solves the problem of manual parameter tracking and conditional SQL string concatenation, especially when working with multiple database dialects.
Go developers who need a simple, non-intrusive way to build dynamic SQL queries for applications using SQLite, PostgreSQL, MySQL, or similar databases, without the overhead of a full ORM or complex query DSL.
Developers choose BQB because it keeps them close to SQL syntax while automating parameter handling and conditional logic. Unlike heavier query builders or ORMs, it doesn't require learning a new DSL, and its tiny API reduces cognitive overhead while supporting multiple databases seamlessly.
BQB is a lightweight and easy to use query builder that works with sqlite, mysql, mariadb, postgres, and others.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Seamlessly works with SQLite, PostgreSQL, MySQL via ToSql() and ToPgsql() methods, automatically adapting parameter syntax without code changes.
Automatically expands slices like []string and []int for SQL IN operators, eliminating manual placeholder counting as shown in the IN clause examples.
Optional() queries hide unused clauses, enabling modular WHERE and SELECT building without string concatenation, demonstrated in the advanced query examples.
Provides JsonMap and JsonList types for easy JSON field insertion, simplifying database interactions with structured data without external dependencies.
Forces developers to write and maintain raw SQL strings, which can lead to syntax errors and reduced maintainability in large or complex query codebases.
Features like the Embedder interface and ToRaw() method bypass parameterization, requiring careful manual sanitization to avoid SQL injection vulnerabilities.
Lacks higher-level abstractions for common patterns like joins or aggregates, forcing manual SQL writing even for routine database operations.