@@ -25,6 +25,7 @@ type InnerSQL interface {
2525const (
2626 InnerSelectTable_ = "@selectTable_"
2727 InnerSelectTableLimit_ = "@selectTableLImit100_"
28+ InnerDescribeTable_ = "@describeTable_"
2829 InnerShowDatabases = "@showDatabases"
2930 InnerShowTables = "@showTables"
3031 InnerCurrentDB = "@currentDB"
@@ -39,14 +40,15 @@ func GetInnerSQL(dialect string) InnerSQL {
3940 }
4041}
4142
42- type mysqlDialect struct {
43- }
43+ type mysqlDialect struct {}
4444
4545func (m * mysqlDialect ) ToNativeSQL (query string ) (sql string ) {
4646 if strings .HasPrefix (query , InnerSelectTable_ ) {
4747 sql = "SELECT * FROM " + strings .ReplaceAll (query , InnerSelectTable_ , "" )
4848 } else if strings .HasPrefix (query , InnerSelectTableLimit_ ) {
4949 sql = "SELECT * FROM " + strings .ReplaceAll (query , InnerSelectTableLimit_ , "" ) + " LIMIT 100"
50+ } else if strings .HasPrefix (query , InnerDescribeTable_ ) {
51+ sql = "desc " + strings .ReplaceAll (query , InnerDescribeTable_ , "" )
5052 } else if query == InnerShowDatabases {
5153 sql = "SHOW DATABASES"
5254 } else if query == InnerShowTables {
@@ -59,8 +61,7 @@ func (m *mysqlDialect) ToNativeSQL(query string) (sql string) {
5961 return
6062}
6163
62- type postgresDialect struct {
63- }
64+ type postgresDialect struct {}
6465
6566func (p * postgresDialect ) ToNativeSQL (query string ) (sql string ) {
6667 if strings .HasPrefix (query , InnerSelectTable_ ) {
0 commit comments