15 const std::string blob_string{arguments.
get_next(
"<blob_string>")};
20 std::cerr <<
"This program will try to connect to a local server.\n";
21 std::cerr <<
"Before running this program, start a joedb server with:\n";
22 std::cerr <<
"joedb_server blobs.joedb\n";
23 std::cerr <<
"You can interactively read and write blobs this way:\n";
24 std::cerr <<
"joedb_client --db none server local blobs.joedb.sock\n";
39 for (
int i = 3; --i >= 0;)
41 const joedb::Blob blob = lock.get_journal().write_blob(blob_string);
42 lock.checkpoint_and_push();
43 std::cout <<
"wrote blob with lock: ";
45 std::cout <<
"\nblob: " << server_file.read_blob(blob) <<
'\n';
52 for (
int i = 3; --i >= 0;)
58 std::cout <<
"wrote blob with transaction: ";
60 std::cout <<
"\nblob: " << server_file.read_blob(blob) <<
'\n';
66int main(
int argc,
char **argv)
Class for conveniently parsing command-line arguments.
std::string_view get_next()
std::ostream & print_help(std::ostream &out) const
Directly read file served from joedb_server.
Blob write_blob(const std::string &data) override
int main_wrapper(int(*main)(Arguments &), int argc, char **argv)
Process command-line arguments and catch exceptions from main.
void write_blob(std::ostream &out, Blob blob)