From 80d3e58428bfa35806426a2f718a9d70e1f2a60a Mon Sep 17 00:00:00 2001 From: Nate Finch Date: Fri, 27 Oct 2017 12:33:41 -0400 Subject: [PATCH] fix the mysql template (#69) It was out of date. Added gnorm gen tasks for go generate to try to catch this in the future --- database/drivers/mysql/parse.go | 2 ++ database/drivers/mysql/templates/table.gotmpl | 2 +- database/drivers/postgres/parse.go | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/database/drivers/mysql/parse.go b/database/drivers/mysql/parse.go index 26f6528..1e59c13 100644 --- a/database/drivers/mysql/parse.go +++ b/database/drivers/mysql/parse.go @@ -15,6 +15,8 @@ import ( "gnorm.org/gnorm/database/drivers/mysql/gnorm/tables" ) +//go:generate gnorm gen + // MySQL implements drivers.Driver interface for MySQL database. type MySQL struct{} diff --git a/database/drivers/mysql/templates/table.gotmpl b/database/drivers/mysql/templates/table.gotmpl index cb536c2..0257099 100644 --- a/database/drivers/mysql/templates/table.gotmpl +++ b/database/drivers/mysql/templates/table.gotmpl @@ -5,7 +5,7 @@ package {{toLower .Name}} import "gnorm.org/gnorm/database/drivers/mysql/gnorm" {{$table := .DBName -}} -{{$schema := .DBSchema -}} +{{$schema := .Schema.DBName -}} // Row represents a row from '{{ $table }}'. type Row struct { {{- range .Columns }} diff --git a/database/drivers/postgres/parse.go b/database/drivers/postgres/parse.go index 760d652..553262f 100644 --- a/database/drivers/postgres/parse.go +++ b/database/drivers/postgres/parse.go @@ -15,6 +15,8 @@ import ( "gnorm.org/gnorm/database/drivers/postgres/gnorm/tables" ) +//go:generate gnorm gen + // PG implements drivers.Driver interface for interacting with postgresql // database. type PG struct{}