Better support for BLOBs

- Limbo command line shell supports e.g. `SELECT x'616263';`
- `EXPLAIN SELECT x'616263';` lists the opcode

Missing:

- Command line shell not entirely compatible with SQLite when blobs have
  non-printable characters in the middle (e.g. `SELECT x'610062';`)
- Python bindings not supported (incoming soon)
This commit is contained in:
Lauri Virtanen
2024-09-22 16:44:33 +03:00
parent f23c668488
commit 0597c048fc
7 changed files with 67 additions and 12 deletions

View File

@@ -275,7 +275,9 @@ fn query(
Value::Integer(i) => print!("{}", i),
Value::Float(f) => print!("{:?}", f),
Value::Text(s) => print!("{}", s),
Value::Blob(b) => print!("{:?}", b),
Value::Blob(b) => {
print!("{}", String::from_utf8_lossy(b))
}
}
}
println!();
@@ -305,7 +307,9 @@ fn query(
Value::Integer(i) => i.to_string().cell(),
Value::Float(f) => f.to_string().cell(),
Value::Text(s) => s.cell(),
Value::Blob(b) => format!("{:?}", b).cell(),
Value::Blob(b) => {
format!("{}", String::from_utf8_lossy(b)).cell()
}
})
.collect(),
);