22 releases
0.10.0 | Nov 3, 2024 |
---|---|
0.9.0 | Jul 28, 2024 |
0.8.6 | Sep 5, 2023 |
0.4.0 | Jul 27, 2023 |
#155 in Database interfaces
142 downloads per month
1.5MB
22K
SLoC
Installation
Via cargo
you can add the library to your project's Cargo.toml
[dependencies]
vinted-rs = { version = "0.10.0",
#features = ["advanced_filters", "redis"]
}
Features
Feature | Description | Example |
---|---|---|
Advanced Filters | Uses the data pulled by the scrapping module, which is stored in the diesel migrations folder. | ✅ |
Redis | Allows recovered results to be cached using a Redis instance | ❌ |
Advanced filters
This feature requires setting up a Postgres Database
Uses the data pulled by the scrapping module, which is stored in the diesel migrations folder.
Environment set-up
-
Copy the
.env.example
cp .env.example .env
-
Modify the variables to your liking
Database set-up
Advanced filtering features must require this setup before running.
-
⚠️
diesel-cli
installation may fail if you do not havelibpq
library installed. To installlibpq
, just install PostgreSQL package on your machine.-
In
Arch
based is only necessary to install this package.sudo pacman -S postgresql-libs
-
In
Debian
based distributions is only necessary to install this package.sudo apt install libpq-dev
-
-
Install
diesel-cli
in order to run the migrations in PostgreSQL databasecargo install diesel_cli --features=postgres --no-default-features
Available interactions (See Makefile)
-
Create a migration
mkdir -p migrations # diesel migration generate my_migration
Program after that
up.sql
anddown.sql
scripts. -
Run a Docker container with PostgreSQL
- See in Makefile
make db
-
Run migrations
make diesel
-
Stop DB
make stop
Testing set-up
This step requires completing the DB setup
cargo test
Redis
This feature allows recovered results to be cached using a Redis instance.
A development instance can be created using:
make cache
Dependencies
~16–28MB
~443K SLoC