Skip to content

Commit

Permalink
Add improve mysql keyword completion
Browse files Browse the repository at this point in the history
  • Loading branch information
lighttiger2505 committed Feb 24, 2021
1 parent e2bdf63 commit 4cea80a
Show file tree
Hide file tree
Showing 15 changed files with 2,065 additions and 1,311 deletions.
15 changes: 15 additions & 0 deletions dialect/keyword.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,23 @@ type DatabaseDriver string

const (
DatabaseDriverMySQL DatabaseDriver = "mysql"
DatabaseDriverMySQL8 DatabaseDriver = "mysql8"
DatabaseDriverMySQL57 DatabaseDriver = "mysql57"
DatabaseDriverMySQL56 DatabaseDriver = "mysql56"
DatabaseDriverPostgreSQL DatabaseDriver = "postgresql"
DatabaseDriverSQLite3 DatabaseDriver = "sqlite3"
)

func DataBaseKeywords(driver DatabaseDriver) []string {
switch driver {
case DatabaseDriverMySQL:
return mysql8Keyword
case DatabaseDriverMySQL8:
return mysql8Keyword
case DatabaseDriverMySQL57:
return mysql57Keyword
case DatabaseDriverMySQL56:
return mysql56Keyword
case DatabaseDriverPostgreSQL:
return postgresql13Keywords
case DatabaseDriverSQLite3:
Expand All @@ -400,7 +409,13 @@ func DataBaseKeywords(driver DatabaseDriver) []string {
func DataBaseFunctions(driver DatabaseDriver) []string {
switch driver {
case DatabaseDriverMySQL:
return mysql8Function
case DatabaseDriverMySQL8:
return mysql8Function
case DatabaseDriverMySQL57:
return mysql57function
case DatabaseDriverMySQL56:
return mysql56Function
case DatabaseDriverPostgreSQL:
return []string{}
case DatabaseDriverSQLite3:
Expand Down
Loading

0 comments on commit 4cea80a

Please sign in to comment.