Closed fdncred closed 1 hour ago
I'm trying to update this nushell plugin to the latest published crates https://github.com/fdncred/nu_plugin_gitql
Hello @fdncred,
The new version has different type system outside the engine and not limited to enum of primitives so we can create advanced type safe queries like LLQL project
One solution is to write it like this
match value {
v if v.is_int() => {
rec.insert(column_name, NuValue::test_int(v.as_int().unwrap()));
}
v if v.is_float() => {
rec.insert(column_name, NuValue::test_float(v.as_float().unwrap()));
}
_ => {}
}
I will try to provide helper functions to deal with primitives like types, but i need to design a good way so SDK users can follow the same design for their types
ok. that's a little cleaner. I'll try that. yes, please, a helper function for this type of thing would be nice.
ok. that's a little cleaner. I'll try that. yes, please, a helper function for this type of thing would be nice.
Sure, if you have any suggestions feel free to share them
Thank you, and nice plugin
This is not really a feature request but it's also not a bug. It's more of a question.
After the most recent changes I'm having a hard time using the library because I can't figure out how to match on value.
I have something like this.
Which is kind of ugly and hard to read.
Previously I had something like this, which seemed much more intuitive.
I'd like to do something like this so I can match on the column_value and use the variable that comes with it in the match arm. Is there no way to do this any longer? I'm assuming I'm making this harder than it needs to be but I'm lost. Any help you could provide would be appreciated.