18 Commits
Author SHA1 Message Date
binwiederhier 7fb1d25740 Restructure a little 2026-07-27 23:48:43 +02:00
binwiederhier ef121a3f6c Schema migration 2026-07-27 17:51:32 +02:00
binwiederhier 3a37ea32f7 Webpush: Fix FK issue with Postgres 2026-03-16 10:24:16 -04:00
binwiederhier 8a34dfe3f8 Move things, rename things 2026-03-12 21:17:30 -04:00
binwiederhier 85bdfc61ce Refine, log unhealthy replica 2026-03-11 21:07:58 -04:00
binwiederhier f1865749d7 WIP: Postgres read-only replica 2026-03-10 22:17:40 -04:00
binwiederhier c4b8cfa756 Manual correction 2026-03-02 20:04:03 -05:00
binwiederhier ea4739f79b Extract ExecTx 2026-03-02 19:45:35 -05:00
binwiederhier 10a6939d8e Rename queries for consistency 2026-03-01 13:47:42 -05:00
binwiederhier 9736973286 REmove store interface 2026-03-01 13:19:53 -05:00
binwiederhier 90d0eca14d Consistency 2026-02-23 11:17:57 -05:00
binwiederhier f726cc768e Manual refactor 2026-02-22 14:25:15 -05:00
binwiederhier 6375c2ce60 Renaming for consistency 2026-02-21 21:29:29 -05:00
binwiederhier 1abc1005d0 Re-org 2026-02-17 12:04:51 -05:00
binwiederhier 4e5f95ba0c Refactor webpush store to eliminate code duplication
Consolidate SQLite and Postgres store implementations into a single
commonStore with database-specific SQL queries passed via configuration.
This eliminates ~100 lines of duplicate code while maintaining full
functionality for both backends.

Key changes:
- Move all store methods to commonStore in store.go
- Remove sqliteStore and postgresStore wrapper structs
- Refactor SQLite to use QueryRow() pattern like Postgres
- Pass database-specific queries via storeQueries struct
- Make store types unexported, only expose Store interface

All tests pass for both SQLite and PostgreSQL backends.
2026-02-16 19:53:34 -05:00
binwiederhier 869b972a50 Manual review 2026-02-16 19:12:14 -05:00
binwiederhier bdd20197b3 Manual refinements 2026-02-16 19:06:45 -05:00
binwiederhier a8dcecdb6d Refactor webpush store tests and add coverage
- Add SetSubscriptionUpdatedAt to Store interface, remove DB() accessor
- Rename store files to store_sqlite.go and store_postgres.go
- Use camelCase for test function names
- Add tests for upsert field updates and multi-user removal
- Use transaction in setupNewPostgresDB
- Use lowercase "excluded." in PostgreSQL upsert query
2026-02-16 18:53:12 -05:00