camus-dump
camus-dump is a logical backup utility for CamusDB.
It connects to a CamusDB database, reads every table, and writes a SQL dump that can be replayed later to rebuild the schema and table data.
From the current source code, the tool:
- dumps the whole database
- emits
CREATE TABLEstatements - emits
INSERT INTOstatements for every row - writes the dump to standard output
Install
Install the global tool:
dotnet tool install --global CamusDB.Dump
The executable name is:
camus-dump
Basic Usage
Run with the built-in default connection:
camus-dump
From the current source code, the default connection string is:
Endpoint=https://localhost:7141;Database=test
Use an explicit connection string with -c when your node or database differs:
camus-dump -c "Endpoint=http://localhost:5095;Database=northwind"
The target database must already exist. camus-dump reads from an existing
database; it does not create one.
Command Line Options
Current options from source:
| Option | Description |
|---|---|
-c, --connection-source | Full connection string. |
There is no separate --database, --table, or output-file option in the
current implementation.
Save A Dump To A File
Because the tool writes SQL to standard output, redirect it in the shell:
camus-dump -c "Endpoint=http://localhost:5095;Database=mydb" > mydb.sql
What The Dump Contains
For each table returned by SHOW TABLES, the tool does two things:
- runs
SHOW CREATE TABLE <table> - runs
SELECT * FROM <table>
The output is a SQL stream with:
- one
CREATE TABLEstatement per table - one
INSERT INTOstatement per row
Typical shape:
CREATE TABLE `robots` (
`id` OID PRIMARY KEY NOT NULL,
`name` STRING NOT NULL,
`year` INT64
);
INSERT INTO `robots` (`id`, `name`, `year`) VALUES (STR_ID("507f1f77bcf86cd799439011"), "R2-D2", 1977);
INSERT INTO `robots` (`id`, `name`, `year`) VALUES (STR_ID("507f1f77bcf86cd799439012"), "C-3PO", 1977);
Value Encoding
From the current implementation:
OIDvalues are emitted asSTR_ID("...")- strings are double-quoted
- double quotes inside strings are escaped
INT64values are emitted as integersFLOAT64values are emitted as numeric literalsBOOLvalues are emitted asTrueorFalsefrom the .NET boolean string conversion- unknown or unsupported values fall back to
null
Restore A Dump
The utility does not include a restore command. To restore a dump, run the SQL
through camus-cli:
camus-cli -c "Endpoint=http://localhost:5095;Database=mydb"
Create the destination database first if it does not already exist:
CREATE DATABASE IF NOT EXISTS mydb;
use mydb;
Then load the generated file:
source ./mydb.sql
See camus-cli for shell usage.
Connection Behavior
Before dumping, the tool:
- builds a
CamusConnection - opens it
- runs a ping command
If the target is unreachable or the connection string is wrong, the dump fails before any output is produced.
Current Limitations
Documenting the current source behavior:
- no table filter
- no schema-only mode
- no data-only mode
- no output-file flag
- no compression
- no parallel dump
- no restore command
So while it is useful for straightforward logical backups, it is still a narrow utility.
When To Use It
Use camus-dump when you want:
- a quick logical backup of a CamusDB database
- SQL output that is easy to inspect
- a dump you can replay with
camus-cli
For interactive restore and manual replay, use camus-cli.