Return empty rows collection if query does not have any rows

This commit is contained in:
Dan Sosedoff 2016-01-17 15:05:57 -06:00
parent 3167d96cfc
commit 4844270f0b
3 changed files with 9 additions and 3 deletions

View File

@ -205,7 +205,10 @@ func (client *Client) query(query string, args ...interface{}) (*Result, error)
return nil, err
}
result := Result{Columns: cols}
result := Result{
Columns: cols,
Rows: []Row{},
}
for rows.Next() {
obj, err := rows.SliceScan()

File diff suppressed because one or more lines are too long

View File

@ -546,6 +546,9 @@ function buildTableFilters(name, type) {
if (data.rows.length == 0) {
$("#pagination .filters").hide();
}
else {
$("#pagination .filters").show();
}
$("#pagination select.column").html("<option value='' selected>Select column</option>");