-
Notifications
You must be signed in to change notification settings - Fork 103
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
refactor(c/driver/framework): Remove fmt as required dependency of the driver framework #2081
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d725bef
maybe remove fmt as mandatory for framework
paleolimbot c5ec3d0
fix some internal usage
paleolimbot 18db306
driver builds
paleolimbot a86ef8f
fix sqlite errors
paleolimbot 682e28c
basic check for wires plugged in on framework based driver
paleolimbot dc96778
format
paleolimbot 2f235a2
maybe fix option formatting
paleolimbot e7b16ec
maybe fix key/value formatting
paleolimbot a9f0aa1
separate getinfo implementation
paleolimbot 463ab54
move get_table_types to catalog.cc
paleolimbot 71c12d1
move objects helper to objects.cc
paleolimbot aba5685
maybe move all nanoarrow out of headers
paleolimbot d90c4dd
remove extra c++ helpers from nanoarrow.hpp
paleolimbot 10e20af
update nanoarrow hpp
paleolimbot 89dd53d
use deltype
paleolimbot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -29,7 +29,7 @@ Result<bool> Option::AsBool() const { | |||||
return false; | ||||||
} | ||||||
} | ||||||
return status::InvalidArgument("Invalid boolean value {}", *this); | ||||||
return status::InvalidArgument("Invalid boolean value ", this->Format()); | ||||||
}, | ||||||
value_); | ||||||
} | ||||||
|
@@ -46,15 +46,15 @@ Result<int64_t> Option::AsInt() const { | |||||
auto end = value.data() + value.size(); | ||||||
auto result = std::from_chars(begin, end, parsed); | ||||||
if (result.ec != std::errc()) { | ||||||
return status::InvalidArgument("Invalid integer value '{}': not an integer", | ||||||
value); | ||||||
return status::InvalidArgument("Invalid integer value '", value, | ||||||
"': not an integer", value); | ||||||
} else if (result.ptr != end) { | ||||||
return status::InvalidArgument("Invalid integer value '{}': trailing data", | ||||||
value); | ||||||
return status::InvalidArgument("Invalid integer value '", value, | ||||||
"': trailing data", value); | ||||||
} | ||||||
return parsed; | ||||||
} | ||||||
return status::InvalidArgument("Invalid integer value {}", *this); | ||||||
return status::InvalidArgument("Invalid integer value ", this->Format()); | ||||||
}, | ||||||
value_); | ||||||
} | ||||||
|
@@ -66,7 +66,24 @@ Result<std::string_view> Option::AsString() const { | |||||
if constexpr (std::is_same_v<T, std::string>) { | ||||||
return value; | ||||||
} | ||||||
return status::InvalidArgument("Invalid string value {}", *this); | ||||||
return status::InvalidArgument("Invalid string value {}", this->Format()); | ||||||
}, | ||||||
value_); | ||||||
} | ||||||
|
||||||
std::string Option::Format() const { | ||||||
return std::visit( | ||||||
[&](auto&& value) { | ||||||
using T = std::decay_t<decltype(value)>; | ||||||
if constexpr (std::is_same_v<T, adbc::driver::Option::Unset>) { | ||||||
return std::string("(NULL)"); | ||||||
} else if constexpr (std::is_same_v<T, std::string>) { | ||||||
return std::string("'") + value + "'"; | ||||||
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.
Suggested change
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. I thought the general advice is that stringstream is really slow? (It's also another header...) I'd rather keep the concat |
||||||
} else if constexpr (std::is_same_v<T, std::vector<uint8_t>>) { | ||||||
return std::string("(") + std::to_string(value.size()) + " bytes)"; | ||||||
} else { | ||||||
return std::to_string(value); | ||||||
} | ||||||
}, | ||||||
value_); | ||||||
} | ||||||
|
@@ -157,4 +174,5 @@ AdbcStatusCode Option::CGet(double* out, AdbcError* error) const { | |||||
}, | ||||||
value_); | ||||||
} | ||||||
|
||||||
} // namespace adbc::driver |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: is the explicit string necessary? (You could declare the lambda to return string, and/or use string_literals?)