mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-23 09:54:26 +01:00
Rough design for extension api/draft extension
This commit is contained in:
14
cli/app.rs
14
cli/app.rs
@@ -323,14 +323,8 @@ impl Limbo {
|
||||
};
|
||||
}
|
||||
|
||||
fn handle_load_extension(&mut self) -> Result<(), String> {
|
||||
let mut args = self.input_buff.split_whitespace();
|
||||
let _ = args.next();
|
||||
let lib = args
|
||||
.next()
|
||||
.ok_or("No library specified")
|
||||
.map_err(|e| e.to_string())?;
|
||||
self.conn.load_extension(lib).map_err(|e| e.to_string())
|
||||
fn handle_load_extension(&mut self, path: &str) -> Result<(), String> {
|
||||
self.conn.load_extension(path).map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
fn display_in_memory(&mut self) -> std::io::Result<()> {
|
||||
@@ -557,8 +551,8 @@ impl Limbo {
|
||||
};
|
||||
}
|
||||
Command::LoadExtension => {
|
||||
if let Err(e) = self.handle_load_extension() {
|
||||
let _ = self.writeln(e.to_string());
|
||||
if let Err(e) = self.handle_load_extension(args[1]) {
|
||||
let _ = self.writeln(&e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user