-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add global value convertor for mysql and sqlite go sdk (#1955)
Signed-off-by: Patrick <[email protected]>
- Loading branch information
1 parent
09c7e5c
commit 8d9a771
Showing
5 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package db | ||
|
||
import ( | ||
"database/sql/driver" | ||
) | ||
|
||
// GlobalParameterConverter is a global valueConverter instance to convert parameters. | ||
var GlobalParameterConverter = &valueConverter{} | ||
|
||
var _ driver.ValueConverter = (*valueConverter)(nil) | ||
|
||
// valueConverter is a no-op value converter. | ||
type valueConverter struct{} | ||
|
||
func (c *valueConverter) ConvertValue(v any) (driver.Value, error) { | ||
return driver.Value(v), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters