* g4 code generation

* Update grammar

* g4 code generation

* fix #2108

* fix #2102

* Remove comments
This commit is contained in:
anqiansong
2022-07-20 22:49:41 +08:00
committed by GitHub
parent d9218e1551
commit 1b51d0ce82
24 changed files with 2481 additions and 2288 deletions

View File

@@ -26,6 +26,7 @@ type (
DbColumn struct {
Name string `db:"COLUMN_NAME"`
DataType string `db:"DATA_TYPE"`
ColumnType string `db:"COLUMN_TYPE"`
Extra string `db:"EXTRA"`
Comment string `db:"COLUMN_COMMENT"`
ColumnDefault interface{} `db:"COLUMN_DEFAULT"`
@@ -87,7 +88,7 @@ func (m *InformationSchemaModel) GetAllTables(database string) ([]string, error)
// FindColumns return columns in specified database and table
func (m *InformationSchemaModel) FindColumns(db, table string) (*ColumnData, error) {
querySql := `SELECT c.COLUMN_NAME,c.DATA_TYPE,EXTRA,c.COLUMN_COMMENT,c.COLUMN_DEFAULT,c.IS_NULLABLE,c.ORDINAL_POSITION from COLUMNS c WHERE c.TABLE_SCHEMA = ? and c.TABLE_NAME = ? `
querySql := `SELECT c.COLUMN_NAME,c.DATA_TYPE,c.COLUMN_TYPE,EXTRA,c.COLUMN_COMMENT,c.COLUMN_DEFAULT,c.IS_NULLABLE,c.ORDINAL_POSITION from COLUMNS c WHERE c.TABLE_SCHEMA = ? and c.TABLE_NAME = ? `
var reply []*DbColumn
err := m.conn.QueryRowsPartial(&reply, querySql, db, table)
if err != nil {