1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# Actualbudget Queries
This is a Rust library defining queries for querying an Actualbudget database
export.
## Creating the test database
To re-create the test database from scratch:
1. Open an instance of Actualbudget
2. Start a new file
3. Add a new local account, called 'My bank account', with an initial balance of
1200.00
4. Add a new local account, called 'My cash account', with an initial balance of
45.10
5. Add a new local account, called 'Category transfers', with an initial balance
of nil
6. Move the Starting Balance transaction for both to 1 Aug 2024
6. Go to the Budgets tab
7. Adjust the budgets for the existing categories for August 2024:
- Usual Expenses, under which:
- Food: 200
- General: 100
- Bills: 125
- Bills (flexible): 25
- Investments and Savings, under which:
- Savings: 400
8. Add transactions for Income for 846.46 in the 'My bank account' on 21 Aug,
Sept, Oct and Nov 2024, with the 'Note' column set to 'Salary', ticking the
'cleared' box
9. On 10 Sept 2024, add a transaction in 'My bank account' transferring 80.00 to
'My cash account' with no Note, and tick the 'cleared' box
10. Add transactions for 200.00 to 'Tesco' in 'My bank account', categorised as
'Food', for 8 Aug, Sept, Oct, and Nov 2024
11. In the 'Category transfers' account, add a transaction for 23rd Oct 2024,
transferring 120.00 from 'Savings' to 'General'
12.
12. Export the database by going to Settings > Export data
13. Download the resulting ZIP archive
14. Extract `db.sqlite` and `metadata.json`
15. Move them to
`actualbudget_queries/tests/resources/actualbudget_test_db.sqlite` and
`actualbudget_queries/tests/resources/actualbudget_test_db_metadata.json`
respectively, overwriting the files which are already there
16. Format the JSON in `actualbudget_test_db_metadata.json` to minimise diffs
## Updating the test database
To make a change to the test database:
1. Make a copy of `actualbudget_test_db_metadata.json` and rename it to
`metadata.json`
2. Make a copy of `actualbudget_test_db.sqlite` and rename it to `db.sqlite`
3. Compress these files together in a `.zip` archive
4. Open an instance of Actualbudget
5. If you have a file open, close it
6. Choose 'Import file'
7. Choose to import an 'Actual' file
8. Choose the ZIP archive you just made
9. This should open the file
10. Make your edits
11. Document your edits in
[the database creation guide](#creating-the-test-database)
12. Export the database by going to Settings > Export data
13. Download the resulting ZIP archive
14. Extract the `.sqlite` database file
15. Move them to
`actualbudget_queries/tests/resources/actualbudget_test_db.sqlite` and
`actualbudget_queries/tests/resources/actualbudget_test_db_metadata.json`
respectively, overwriting the files which are already there
16. Format the JSON in `actualbudget_test_db_metadata.json` to minimise diffs
|