From 6788b76bfc37e3d06fc2cbf148544c265a1aa5d5 Mon Sep 17 00:00:00 2001 From: jdl Date: Thu, 25 Jun 2026 13:47:38 +0200 Subject: [PATCH] Cleanup --- gen.go.tmpl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gen.go.tmpl b/gen.go.tmpl index 803e1b4..d506852 100644 --- a/gen.go.tmpl +++ b/gen.go.tmpl @@ -5,7 +5,7 @@ import ( "iter" ) -type TX interface { +type dbConn interface { Exec(query string, args ...any) (sql.Result, error) Query(query string, args ...any) (*sql.Rows, error) QueryRow(query string, args ...any) *sql.Row @@ -27,7 +27,7 @@ const {{.LowerType}}_SelectQuery = "{{.SelectQuery}}" {{if not .NoInsert -}} func {{.LowerType}}_Insert( - tx TX, + tx dbConn, row *{{.Type}}, ) (err error) { {{.LowerType}}_Sanitize(row) @@ -46,7 +46,7 @@ func {{.LowerType}}_Insert( {{if .UpdateCols -}} func {{.LowerType}}_Update( - tx TX, + tx dbConn, row *{{.Type}}, ) (err error) { {{.LowerType}}_Sanitize(row) @@ -77,7 +77,7 @@ func {{.LowerType}}_Update( {{if .UpdateFullCols -}} func {{.LowerType}}_UpdateFull( - tx TX, + tx dbConn, row *{{.Type}}, ) (err error) { {{.LowerType}}_Sanitize(row) @@ -111,7 +111,7 @@ func {{.LowerType}}_UpdateFull( {{if not .NoDelete -}} func {{.LowerType}}_Delete( - tx TX, + tx dbConn, {{.PKFunctionArgs -}} ) (err error) { result, err := tx.Exec("{{.DeleteQuery}}", {{.DeleteArgs}}) @@ -136,7 +136,7 @@ func {{.LowerType}}_Delete( {{- end}} func {{.LowerType}}_Get( - tx TX, + tx dbConn, {{.PKFunctionArgs -}} ) ( row {{.Type}}, @@ -148,7 +148,7 @@ func {{.LowerType}}_Get( } func {{.LowerType}}_GetWhere( - tx TX, + tx dbConn, query string, args ...any, ) ( @@ -161,7 +161,7 @@ func {{.LowerType}}_GetWhere( } func {{.LowerType}}_Iterate( - tx TX, + tx dbConn, query string, args ...any, ) ( @@ -190,7 +190,7 @@ func {{.LowerType}}_Iterate( } func {{.LowerType}}_List( - tx TX, + tx dbConn, query string, args ...any, ) (