Fix tests

pull/42/head
Vinícius Garcia 2023-07-16 22:11:05 -03:00
parent 077033b3ff
commit 22a26aeb18
4 changed files with 21 additions and 6 deletions

View File

@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.16.0 // sqlc v1.14.0
package sqlcgen package sqlcgen

View File

@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.16.0 // sqlc v1.14.0
package sqlcgen package sqlcgen

View File

@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.16.0 // sqlc v1.14.0
// source: queries.sql // source: queries.sql
package sqlcgen package sqlcgen

View File

@ -45,9 +45,24 @@ type loggerKey struct{}
// LogValues is the argument type of ksql.LoggerFn which contains // LogValues is the argument type of ksql.LoggerFn which contains
// the data available for logging whenever a query is executed. // the data available for logging whenever a query is executed.
type LogValues struct { type LogValues struct {
Query string `json:"query"` Query string
Params []interface{} `json:"params"` Params []interface{}
Err error `json:"error,omitempty"` Err error
}
func (l LogValues) MarshalJSON() ([]byte, error) {
var out struct {
Query string `json:"query"`
Params []interface{} `json:"params"`
Err string `json:"error,omitempty"`
}
out.Query = l.Query
out.Params = l.Params
if l.Err != nil {
out.Err = l.Err.Error()
}
return json.Marshal(out)
} }
// LoggerFn is a the type of function received as // LoggerFn is a the type of function received as