soju/database
delthas 1ccc7ce6d2 Add a database store for messages
This adds a new config option, `logs db`, which enables storing chat
logs in the soju database.

Regular store options, CHATHISTORY options, and SEARCH operations are
supported, like the fs logs backend.

Messages are stored in a new table, Message. In order to track the list
of targets we have messages for in an optimized manner, another database
is used: MessageTarget.

All new requests are backend by indexes so should be fast even with
hundreds of thousands of messages.

A contrib script is provided for migrating existing logs fs chat logs to
the database. It can be run with eg:

  go run ./contrib/migrate-logs/ logs/ sqlite3:soju.db

Co-authored-by: Simon Ser <contact@emersion.fr>
2023-02-17 14:13:43 +01:00
..
database.go Add a database store for messages 2023-02-17 14:13:43 +01:00
postgres_test.go Introduce a database package 2022-05-09 15:08:04 +02:00
postgres.go Add a database store for messages 2023-02-17 14:13:43 +01:00
sqlite_mattn.go Add a database store for messages 2023-02-17 14:13:43 +01:00
sqlite_modernc.go Add build tag for modernc/sqlite driver 2022-09-26 19:31:43 +02:00
sqlite_stub.go database/sqlite: make optional 2022-09-11 13:57:00 +02:00
sqlite_test.go Add build tag for modernc/sqlite driver 2022-09-26 19:31:43 +02:00
sqlite.go Add a database store for messages 2023-02-17 14:13:43 +01:00