Skip to content

Commit 0d0a331

Browse files
author
Ian Pye
committed
Adding ability to export select sql
1 parent ec3ea95 commit 0d0a331

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cube/pg/table.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ func (t *Table) CreateTemporaryCopyTableSql(p Partition) string {
258258
return fmt.Sprintf("CREATE TEMP TABLE %s (LIKE %s INCLUDING ALL) ON COMMIT DROP", t.GetTemporaryCopyTableName(p), p.GetTableName(t.BaseTableName()))
259259
}
260260

261+
func (t *Table) SelectFromTableSql(where *string, limit *string, offset *string) string {
262+
return fmt.Sprintf("SELECT %s FROM %s %s %s %s", t.ListColumnsSql(), t.ForeignTablesViewName(),
263+
*where, *limit, *offset)
264+
}
265+
261266
func (t *Table) CopyTableSql(p Partition) string {
262267
return fmt.Sprintf("COPY %s FROM STDIN", t.GetTemporaryCopyTableName(p))
263268
}

0 commit comments

Comments
 (0)