forked from extern/nushell
Fix to json
for SQLite databases (#8343)
Fixes #8341. The `CustomValue::to_json()` function is an odd duck; it defaults to returning `null`, and no `CustomValue` implementations override it to do anything useful. I forgot to implement `to_json()` for `SQLiteDatabase`, so `open foo.db | to json` was returning `null`. To fix this, I've removed `CustomValue::to_json()` and now `to json` will collect a `CustomValue` into a regular `Value` before doing a JSON conversion.
This commit is contained in:
@ -17,11 +17,6 @@ pub trait CustomValue: fmt::Debug + Send + Sync {
|
||||
// That already exist in nushell
|
||||
fn to_base_value(&self, span: Span) -> Result<Value, ShellError>;
|
||||
|
||||
// Json representation of custom value
|
||||
fn to_json(&self) -> nu_json::Value {
|
||||
nu_json::Value::Null
|
||||
}
|
||||
|
||||
// Any representation used to downcast object to its original type
|
||||
fn as_any(&self) -> &dyn std::any::Any;
|
||||
|
||||
|
Reference in New Issue
Block a user