Skip to content

chore: replace interface{} with any in Go/SQLite code generation#4487

Open
MD-Mushfiqur123 wants to merge 1 commit into
sqlc-dev:mainfrom
MD-Mushfiqur123:chore/interface-to-any-sqlite
Open

chore: replace interface{} with any in Go/SQLite code generation#4487
MD-Mushfiqur123 wants to merge 1 commit into
sqlc-dev:mainfrom
MD-Mushfiqur123:chore/interface-to-any-sqlite

Conversation

@MD-Mushfiqur123

Copy link
Copy Markdown

Replaces all auto-generated interface{} with any in Go/SQLite code generation templates and type mapping functions. This is the modern Go idiom since Go 1.18 (any is a built-in alias for interface{}).

Changes:

  • sqlite_type.go: return any instead of interface{} for SQLite any type and unknown type default case
  • go_type.go: return any instead of interface{} for unknown engine default case
  • result.go: update type comparison from interface{} to any
  • template.tmpl: Scan() methods use any parameter type
  • stdlib/queryCode.tmpl: use []any instead of []interface{}
  • stdlib/dbCode.tmpl: DBTX interface and helpers use ...any
  • Update all SQLite endtoend test golden files

Closes #4470

Replaces all auto-generated interface{} with any in Go/SQLite code
generation templates and type mapping functions. This is the modern Go
idiom since Go 1.18 (any is a built-in alias for interface{}).

Changes:
- sqlite_type.go: return 'any' instead of 'interface{}' for SQLite
  'any' type and unknown type default case
- go_type.go: return 'any' instead of 'interface{}' for unknown engine
  default case
- result.go: update type comparison from 'interface{}' to 'any'
- template.tmpl: Scan() methods use 'any' parameter type
- stdlib/queryCode.tmpl: use '[]any' instead of '[]interface{}'
- stdlib/dbCode.tmpl: DBTX interface and helpers use '...any'
- Update all SQLite endtoend test golden files

Signed-off-by: Md Mushfiqur Rahim <20mahin2020@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go/SQLite: Replace auto-generated interface{} with any

1 participant