From d95eea6636acd39a6cc9321172851a1b7a097ef6 Mon Sep 17 00:00:00 2001 From: ankit Date: Sun, 27 Jul 2025 06:12:11 +0000 Subject: [PATCH] code example correction --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4aafa77..f6370ba 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,10 @@ once you have the schama files created you can use `pgm` as ```go package main -import "code.partial.tech/go/pgm" +import ( + "code.partial.tech/go/pgm" + "myapp/db/user" // scham create by pgm/cmd +) type MyModel struct { ID string @@ -64,8 +67,8 @@ func main() { // Select query to fetch the first record // Assumes the schema is defined in the "db" package with a User table var v MyModel - err := db.User.Select(db.User.ID, db.User.Email). - Where(db.User.Email.Like("anki%")). + err := db.User.Select(user.ID, user.Email). + Where(user.Email.Like("anki%")). First(context.TODO(), &v.ID, &v.Email) if err != nil { println("Error:", err.Error())