Skip to content

Commit

Permalink
removed all reference on persist for types defined in commons.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Florin Stan committed Oct 28, 2020
1 parent 4aaa595 commit 651069e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions generator/rpc_snippets.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (this *Impl_{{.Service}}) {{.Method}}(stream {{.Service}}_{{.Method}}Server
return nil
}
func (this *Impl_{{.Service}}) {{.Method}}Tx(stream {{.Service}}_{{.Method}}Server, tx persist.PersistTx) error {
func (this *Impl_{{.Service}}) {{.Method}}Tx(stream {{.Service}}_{{.Method}}Server, tx lib.PersistTx) error {
query := this.QUERIES.{{camelCase .Query}}(stream.Context(), tx)
var first *{{.Request}}
for {
Expand Down Expand Up @@ -333,7 +333,7 @@ func (this *Impl_{{.Service}}) {{.Method}}(req *{{.Request}}, stream {{.Service}
return nil
}
func (this *Impl_{{.Service}}) {{.Method}}Tx(req *{{.Request}}, stream {{.Service}}_{{.Method}}Server, tx persist.PersistTx) error {
func (this *Impl_{{.Service}}) {{.Method}}Tx(req *{{.Request}}, stream {{.Service}}_{{.Method}}Server, tx lib.PersistTx) error {
ctx := stream.Context()
query := this.QUERIES.{{camelCase .Query}}(ctx, tx)
Expand Down
4 changes: 3 additions & 1 deletion generator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ func WriteIters(p *Printer, s *Service) (outErr error) {
if hasSecond {
amount = "multiple"
}
return &Row_`, sName, `_`, camelQ(q), `{err: persist.NotFound{Msg: fmt.Sprintf("expected exactly 1 result from query '`, camelQ(q), `' found %s", amount)}}
return &Row_`, sName, `_`, camelQ(q), `{err: lib.NotFound{Msg: fmt.Sprintf("expected exactly 1 result from query '`, camelQ(q), `' found %s", amount)}}
}
return first
}
Expand Down Expand Up @@ -1616,6 +1616,7 @@ func WritePackageLevelDeclarations(p *Printer, files *FileList) error {
}
if hasSQL {
p.Q(`
// tom
type ignoreTx struct {
r lib.Runnable
}
Expand Down Expand Up @@ -1672,6 +1673,7 @@ func WritePackageLevelDeclarations(p *Printer, files *FileList) error {
`)
} else if hasSpanner {
p.Q(`
// doesn't work
type Result interface {
LastInsertId() (int64, error)
RowsAffected() (int64, error)
Expand Down

0 comments on commit 651069e

Please sign in to comment.