My personal-knowledge-system, with deeply integrated task tracking and long term goal planning capabilities.
1# https://just.systems
2
3default:
4 @just --list
5
6# release mode by default
7mode := "debug"
8
9_cargo_flags := if mode == "release" { "--release" } else { "" }
10
11# Builds everything in the workspace
12build:
13 cargo build {{_cargo_flags}}
14
15# Runs Filaments
16run:
17 cargo run {{_cargo_flags}}
18
19# Run all tests
20test:
21 cargo test {{_cargo_flags}}
22
23
24# Only used to build / generate entities
25dev-db := justfile_directory() + "/target/dev.db"
26dev-db-url := "sqlite:///" + dev-db
27
28# build entities from migrations
29[working-directory:"crates/db"]
30entity:
31 # create the dev db
32 rm -f {{dev-db}}
33 touch {{dev-db}}
34
35 # run the migration
36 cd migration && cargo run -- -u {{dev-db-url}}
37
38 # generate entity files based off the migraiton
39 sea-orm-cli generate entity \
40 --database-url {{dev-db-url}} \
41 --output-dir ./src/entity \
42 --experimental-preserve-user-modifications \
43 --entity-format=dense # add flag if expanded format is needed for debugging
44
45
46 # replace elementary types with specific ones
47 sed -i 's/pub nano_id: String/pub nano_id: NanoId/g' ./src/entity/*.rs
48 sed -i 's/pub priority: String/pub priority: Priority/g' ./src/entity/*.rs
49
50 # replace parent_group_id with proper nano_id
51 sed -i 's/pub parent_group_id: Option<String>/pub parent_group_id: Option<NanoId>/g' ./src/entity/*.rs
52
53 # replace foregin key id's with nano_id
54 sed -i 's/pub group_id: String/pub group_id: NanoId/g' ./src/entity/*.rs
55 sed -i 's/pub zettel_id: String/pub zettel_id: NanoId/g' ./src/entity/*.rs
56
57
58
59
60
61
62
63
64