Skip to main content

User Setup

It is recommended to create a dedicated metadb user to run the server:
sudo useradd -m metadb
sudo su - metadb
The server should run as this user, for example in /home/metadb.

Building from Source

1

Set GOPATH environment variable

Configure the Go build workspace:
export GOPATH=$HOME/go
2

Clone the repository

Clone the Metadb source code and check out the desired version:
git clone https://github.com/metadb-project/metadb.git -b v1.4.0
3

Build the server

Compile the server using the build script:
cd metadb
./build
The build script creates a bin/ subdirectory with the metadb executable.
4

Verify installation

Test that the executable was built successfully:
./bin/metadb help

Command Structure

In general, running metadb takes the form:
metadb <command> <arguments>

Common Commands

  • init - Initializes a new Metadb instance
  • start - Starts the server
  • stop - Shuts down the server
  • upgrade - Upgrades a Metadb instance to the current version
  • sync - Begins synchronization with a data source
  • endsync - Ends synchronization and cleans up stale data
  • version - Prints the Metadb version

Getting Help

For more information about a specific command:
metadb help <command>

Connecting to the Server

The PostgreSQL terminal-based client psql is used to connect to a Metadb server:
psql -X -h localhost -d metadb -p <port>
For example, using the default port:
psql -X -h localhost -d metadb -p 8550
Metadb implements part of the PostgreSQL communication protocol to allow psql to be used as a client. It is not a full database system.
See the Reference > Statements section for commands that can be issued via psql.

Build docs developers (and LLMs) love