You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `name` | Store identifier (used in registry) | **Yes** |
161
+
| `package` | Go package name | **Yes** |
162
+
| `output_dir` | Directory for generated files | Optional (defaults to `stores/<name>`) |
163
+
| `interface` | Interface name — **recommended: `<Name>Store`** (e.g., `UserStore`) | Optional (defaults to `<Name>Store`) |
164
+
| `implementation` | Implementation struct name (e.g., `userStore`) | Optional (defaults to `<name>Store`) |
165
+
| `queries` | Array of database queries | **Yes** |
165
166
166
167
> **⚠️ Naming Convention:** The registry (`stores/all.go`) automatically appends `"Store"` when building constructor calls. To avoid compilation errors, always name your interface as `<Name>Store` (e.g., `UserStore`) and the generated constructor will be `New<Name>Store()`.
167
168
@@ -200,7 +201,7 @@ models:
200
201
- `delete`- DELETE queries
201
202
202
203
**Return Types:**
203
-
- `single`- Returns `(*Model, error)`
204
+
- `single`- Returns `(Model, error)`
204
205
- `multiple`- Returns `([]Model, error)`
205
206
- `count`- Returns `(int64, error)`
206
207
- `custom`- Returns `(any, error)`
@@ -264,7 +265,7 @@ package user
264
265
import "gofr.dev/pkg/gofr"
265
266
266
267
type UserStore interface {
267
-
GetUserByID(ctx *gofr.Context, id int64) (*User, error)
268
+
GetUserByID(ctx *gofr.Context, id int64) (User, error)
0 commit comments