Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.

Commit 9ef0ffd

Browse files
author
AllenInstitute
committed
Adding 'with' clause support.
1 parent 081ae88 commit 9ef0ffd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/etl/control/source/database_source.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ def order
7575
configuration[:order]
7676
end
7777

78+
# Get the with clause for the query, defaults to nil
79+
def with
80+
configuration[:with]
81+
end
82+
7883
# Return the column which is used for in the where clause to identify
7984
# new rows
8085
def new_records_only
@@ -169,6 +174,8 @@ def write_local(file)
169174
# Get the query to use
170175
def query
171176
return @query if @query
177+
q = ''
178+
q << "#{with}" if with
172179
q = "SELECT #{select} FROM #{@table}"
173180
q << " #{join}" if join
174181

0 commit comments

Comments
 (0)