-
Notifications
You must be signed in to change notification settings - Fork 34
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
adds implementation of Catalog
#448
Conversation
Codecov Report
@@ Coverage Diff @@
## main #448 +/- ##
=======================================
Coverage 83.56% 83.57%
=======================================
Files 85 87 +2
Lines 16400 16479 +79
=======================================
+ Hits 13705 13772 +67
- Misses 2695 2707 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
fn get_table(&self, name: &str) -> IonResult<SharedSymbolTable>; | ||
/// Returns the Shared Symbol Table with given table name and version | ||
/// If a table with given name and version doesn't exists then it returns an error | ||
fn get_table_with_version(&self, name: &str, version: usize) -> IonResult<SharedSymbolTable>; |
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.
Do we need a get_latest_version
? (This will depend on whether we allow inexact matches at import time.)
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.
get_table_with_name
returns the latest version of the table based on given table name.
src/catalog.rs
Outdated
|
||
let versions: &BTreeMap<usize, SharedSymbolTable> = | ||
self.tables_by_name.get(name).ok_or_else(|| { | ||
illegal_operation_raw(format!("Symbol table with name: {} does not exist", name)) |
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.
illegal_operation
feels off for this since the user isn't doing anything wrong, but I think it's the closest variant we currently have in IonError
. 🤔
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.
I am open to adding a new Error variant in IonError
if that makes sense to you. Maybe get_shared_symbol_table_error
or catalog_error
or shared_symbol_table_error
?
Description of changes:
This PR works on adding implementation of
Catalog
.List of changes:
SharedSymbolTable
Catalog
Catalog
,MutableCatalog
SimpleCatalog
Test:
Catalog
implementation.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.