Commit Graph

8 Commits

Author SHA1 Message Date
Simon Ser
3a7dee8128 Introduce a database package 2022-05-09 15:08:04 +02:00
Simon Ser
7160713ea9 contrib/znc-import: use background context 2021-11-17 11:56:16 +01:00
Simon Ser
9ec1f1a5b0 Add context args to Database interface
This is a mecanical change, which just lifts up the context.TODO()
calls from inside the DB implementations to the callers.

Future work involves properly wiring up the contexts when it makes
sense.
2021-10-18 19:15:15 +02:00
Hubert Hirtz
6e06663615 PostgreSQL support 2021-10-11 15:21:04 +02:00
Simon Ser
7d648f702e Allow networks to be disabled 2021-05-26 10:51:02 +02:00
Drew DeVault
61b68d6dfb db: refactor into interface
This refactors the SQLite-specific bits into db_sqlite.go. A future
patch will add PostgreSQL support.
2021-05-25 16:35:39 +02:00
Simon Ser
fa16337d97
Switch DB API to user IDs
This commit changes the Network schema to use user IDs instead of
usernames. While at it, a new UNIQUE(user, name) constraint ensures
there is no conflict with custom network names.

Closes: https://todo.sr.ht/~emersion/soju/86
References: https://todo.sr.ht/~emersion/soju/29
2020-10-24 15:14:23 +02:00
Simon Ser
1ac895430a
contrib/znc-import: new utility
Allows populating the soju database from a ZNC config file.
2020-07-09 11:25:25 +02:00