After fixing the shell issue earlier I just had to revisit this. Let me
know if this is too opinionated of changes or out of scope.
This PR adds several of the sqlite CLI commands to the limbo shell user
interface, with their behavior matched as much as possible.
- `.show`: displays a list of currently enabled settings
- `.open <file>` : opens a database file
- `.output <file>`: allows the user to direct shell output to a file, or
stdout if left blank
- `.cd <dir>`: changes the current working directory of the shell
environment
- `.mode <output_mode>`: allows the user to select between the (two)
current output modes "pretty | raw"
- `.nullvalue <string>`: allows user to set the value of NULL to be
displayed in the output
It also prevents a database file argument from needing to being passed
as an argv[1], but alerts the user that no database was selected, while
allowing them to `.open` a database file with a dot command.


This PR also restructures the CLI crate a bit, to make future commands a
bit easier to add.
Reviewed-by: Pekka Enberg <pere-altea@hotmail.com>
Closes#462
Since we expect to ensure thread safety between multiple threads in the
future, we extract what is important to be shared between multiple
connections with regards to WAL/Pager.
This is WIP so I just put whatever feels like important behind a RwLock
but expect this to change to Atomics in the future as needed. Maybe even
these locks might disappear because they will be better served with
transaction locks.
This also includes addition of unsafe Sync/Send + UnsafeCell in Pages.
Closes#415
This includes an inner struct in Page wrapped with Unsafe cell to access
it. This is done intentionally because concurrency control of pages is
handled by pages and not by the page itself.
Since we expect to ensure thread safety between multiple threads in the
future, we extract what is important to be shared between multiple
connections with regards to WAL.
This is WIP so I just put whatever feels like important behind a RwLock
but expect this to change to Atomics in the future as needed. Maybe even
these locks might disappear because they will be better served with
transaction locks.
I'd love to contribute to Limbo, but wrapping my head around the whole
project is hard.
I decided to start by creating a diagram of a typical flow so that other
potential contributors might have an easier time :)
LMK if this is useful, I can create more of those when I dig deeper.
Closes#456