Merge branch 'update-readme' into 'main'
Update README.md See merge request x433485/minisql!41
This commit is contained in:
commit
0702f4e3e1
1 changed files with 14 additions and 12 deletions
26
README.md
26
README.md
|
|
@ -15,28 +15,29 @@
|
|||
|
||||
## Running the server
|
||||
```bash
|
||||
cargo run -p server -- [OPTIONS] --file <FILE>
|
||||
cargo run -p server -- [OPTIONS] --folder <FOLDER>
|
||||
```
|
||||
```
|
||||
Options:
|
||||
-a, --address <ADDRESS> IP address for the server to listen on [default: 127.0.0.1]
|
||||
-p, --port <PORT> Port for the server to listen on [default: 5432]
|
||||
-f, --file <FILE> Path to the data file
|
||||
-f, --folder <FOLDER> Path to the folder for database data
|
||||
-t, --throttle <DELAY> Delay between rows in milliseconds
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
This will start the server listening on `<ADDRESS>:<PORT>` and load the state from `<FILE>`.
|
||||
If the `<FILE>` does not exist, it will be created.
|
||||
This will start the server listening on `<ADDRESS>:<PORT>` and load the state from `<FOLDER>`.
|
||||
If the `<FOLDER>` 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`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue