Skip to content

Commit

Permalink
Allow sql_driver: "github.com/go-sql-driver/mysql"
Browse files Browse the repository at this point in the history
In preparation of sqlc-dev#2179 for LOAD DATA LOCAL INFILE
  • Loading branch information
Jille committed Apr 21, 2023
1 parent e99f1db commit 445489a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/codegen/golang/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const (
SQLDriverLibPQ
)

const SQLDriverGoSQLDriverMySQL = "github.com/go-sql-driver/mysql"

func parseDriver(sqlPackage string) SQLDriver {
switch sqlPackage {
case SQLPackagePGXV4:
Expand Down
2 changes: 2 additions & 0 deletions internal/config/v_one.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type v1PackageSettings struct {
EmitAllEnumValues bool `json:"emit_all_enum_values,omitempty" yaml:"emit_all_enum_values"`
JSONTagsCaseStyle string `json:"json_tags_case_style,omitempty" yaml:"json_tags_case_style"`
SQLPackage string `json:"sql_package" yaml:"sql_package"`
SQLDriver string `json:"sql_driver" yaml:"sql_driver"`
Overrides []Override `json:"overrides" yaml:"overrides"`
OutputBatchFileName string `json:"output_batch_file_name,omitempty" yaml:"output_batch_file_name"`
OutputDBFileName string `json:"output_db_file_name,omitempty" yaml:"output_db_file_name"`
Expand Down Expand Up @@ -151,6 +152,7 @@ func (c *V1GenerateSettings) Translate() Config {
Package: pkg.Name,
Out: pkg.Path,
SQLPackage: pkg.SQLPackage,
SQLDriver: pkg.SQLDriver,
Overrides: pkg.Overrides,
JSONTagsCaseStyle: pkg.JSONTagsCaseStyle,
OutputBatchFileName: pkg.OutputBatchFileName,
Expand Down

0 comments on commit 445489a

Please sign in to comment.