-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#3516] Support data field filter for JDBC based registry management API
Implement backend filter for H2 & Postgresql: - field/value filter - value filter of type bool/number/string - enable filter wildcards for string value - add documentation Also-by: Matthias Feurer <[email protected]> Signed-off-by: George Dimitropoulos <[email protected]>
- Loading branch information
1 parent
bb9e720
commit 3f2eee3
Showing
8 changed files
with
578 additions
and
285 deletions.
There are no files selected for viewing
495 changes: 273 additions & 222 deletions
495
...c/src/main/java/org/eclipse/hono/service/base/jdbc/store/device/TableManagementStore.java
Large diffs are not rendered by default.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
...-jdbc/src/main/resources/org/eclipse/hono/service/base/jdbc/store/device/base.h2.sql.yaml
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,23 @@ | ||
|
||
countDevicesOfTenantWithFilter: | | ||
SELECT COUNT(*) AS deviceCount FROM %1$s | ||
WHERE | ||
tenant_id=:tenant_id | ||
AND | ||
LOCATE(CONCAT_WS(':', :field, REPLACE(:value, '"')), REPLACE(data, '"')) | ||
OR | ||
REPLACE(data, '"') LIKE CONCAT('%%', :field, ':', REPLACE(:value, '"')) | ||
findDevicesOfTenantWithFilter: | | ||
SELECT * | ||
FROM %s | ||
WHERE | ||
tenant_id=:tenant_id | ||
AND | ||
LOCATE(CONCAT_WS(':', :field, REPLACE(:value, '"')), REPLACE(data, '"')) | ||
OR | ||
REPLACE(data, '"') LIKE CONCAT('%%', :field, ':', REPLACE(:value, '"')) | ||
ORDER BY device_id ASC | ||
LIMIT :page_size | ||
OFFSET :page_offset |
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
Oops, something went wrong.