The primary way to interact with τ is by running the database server and connecting to it with a client. The project provides a simple REPL (Read-Eval-Print Loop) client for direct interaction.
Running the Server
The τ server is the core component that manages data and processes commands. You can build and run the server using a single zig build command from the root of the tau-db project.
1zig build run-serverBy default, the server will start and listen for connections on 127.0.0.1:7828.
When the server is running, you'll see output similar to this, indicating it's ready to accept client connections:
1[info] Server listening on 127.0.0.1:7828The server runs in the foreground. To stop it, press Ctrl+C.
Refer to the Storage Backends documentation to learn how to configure persistent storage for the server.
Using the REPL Client
The REPL client is a command-line tool that allows you to send commands to a running τ server.
To build and run the REPL, open a new terminal window and execute:
1zig build run-replThis will start the REPL, and you'll be greeted with a τ> prompt.
Connecting to the Server
The first step in the REPL is to connect to the database server. Use the .connect command:
1τ> .connectIf the connection is successful, you will see a confirmation message:
1τ> .connect
2Connected to 127.0.0.1:7828
3τ>Sending Commands
Once connected, you can send any valid database command to the server. For example, to ping the server:
1τ> PING
2PONG
3τ>To learn about all available commands, see the API Commands reference.
Quitting the REPL
To exit the REPL client, use the .quit command or press Ctrl+D.
1τ> .quit
2Goodbye!