-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change queries to ones that encourage quickly transforming results so…
… that connections can be closed Allow a "streaming" version of queries to use the old style of streaming rows directly
- Loading branch information
Showing
17 changed files
with
102 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...undation/stack/datamill/LimitBuilder.java → ...ation/stack/datamill/db/LimitBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
core/src/main/java/foundation/stack/datamill/db/QueryBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
core/src/main/java/foundation/stack/datamill/db/QueryRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import rx.Observable; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface QueryRunner { | ||
Observable<Row> query(String sql); | ||
Observable<Row> query(String sql, Object... parameters); | ||
ResultBuilder query(String sql); | ||
ResultBuilder query(String sql, Object... parameters); | ||
UpdateQueryExecution update(String sql, Object... parameters); | ||
} |
15 changes: 15 additions & 0 deletions
15
core/src/main/java/foundation/stack/datamill/db/ResultBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import rx.Observable; | ||
import rx.functions.Func1; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface ResultBuilder { | ||
<T> Observable<List<T>> getAs(Func1<Row, T> transformer); | ||
<T> Observable<T> getFirstAs(Func1<Row, T> transformer); | ||
Observable<Row> stream(); | ||
} |
5 changes: 2 additions & 3 deletions
5
core/src/main/java/foundation/stack/datamill/db/SelectBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
package foundation.stack.datamill.db; | ||
|
||
import foundation.stack.datamill.reflection.Outline; | ||
import rx.Observable; | ||
|
||
/** | ||
* @author Ravi Chodavarapu (rchodava@gmail.com) | ||
*/ | ||
public interface SelectBuilder { | ||
SelectWhereBuilder<Observable<Row>> from(String table); | ||
SelectWhereBuilder<Observable<Row>> from(Outline<?> outline); | ||
SelectWhereBuilder<ResultBuilder> from(String table); | ||
SelectWhereBuilder<ResultBuilder> from(Outline<?> outline); | ||
} |
1 change: 0 additions & 1 deletion
1
core/src/main/java/foundation/stack/datamill/db/SelectLimitBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
core/src/main/java/foundation/stack/datamill/db/UpdateBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
core/src/main/java/foundation/stack/datamill/db/WhereBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters