Merge with master

This commit is contained in:
Dan Sosedoff
2016-01-17 15:22:33 -06:00
10 changed files with 187 additions and 58 deletions

View File

@@ -141,6 +141,10 @@ func (client *Client) Table(table string) (*Result, error) {
return client.query(statements.PG_TABLE_SCHEMA, schema, table)
}
func (client *Client) MaterializedView(name string) (*Result, error) {
return client.query(statements.PG_MATERIALIZED_VIEW_SCHEMA, name)
}
func (client *Client) TableRows(table string, opts RowsOptions) (*Result, error) {
schema, table := getSchemaAndTable(table)
sql := fmt.Sprintf(`SELECT * FROM "%s"."%s"`, schema, table)
@@ -235,7 +239,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()