17 const std::string blob_string{arguments.
get_next(
"<blob_string>")};
22 std::cerr <<
"This program will try to connect to a local server.\n";
23 std::cerr <<
"Before running this program, start a joedb server with:\n";
24 std::cerr <<
"joedb_server blobs.joedb\n";
25 std::cerr <<
"You can interactively read and write blobs this way:\n";
26 std::cerr <<
"joedb_client --db none server local blobs.joedb.sock\n";
41 for (
int i = 3; --i >= 0;)
43 const joedb::Blob blob = lock.get_journal().write_blob(blob_string);
44 lock.checkpoint_and_push();
45 std::cout <<
"wrote blob with lock: ";
47 std::cout <<
"\nblob: " << server_file.read_blob(blob) <<
'\n';
54 for (
int i = 3; --i >= 0;)
60 std::cout <<
"wrote blob with transaction: ";
62 std::cout <<
"\nblob: " << server_file.read_blob(blob) <<
'\n';
68int 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)