Skip to content

Commit

Permalink
Rename the _dolpin engine to mysql:beta
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleconroy committed Aug 3, 2020
1 parent e2106d8 commit 399f4e4
Show file tree
Hide file tree
Showing 21 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion examples/booktest/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"path": "mysql",
"schema": "mysql/schema.sql",
"queries": "mysql/query.sql",
"engine": "_dolphin"
"engine": "mysql:beta"
}
]
}
2 changes: 1 addition & 1 deletion internal/codegen/golang/go_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func goInnerType(r *compiler.Result, col *compiler.Column, settings config.Combi

// TODO: Extend the engine interface to handle types
switch settings.Package.Engine {
case config.EngineMySQL, config.EngineXDolphin:
case config.EngineMySQL, config.EngineMySQLBeta:
return mysqlType(r, col, settings)
case config.EnginePostgreSQL:
return postgresType(r, col, settings)
Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewCompiler(conf config.SQL, combo config.CombinedSettings) *Compiler {
case config.EngineXLemon:
c.parser = sqlite.NewParser()
c.catalog = catalog.New("main")
case config.EngineMySQL, config.EngineXDolphin:
case config.EngineMySQL, config.EngineMySQLBeta:
c.parser = dolphin.NewParser()
c.catalog = catalog.New("public") // TODO: What is the default database for MySQL?
case config.EnginePostgreSQL:
Expand Down
2 changes: 1 addition & 1 deletion internal/compiler/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (c *Compiler) quoteIdent(ident string) string {
// TODO: Add a method to the parser / engine for this instead
if lang.IsReservedKeyword(ident) {
switch c.conf.Engine {
case config.EngineMySQL, config.EngineXDolphin:
case config.EngineMySQL, config.EngineMySQLBeta:
return "`" + ident + "`"
default:
return "\"" + ident + "\""
Expand Down
4 changes: 2 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ func (p *Paths) UnmarshalYAML(unmarshal func(interface{}) error) error {

const (
EngineMySQL Engine = "mysql"
EngineMySQLBeta Engine = "mysql:beta"
EnginePostgreSQL Engine = "postgresql"

// Experimental engines
EngineXLemon Engine = "_lemon"
EngineXDolphin Engine = "_dolphin"
EngineXLemon Engine = "_lemon"
)

type Config struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/column_as/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/delete_from/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/dolphin_errors/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"path": "go",
"schema": "schema.sql",
"queries": "query",
"engine": "_dolphin"
"engine": "mysql:beta"
}
]
}
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/inflection/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/insert_select/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/insert_values/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/params_two/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/select_limit/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/select_star/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"path": "go",
"schema": "schema.sql",
"queries": "query.sql",
"engine": "_dolphin"
"engine": "mysql:beta"
}
]
}
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/sqlc_arg/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/star_expansion/mysql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/endtoend/testdata/update_set/myql/sqlc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1",
"packages": [
{
"engine": "_dolphin",
"engine": "mysql:beta",
"path": "go",
"name": "querytest",
"schema": "query.sql",
Expand Down
2 changes: 1 addition & 1 deletion internal/sql/rewrite/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func NamedParameters(engine config.Engine, raw *ast.RawStmt) (*ast.RawStmt, map[
} else {
old = fmt.Sprintf("sqlc.arg(%s)", param)
}
if engine == config.EngineMySQL || engine == config.EngineXDolphin {
if engine == config.EngineMySQL || engine == config.EngineMySQLBeta {
replace = "?"
} else {
replace = fmt.Sprintf("$%d", args[param])
Expand Down

0 comments on commit 399f4e4

Please sign in to comment.