mirror of
https://github.com/nushell/nushell
synced 2025-01-14 14:14:13 +00:00
sqlite query without collect (#6217)
This commit is contained in:
parent
233afebdf0
commit
e7958bebac
1 changed files with 15 additions and 10 deletions
|
@ -366,16 +366,21 @@ impl CustomValue for SQLiteDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn to_base_value(&self, span: Span) -> Result<Value, ShellError> {
|
fn to_base_value(&self, span: Span) -> Result<Value, ShellError> {
|
||||||
let db = open_sqlite_db(self.connection.as_path(span)?, span)?;
|
match self.statement {
|
||||||
read_entire_sqlite_db(db, span).map_err(|e| {
|
None => {
|
||||||
ShellError::GenericError(
|
let db = open_sqlite_db(self.connection.as_path(span)?, span)?;
|
||||||
"Failed to read from SQLite database".into(),
|
read_entire_sqlite_db(db, span).map_err(|e| {
|
||||||
e.to_string(),
|
ShellError::GenericError(
|
||||||
Some(span),
|
"Failed to read from SQLite database".into(),
|
||||||
None,
|
e.to_string(),
|
||||||
Vec::new(),
|
Some(span),
|
||||||
)
|
None,
|
||||||
})
|
Vec::new(),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Some(_) => self.collect(span),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn as_any(&self) -> &dyn std::any::Any {
|
fn as_any(&self) -> &dyn std::any::Any {
|
||||||
|
|
Loading…
Reference in a new issue