Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usage of package gnorm with {{$rootPkg}} #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generated/public/authors/authors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/public/books/books.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gnorm_templates/table.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func All(ctx context.Context, db {{$rootPkg}}.DB) ([]*Row, error) {
}

// CountQuery retrieve one row from '{{ $table }}'.
func CountQuery(ctx context.Context, db gnorm.DB, where gnorm.WhereClause) (int, error) {
func CountQuery(ctx context.Context, db {{$rootPkg}}.DB, where {{$rootPkg}}.WhereClause) (int, error) {
const origsqlstr = `SELECT
count(*) as count
FROM {{$schema}}.{{ $table }} WHERE (`
Expand Down Expand Up @@ -278,7 +278,7 @@ func Update(ctx context.Context, db {{$rootPkg}}.DB, r *Row) error {
{{end}}

// InsertIgnore inserts the row into the database but ignores conflicts
func InsertIgnore(ctx context.Context, db gnorm.DB, r *Row, constraint string) error {
func InsertIgnore(ctx context.Context, db {{$rootPkg}}.DB, r *Row, constraint string) error {
sqlstr := `INSERT INTO {{$schema}}.{{ $table }} ` +
{{- if gt (len $insertCols) 0}}
`(
Expand Down