Commit graph

6 commits

Author SHA1 Message Date
Viktor Torstensson
f78ddf1702
multi: rename MigrationStream names to MigrationSet 2026-05-14 11:39:09 +02:00
Viktor Torstensson
f77ae5dcf2
multi: introduce migration stream for unit tests
In upcoming commits, we will introduce a new migration stream package
that will need to reference the db package, as well as the accounts,
session and firewalldb package in future commits. To avoid circular
dependencies, we therefore introduce a new migration stream that unit
tests can use, in order to avoid having to import the new migration
stream package.
2026-05-14 11:38:24 +02:00
Viktor Torstensson
b7ee351cb0
multi: use sqldb/v2 in accounts package
Update the accounts package to use the `sqldb/v2` package instead of the
older version.
2026-05-14 11:37:41 +02:00
Viktor Tigerström
12343cf4ba
accounts: ensure that test SQL store is closed
We add a helper function to the functions that creates the test SQL
stores, in order to ensure that the store is properly closed when the
test is cleaned up.
2025-06-09 13:01:28 +02:00
Viktor Tigerström
92689c546c
accounts: update NewTestDB func to return Store
In preparation for upcoming migration tests from a kvdb to an SQL store,
this commit updates the NewTestDB function to return the Store interface
rather than a concrete store implementation.

This change ensures that migration tests can call NewTestDB under any
build tag while receiving a consistent return type.
2025-05-02 15:44:50 +07:00
Elle Mouton
92d0ddb897
accounts: add SQL store implementation
In this commit, we add the SQLStore type which implements the
accounts.Store interface. To demonstrate that it works as expected, we
also plug this implementation into all the account unit tests to show
that they pass against the sqlite and postgres backends.

One can use `make unit pkg=accounts tags=test_db_postgres` or
`make unit pkg=accounts tags=test_db_sqlite` to test locally.

Note that 2 small timestamp related changes are made to the unit tests.
This is to compensate for timestamp precision in postgres.
2025-02-21 10:35:06 -03:00