go-programming-tour-book/tour

query建议使用 ` ` 引用

LaChimere opened this issue · 0 comments

query := "SELECT COLUMN_NAME, DATA_TYPE, COLUMN_KEY, " +

建议改为

query := `SELECT COLUMN_NAME, DATA_TYPE, COLUMN_KEY,
		IS_NULLABLE, COLUMN_TYPE, COLUMN_COMMENT 
		FROM COLUMNS WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?`

如果使用 " " 引号,可能出现 dbModel: GetColumns err: Error 1054: Unknown column '...' in 'field list'的 error