* g4 code generation * Update grammar * g4 code generation * fix #2108 * fix #2102 * Remove comments
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user