Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Latest commit

 

History

History
54 lines (35 loc) · 1.15 KB

development.md

File metadata and controls

54 lines (35 loc) · 1.15 KB

Development

Setup

  • Install Git, Rust, SQLite, SQLX CLI
  • Run the following:
git clone https://github.com/SimonBrandner/discord-nlp-bot.git
cd discord-nlp-bot

cp .env.sample .env
cp discord_nlp_bot/config.sample.json discord_nlp_bot/config.json

cargo sqlx database create
cargo sqlx migrate run --source nlp_bot_api/src/migrations

cd discord_nlp_bot
cargo run

NixOS

You will need to have flakes enabled (see the NixOS Wiki).

The development environment

You can use the following command to enter the development environment.

nix develop

VS Code

If you want the rust-analyzer VS Code extension to work correctly, you'll need to have an .envrc file in your directory and the direnv extension installed.

cp .envrc.sample .envrc

Database

Updating

  • Add a new migration using sqlx migrate add <name> --source nlp_bot_api/src/migrations
  • Run the migration using cargo sqlx migrate run --source nlp_bot_api/src/migrations

Writing queries

  • Run cargo sqlx prepare --workspace