From b7c16b40735274ba475828c2225eb96141932eca Mon Sep 17 00:00:00 2001 From: Maxim Svistunov Date: Mon, 5 Feb 2024 23:49:05 +0100 Subject: [PATCH] Update README.md --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 00c3e56..7cbbf99 100644 --- a/README.md +++ b/README.md @@ -15,28 +15,29 @@ ## Running the server ```bash -cargo run -p server -- [OPTIONS] --file +cargo run -p server -- [OPTIONS] --folder ``` ``` Options: -a, --address
IP address for the server to listen on [default: 127.0.0.1] -p, --port Port for the server to listen on [default: 5432] - -f, --file Path to the data file + -f, --folder Path to the folder for database data + -t, --throttle Delay between rows in milliseconds -h, --help Print help ``` -This will start the server listening on `
:` and load the state from ``. -If the `` does not exist, it will be created. +This will start the server listening on `
:` and load the state from ``. +If the `` does not exist, it will be created. ### Demo Database -A database with demo data is available in `demo.json`. To run the server with this database, use: -```bash -cargo run -p server -- --file demo.json -``` +Commands that set up a database with demo data are available in `demo-1.sql`, `demo-2.sql`, and `demo-3.sql`. -This database contains two tables: -- Table `users` with columns `id`, `name`, `surname`, `email` -- Table `cars` with columns `id`, `vid`, `brand`, `model`, `year` +These files showcase the following things: +- `demo-1.sql`: small tables that handle Unicode and make use of the Optional type +- `demo-2.sql`: a bigger (1000 rows) table with realistic data +- `demo-3.sql`: a big (10,000 rows) table with simple data (was easier to generate) + +See comments in these files for details. ## Running the client ```bash @@ -56,7 +57,7 @@ SQL queries can be entered line by line. The client will print the result of eac To exit the REPL client, enter `exit` or `quit`. # Features -- SQL must be on single line, in **UPPERCASE** and end with `;`, as it should be +- SQL must be on single line, in **UPPERCASE**, as it should be. The `;` at EOL is optional. - Supported operations: `CREATE TABLE`, `CREATE INDEX`, `SELECT`, `INSERT`, `DELETE` - Supported data types: `UUID`, `STRING`, `INT`, `NUMBER` - Supported subset of PostgreSQL protocol, without authentication and simple query flow @@ -129,6 +130,7 @@ DELETE FROM users WHERE name = "Christina"; - `STRING` - string enclosed in double quotes, e.g. `"Hello World"` - `INT` - integer, e.g. `12345` - `NUMBER` - floating point number, e.g. `123.45` +- `Option(Something)` - optional type, e.g. `Some("james.stuart@gmail.com")` or `None` ## Testing with `psql` Thanks to the subset of PostgreSQL protocol implemented in `proto`, the server can be tested with `psql`,