-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from stephenafamo/wrap-marshallable-types
Add wrapper types for Text/Binary Marshaler and Stringer
- Loading branch information
Showing
16 changed files
with
221 additions
and
47 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{$doneTypes := dict }} | ||
{{- range $table := .Tables}} | ||
{{- $tAlias := $.Aliases.Table $table.Key}} | ||
{{range $column := $table.Columns -}} | ||
{{- $colTyp := $column.Type -}} | ||
{{- if hasKey $doneTypes $colTyp}}{{continue}}{{end -}} | ||
{{- $_ := set $doneTypes $colTyp nil -}} | ||
{{- $typInfo := index $.Types $column.Type -}} | ||
{{- if $typInfo.NoScannerValuerTest}}{{continue}}{{end -}} | ||
{{- if isPrimitiveType $colTyp}}{{continue}}{{end -}} | ||
{{- $.Importer.ImportList $typInfo.Imports -}} | ||
{{$.Importer.Import "database/sql"}} | ||
{{$.Importer.Import "database/sql/driver"}} | ||
// Make sure the type {{$colTyp}} satisfies database/sql.Scanner | ||
var _ sql.Scanner = (*{{$colTyp}})(nil) | ||
|
||
// Make sure the type {{$colTyp}} satisfies database/sql/driver.Valuer | ||
var _ driver.Valuer = *new({{$colTyp}}) | ||
|
||
{{end -}} | ||
{{- end}} |
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
Oops, something went wrong.