TableColumns returns all column names of a single table by its name.
(tableName string)
| 9 | |
| 10 | // TableColumns returns all column names of a single table by its name. |
| 11 | func (app *BaseApp) TableColumns(tableName string) ([]string, error) { |
| 12 | columns := []string{} |
| 13 | |
| 14 | err := app.ConcurrentDB().NewQuery("SELECT name FROM PRAGMA_TABLE_INFO({:tableName})"). |
| 15 | Bind(dbx.Params{"tableName": tableName}). |
| 16 | Column(&columns) |
| 17 | |
| 18 | return columns, err |
| 19 | } |
| 20 | |
| 21 | type TableInfoRow struct { |
| 22 | // the `db:"pk"` tag has special semantic so we cannot rename |
nothing calls this directly
no test coverage detected