mirror of https://github.com/VinGarcia/ksql.git
Fix tests
parent
077033b3ff
commit
22a26aeb18
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
21
logger.go
21
logger.go
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue