A Go ORM and SQL builder library with functional options style, read/write separation, and clean syntax.
gosql is an ORM and SQL builder library for Go that simplifies database interactions using a functional options style. It addresses limitations in existing Go database libraries by offering features like read/write separation, unlimited nesting queries, and a clean, expressive syntax. The library is designed to be easy to use while providing powerful capabilities for building and executing SQL queries.
Go developers working on applications that require complex database operations, especially those needing scalable read/write separation and expressive query building without verbose syntax. It's suitable for projects where clean, idiomatic Go code is a priority.
Developers choose gosql over alternatives because it combines a fluent, chainable API with explicit read/write separation, which is missing in libraries like GORM and sqlx. Its functional options style avoids special keywords and ugly syntax, offering a versatile, production-ready solution that prioritizes simplicity and readability.
golang orm and sql builder
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a functional options style with chainable methods for building complex SQL queries, as demonstrated in the support for unlimited nesting and clear semantics in the demo.
Provides db.Primary() and db.Replica() methods to separate read and write operations, addressing a key limitation noted in libraries like GORM for scalable database architectures.
Automatically maps database rows to Go structs with customizable tags and TableName method, simplifying data model management without verbose syntax.
Supports bulk inserts and transactions, enhancing performance for batch data processing as shown in the documentation for handling multiple records.
Limited to MySQL databases, as stated in the README note, which restricts its use in polyglot database environments or projects requiring other SQL databases.
Requires learning a unique syntax for operators (e.g., [>], [in]) in WHERE clauses, which can be less intuitive and error-prone compared to standard SQL or other ORMs.
As a smaller project, it lacks the extensive community, plugins, and long-term stability assurance of more established ORMs like GORM or sqlx.