GORM Queries (gormqs)
A lightweight and extendable wrapper for Gorm that simplifies query building while maintaining type safety.
Tech Stack
Features
- Simplified Queries: Perform basic queries without unnecessary complexity.
- Extendable Options: Customize queries with reusable and type-safe options.
- Type Safety: Minimize the use of
interface{}oranyfor better code reliability. - Transaction Support: Easily integrate with Gorm transactions.
Why Use gormqs?
Why not just use Gorm?
Gorm is a powerful ORM, but it lacks type safety, which can lead to runtime errors.
Why not Ent?
Ent provides type safety but can introduce significant boilerplate code.
Why gormqs?
gormqs offers a middle ground, combining the best of both worlds:
- Simplifies query building.
- Reduces boilerplate code.
- Enhances type safety.
Getting Started
Installation
Add gormqs to your project:
bash
Ensure you have Gorm installed as well:
bash
Basic Usage
Define Your Model
go
Create Queries
go
Use Queries
go
Advanced Features
Custom Query Options
Define reusable and type-safe query options:
go
Transactions
Integrate with Gorm transactions:
go
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License. See the LICENSE file for details.