Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PumPum7 committed Oct 25, 2024
1 parent 1b4ef8c commit 4844178
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,22 @@ use std::error::Error;
mod server;
use server::Server;

fn print_header() {
println!(
r#"
____ _ _
| _ \ __ _| |_ __ _| |__ __ _ ___ ___
| | | |/ _` | __/ _` | '_ \ / _` / __|/ _ \
| |_| | (_| | || (_| | |_) | (_| \__ \ __/
|____/ \__,_|\__\__,_|_.__/ \__,_|___/\___|
"#
);
}

fn main() -> Result<(), Box<dyn Error>> {
println!("SQLite-like Database Engine Starting...");
print_header();
println!("Starting database server");

// Create or open database
let db = match Database::new("test.db") {
Expand Down
2 changes: 1 addition & 1 deletion src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fn handle_command(
}
let key = parts[1].parse::<i32>()?;
let value = parse_value(parts[2])?;
db.update(key, value)?;
db.update(key, &value)?;
Ok("OK\n".to_string())
}
"ALL" => {
Expand Down

0 comments on commit 4844178

Please sign in to comment.