An expressive SQL builder and query library for Go with support for multiple database dialects.
Goqu is an expressive SQL builder and query library for Go that provides a type-safe domain-specific language for constructing database queries. It allows developers to write SQL queries using Go code while catching common errors at compile time, supporting multiple database dialects including PostgreSQL, MySQL, SQLite, and SQL Server.
Go developers who need to interact with SQL databases but want to avoid raw SQL string concatenation or the overhead of a full ORM. It's particularly useful for teams building database-intensive applications that require type safety and dialect portability.
Developers choose Goqu because it provides a balance between raw SQL flexibility and ORM convenience, with compile-time error checking and support for multiple database dialects. Its expressive DSL makes complex query construction more maintainable while still allowing direct SQL access when needed.
SQL builder and query library for golang
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a fluent, chainable API for constructing SELECT, INSERT, UPDATE, and DELETE statements, making complex SQL generation readable and maintainable, as shown in the quick examples.
Built from the ground up to support PostgreSQL, MySQL, SQLite, SQL Server, and others, enabling easy database portability without vendor lock-in.
Catches common SQL errors at compile time through its domain-specific language, reducing runtime bugs and improving developer confidence.
Supports both interpolated and prepared statement execution, offering security against SQL injection and performance flexibility, as detailed in the prepared statements docs.
Lacks ORM features like associations, hooks, and automatic schema handling, which the README explicitly advises using other libraries for, limiting its use in data-rich applications.
Running tests requires multiple database instances (Postgres, MySQL, SQL Server) with environment variables, making local development and CI/CD setup cumbersome.
Breaking changes between versions necessitate careful migration, as indicated by the dedicated migration documentation, which can disrupt upgrades.