35 Commits
Author SHA1 Message Date
binwiederhier 5a6c4277ad WIP: Clsuter support (cross node delivery, leader election) 2026-08-01 16:10:31 +02:00
binwiederhier 95ad323d1c Schema compare tests 2026-07-29 07:12:28 +02:00
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 df82fdf44c Add HTTP 413 to normal errors to not log 2026-03-16 10:27:23 -04: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 ab33ac7ae5 Refine 2026-03-11 11:58:40 -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 c864a9baeb Put more things in tx 2026-03-02 19:58:26 -05:00
binwiederhier ea4739f79b Extract ExecTx 2026-03-02 19:45:35 -05:00
binwiederhier 0e6b467cf0 Manual fixes 2026-03-02 12:58:01 -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 43280fbc0a Performance improvements in pg 2026-02-22 16:21:27 -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 459c80ef9b Refactor tests again: forEachBackend 2026-02-21 21:02:41 -05:00
binwiederhier c76e39bb0e Manual updates 2026-02-21 10:36:09 -05:00
binwiederhier a4c836b531 Refine 2026-02-20 15:36:12 -05:00
binwiederhier 039d555689 Fix tests 2026-02-20 08:19:25 -05:00
binwiederhier 4cbd80c68e Use one PG connection, add support for connection params 2026-02-19 22:34:53 -05:00
binwiederhier 305e3fc9af DB conn to 25 2026-02-19 21:36:09 -05:00
binwiederhier 1abc1005d0 Re-org 2026-02-17 12:04:51 -05:00
binwiederhier 07c3e280bf Refactor user package to Store interface with PostgreSQL support
Extract database operations from Manager into a Store interface with
SQLite and PostgreSQL implementations using a shared commonStore.
Split SQLite migrations into store_sqlite_migrations.go, use shared
schema_version table for PostgreSQL, rename user_user/user_tier tables
to "user"/tier, and wire up database-url in CLI commands.
2026-02-16 22:39:54 -05:00
binwiederhier 82e15d84bd Manual changes 2026-02-16 20:02:19 -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
binwiederhier 5331437664 Unify webpush store tests across SQLite and PostgreSQL backends
Share test logic in store_test.go with thin per-backend wrappers.
Add SetSubscriptionUpdatedAt to both stores, removing the need for
raw SQL and the DB() accessor in tests.
2026-02-16 12:38:00 -05:00
binwiederhier e432bf2886 Rename PostgreSQL table prefix from wp_ to webpush_ 2026-02-16 12:13:10 -05:00