Files
nushell/crates/nu_plugin_to_sqlite/src/nu/mod.rs
Jonathan Turner d8594a62c2 Add wasm support (#2199)
* Working towards a PoC for wasm

* Move bson and sqlite to plugins

* proof of concept now working

* tests are green

* Add CI test for --no-default-features

* Fix some tests

* Fix clippy and windows build

* More fixes

* Fix the windows build

* Fix the windows test
2020-07-18 13:59:23 +12:00

26 lines
669 B
Rust

#[cfg(test)]
mod tests;
use crate::ToSqlite;
use nu_errors::ShellError;
use nu_plugin::Plugin;
use nu_protocol::{ReturnValue, Signature, Value};
use nu_source::Tag;
impl Plugin for ToSqlite {
fn config(&mut self) -> Result<Signature, ShellError> {
Ok(Signature::build("to sqlite")
.desc("Convert table into sqlite binary")
.filter())
}
fn filter(&mut self, input: Value) -> Result<Vec<ReturnValue>, ShellError> {
self.state.push(input);
Ok(vec![])
}
fn end_filter(&mut self) -> Result<Vec<ReturnValue>, ShellError> {
crate::to_sqlite::to_sqlite(self.state.clone(), Tag::unknown())
}
}