-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cat-gateway): Catalyst singed Documents indexing
POST
endpoint (…
…#1576) * update query limits * fix * wip * fix * update test * fix * wip * initial TryFrom<DocumentIndexQueryFilter> for DocsQueryFilter impl * fix spelling * fix * wip * wip * fix * add metadata field for query_filter * wip * wip * wip * fix * fix * add TODO comments * fix typo * update with the latest cat-signed-doc crate * update hurl * invalid redundant Errors doc section --------- Co-authored-by: Steven Johnson <[email protected]>
- Loading branch information
Showing
18 changed files
with
447 additions
and
136 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
27 changes: 27 additions & 0 deletions
27
catalyst-gateway/bin/src/db/event/common/eq_or_ranged_uuid.rs
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,27 @@ | ||
//! `EqOrRangedUuid` query conditional stmt object. | ||
/// Search either by a singe UUID, or a Range of UUIDs | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub(crate) enum EqOrRangedUuid { | ||
/// Search by the exact UUID | ||
Eq(uuid::Uuid), | ||
/// Search in this UUID's range | ||
Range { | ||
/// Minimum UUID to find (inclusive) | ||
min: uuid::Uuid, | ||
/// Maximum UUID to find (inclusive) | ||
max: uuid::Uuid, | ||
}, | ||
} | ||
|
||
impl EqOrRangedUuid { | ||
/// Return a sql conditional statement by the provided `table_field` | ||
pub(crate) fn conditional_stmt(&self, table_field: &str) -> String { | ||
match self { | ||
Self::Eq(id) => format!("{table_field} = '{id}'"), | ||
Self::Range { min, max } => { | ||
format!("{table_field} >= '{min}' AND {table_field} <= '{max}'") | ||
}, | ||
} | ||
} | ||
} |
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,3 +1,4 @@ | ||
//! Reusable common database objects | ||
pub(crate) mod eq_or_ranged_uuid; | ||
pub(crate) mod query_limits; |
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
Oops, something went wrong.