-
Notifications
You must be signed in to change notification settings - Fork 7
Disable LabKey caching of ResultSet by default #7711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
5714d8d
26acdd3
18dfa27
18d88e4
14df226
d7e6ae2
6b38f6c
23bee97
e4fef18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,7 +215,9 @@ private SimpleFilter getViewFilter(CustomView baseView) | |
| .columns(cols) | ||
| .filter(filter) | ||
| .sort(sort); | ||
| return select.select(); | ||
| // select(true): legacy callers (especially EHR modules) rely on the cached result set's full API, | ||
| // e.g. getRowMap(), which a streaming result set does not support | ||
| return select.select(true); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Boo |
||
| } | ||
|
|
||
| public Results select(SimpleFilter filter) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -239,36 +239,12 @@ UserSchema createLinkedSchema(User user, Container container, String name, Strin | |
|
|
||
| void saveCalculatedFieldsMetadata(String schemaName, String queryName, @Nullable String updatedQueryName, List<? extends GWTPropertyDescriptor> fields, boolean hasExistingFields, User user, Container container) throws MetadataUnavailableException; | ||
|
|
||
| /** | ||
| * Create a TableSelector for a LabKey sql query string. | ||
| * @param schema The query schema context used to parse the sql query in. | ||
| * @param sql The LabKey query string. | ||
| * @return a TableSelector | ||
| * | ||
| * superseded by {@link QueryService#getSelectBuilder} | ||
| */ | ||
| @NotNull | ||
| TableSelector selector(@NotNull QuerySchema schema, @NotNull String sql); | ||
|
|
||
| /** superseded by {@link QueryService#getSelectBuilder} */ | ||
| default ResultSet select(QuerySchema schema, String sql) | ||
| { | ||
| return select(schema, sql, null, false, true); | ||
| } | ||
|
|
||
| /* strictColumnList requires that query not add any addition columns to the query result */ | ||
| Results select(QuerySchema schema, String sql, @Nullable Map<String, TableInfo> tableMap, boolean strictColumnList, boolean cached); | ||
|
|
||
| /** superseded by {@link QueryService#getSelectBuilder} */ | ||
| default Results select(TableInfo table, Collection<ColumnInfo> columns, @Nullable Filter filter, @Nullable Sort sort) | ||
| { | ||
| return getSelectBuilder(table).columns(columns).filter(filter).sort(sort).select(); | ||
| } | ||
|
|
||
| SelectBuilder getSelectBuilder(TableInfo table); | ||
| SelectBuilder getSelectBuilder(QuerySchema schema, String sql); | ||
| /** Use when the query must not return extra hidden sort columns (e.g. HTTP endpoints that reflect column names to callers). */ | ||
| SelectBuilder getSelectBuilder(QuerySchema schema, String sql, boolean strictColumnList); | ||
| /** The tableMap binds named table references in the SQL (e.g. "__DATA") to TableInfos. It must be supplied here before the SQL is parsed. */ | ||
| SelectBuilder getSelectBuilder(QuerySchema schema, String sql, boolean strictColumnList, @Nullable Map<String, TableInfo> tableMap); | ||
|
|
||
| MutableColumnInfo createQueryExpressionColumn(TableInfo table, FieldKey key, String labKeySql, ColumnType columnType); | ||
| MutableColumnInfo createQueryExpressionColumn(TableInfo table, FieldKey key, FieldKey wrapped, ColumnType columnType); | ||
|
|
@@ -279,7 +255,7 @@ default Results select(TableInfo table, Collection<ColumnInfo> columns, @Nullabl | |
| Collection<CompareType> getCompareTypes(); | ||
|
|
||
| /** | ||
| * Gets all of the custom views from the given relative path defined in the set of active modules for the | ||
| * Gets all the custom views from the given relative path defined in the set of active modules for the | ||
| * given container. | ||
| * @param container Container to use to figure out the set of active modules | ||
| * @param qd the query for which views should be fetched | ||
|
|
@@ -692,15 +668,19 @@ default SelectBuilder columns(ColumnInfo... cols) | |
| SelectBuilder jdbcCaching(boolean jdbcCaching); | ||
|
|
||
| SQLFragment buildSqlFragment(); | ||
| SqlSelector buildSqlSelector(); | ||
| default SqlSelector buildSqlSelector() | ||
| { | ||
| return buildSqlSelector(Map.of()); | ||
| } | ||
| SqlSelector buildSqlSelector(@NotNull Map<String, Object> parameters); | ||
| Results select(boolean labkeyCachedResultSet, @NotNull Map<String, Object> parameters); | ||
| default Results select(boolean labkeyCachedResultSet) | ||
| { | ||
| return select(labkeyCachedResultSet, Map.of()); | ||
| } | ||
| default Results select() | ||
| { | ||
| return select(true); | ||
| return select(false); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe too late for this, but it would be nice to replace the various boolean parameters with enums that elucidate the behaviors.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea for next time. |
||
| } | ||
|
|
||
| QueryLogging getQueryLogging(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want
getSelectBuilder()to take aSQLFragment?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@labkey-matthewb and I discussed this. Ultimately, we want it to take a
LabKeySQLFragmentor similar and keepSQLFragmentfor raw DB SQL.