2 unstable releases

0.3.0 Jun 7, 2022
0.1.0 Mar 28, 2022

#3 in #log-management

Download history 20/week @ 2023-10-25 16/week @ 2023-11-01 17/week @ 2023-11-08 22/week @ 2023-11-15 21/week @ 2023-11-22 16/week @ 2023-11-29 17/week @ 2023-12-06 17/week @ 2023-12-13 18/week @ 2023-12-20 14/week @ 2023-12-27 12/week @ 2024-01-03 17/week @ 2024-01-10 17/week @ 2024-01-17 11/week @ 2024-01-24 9/week @ 2024-01-31 16/week @ 2024-02-07

57 downloads per month
Used in 4 crates

AGPL-3.0-or-later

730KB
16K SLoC

quickwit-metastore

Setup the environment.

Install libpg-dev and diesel_cli

If you do not have libpg-dev and diesel_cli installed, please install them with the following command.

% sudo apt install libpq-dev
% cargo install diesel_cli --no-default-features --features postgres 

Setup Diesel for quickwit-metastore

Let's set up the environment using diesel_cli. First, run the following command to start PostgreSQL using Docker.

$ docker-compose up -d

After PostgreSQL has been successfully started, you can start the Diesel setup. Execute the following command to create migrations/postgresql and diesel_postgresql.toml.

$ diesel setup --migration-dir=migrations/postgresql --config-file=diesel_postgresql.toml

In order to change the output destination of schema.rs, modify diesel_postgresql.toml as follows.

[print_schema]
file = "src/postgresql/schema.rs"

Next, create a *.sql file under the migrations/postgresql directory.

$ diesel migration generate --migration-dir=migrations/postgresql create_indexes
$ diesel migration generate --migration-dir=migrations/postgresql create_splits

Since the generated file is empty, update the SQL statement. After updating the SQL statement, generate quickwit-metastore/src/postgresql/schema.rs with the following command

$ diesel migration run --migration-dir=migrations/postgresql --config-file=diesel_postgresql.toml

Once you have successfully generated the quickwit-metastore/src/postgresql/schema.rs, you can start developing with Diesel.

Testing quickwit-metastore

To test FileBackedMetastore only, use the following command.

$ cargo test

To test including PostgresqlMetastore, you need to start PostgreSQL beforehand. Start PostgreSQL for testing with the following command in quickwit project root.

$ make docker-compose-up DOCKER_SERVICES=postgres

Once PostgreSQL is up and running, you can run tests including PostgresqlMetastore with the following command.

$ cargo test --features=postgres

You can stop PostgreSQL with the following command.

$ docker-compose down

Dependencies

~42–83MB
~1.5M SLoC