@@ -16,7 +16,6 @@ import (
16
16
"github.com/kyleconroy/sqlc/internal/config"
17
17
"github.com/kyleconroy/sqlc/internal/debug"
18
18
"github.com/kyleconroy/sqlc/internal/multierr"
19
- "github.com/kyleconroy/sqlc/internal/mysql"
20
19
"github.com/kyleconroy/sqlc/internal/opts"
21
20
)
22
21
@@ -147,32 +146,22 @@ func Generate(e Env, dir string, stderr io.Writer) (map[string]string, error) {
147
146
name = combo .Kotlin .Package
148
147
}
149
148
149
+ result , errored := parse (e , name , dir , sql .SQL , combo , parseOpts , stderr )
150
+ if errored {
151
+ break
152
+ }
153
+
150
154
var files map [string ]string
151
155
var out string
152
-
153
- // TODO: Note about how this will be going away
154
- if sql .Engine == config .EngineMySQL {
155
- result , errored := parseMySQL (e , name , dir , sql .SQL , combo , parseOpts , stderr )
156
- if errored {
157
- break
158
- }
156
+ switch {
157
+ case sql .Gen .Go != nil :
159
158
out = combo .Go .Out
160
- files , err = golang .DeprecatedGenerate (result , combo )
161
- } else {
162
- result , errored := parse (e , name , dir , sql .SQL , combo , parseOpts , stderr )
163
- if errored {
164
- break
165
- }
166
- switch {
167
- case sql .Gen .Go != nil :
168
- out = combo .Go .Out
169
- files , err = golang .Generate (result , combo )
170
- case sql .Gen .Kotlin != nil :
171
- out = combo .Kotlin .Out
172
- files , err = kotlin .Generate (result , combo )
173
- default :
174
- panic ("missing language backend" )
175
- }
159
+ files , err = golang .Generate (result , combo )
160
+ case sql .Gen .Kotlin != nil :
161
+ out = combo .Kotlin .Out
162
+ files , err = kotlin .Generate (result , combo )
163
+ default :
164
+ panic ("missing language backend" )
176
165
}
177
166
178
167
if err != nil {
@@ -193,23 +182,6 @@ func Generate(e Env, dir string, stderr io.Writer) (map[string]string, error) {
193
182
return output , nil
194
183
}
195
184
196
- // Experimental MySQL support
197
- func parseMySQL (e Env , name , dir string , sql config.SQL , combo config.CombinedSettings , parserOpts opts.Parser , stderr io.Writer ) (golang.Generateable , bool ) {
198
- q , err := mysql .GeneratePkg (name , sql .Schema , sql .Queries , combo )
199
- if err != nil {
200
- fmt .Fprintf (stderr , "# package %s\n " , name )
201
- if parserErr , ok := err .(* multierr.Error ); ok {
202
- for _ , fileErr := range parserErr .Errs () {
203
- printFileErr (stderr , dir , fileErr )
204
- }
205
- } else {
206
- fmt .Fprintf (stderr , "error parsing schema: %s\n " , err )
207
- }
208
- return nil , true
209
- }
210
- return q , false
211
- }
212
-
213
185
func parse (e Env , name , dir string , sql config.SQL , combo config.CombinedSettings , parserOpts opts.Parser , stderr io.Writer ) (* compiler.Result , bool ) {
214
186
c := compiler .NewCompiler (sql , combo )
215
187
if err := c .ParseCatalog (sql .Schema ); err != nil {
0 commit comments