Commit Graph
82 Commits
Author SHA1 Message Date
louiz’ b71ca15a0f Move a few functions from select_query to query 2017-06-23 00:13:38 +02:00
louiz’ 8a7166eef9 Set the database pointer to nullptr after a close 2017-06-22 16:14:00 +02:00
louiz’ 4d55a120d8 Re-implement correctly the handling of failure to open the database
If we can’t open it at startup, we exit.
If we can’t open it on reload, we keep the previously-opened database.

This way, we’re assured to always have a valid and open database available.
2017-06-21 17:41:03 +02:00
louiz’ 40db183e37 Using OptionalBool, add RecordHistoryOptional col into IrcChannelOptions table
ref #3269
2017-06-16 09:54:36 +02:00
louiz’ 4a963cc480 At startup, upgrade all database tables by adding missing columns 2017-06-16 09:53:49 +02:00
louiz’ a77c982f63 Fix cstdint -> cstddef, to fix compilation on freebsd 2017-06-14 18:47:01 +02:00
louiz’ 34ed2cc1a9 Explicitely declare the add_param<Id> specialization 2017-06-14 17:25:15 +02:00
louiz’ 5834dd53f3 Add a 0 default value for template argument N 2017-06-14 16:21:23 +02:00
louiz’ 2677ac42e8 Fix compilation (many warnings, and a linkage error) with clang++ 2017-06-14 10:46:44 +02:00
louiz’ dac19da4c7 Fix an inversion of tlsPorts_ and ports_ 2017-06-14 10:46:44 +02:00
louiz’ 9defd0ccb7 Add a Statement class to manage the sqlite3_stmt objects and avoid leaks 2017-06-14 00:19:15 +02:00
louiz’ 369ccb0376 Add default values for the database columns 2017-06-14 00:19:15 +02:00
louiz’ 50cadf3dac Implement our own database ORM, and update the whole code to use it
Entirely replace LiteSQL

fix #3271
2017-06-14 00:19:15 +02:00
louiz’ 7f2127a7ea Add the archive ID to messages when they are sent to users
This makes us compatible with mam 6.0

fix #3249
2017-03-30 18:16:44 +02:00
louiz’ 1a09c965eb Remove two sneaky log_debug 2017-03-29 23:32:43 +02:00
louiz’ 379fe026fb Properly convert the data into a number of seconds by using duration_cast 2016-12-10 04:15:49 +01:00
louiz’ 363a0bf02c Look for uuid/uuid.h instead of just uuid.h
Avoids a conflict between /usr/include/uuid.h and
/usr/local/include/uuid/uuid.h on freebsd
2016-09-29 20:11:35 +02:00
louiz’ 3047bd41b2 MAM results can be filtered by start and end dates 2016-09-04 22:58:38 +02:00
louiz’ 7536a1b3f3 Respond to MAM requests on a channel JID
At the moment, result-set-management is not implemented, the whole history
(well, at most 1024 messages) is returned.
2016-08-28 22:42:50 +02:00
louiz’ 88499d0379 If the maxHistoryLength is negative, make it 0
Instead of doing a broken SQL request that returns weird lines
2016-08-23 01:28:12 +02:00
louiz’ d1626c929f When joining a channel, send the most recent history found in the database 2016-08-22 00:44:17 +02:00
louiz’ 593b326827 When saving the logs, the date must be in seconds, not nanoseconds 2016-08-22 00:39:11 +02:00
louiz’ 6776b827d2 Add a global configure ad-hoc command, with max history length 2016-08-22 00:38:44 +02:00
louiz’ 992fa93895 Add get_first_non_empty and use it into Database to simplify a little bit 2016-08-21 01:51:52 +02:00
louiz’ 8ec823be4f Save received and sent messages into the database 2016-08-12 16:39:19 +02:00
louiz’ 4c1b9abe7e Properly catch and handle database errors
Do not use a singleton for the database.

fix #3203
2016-07-12 00:31:57 +02:00
louiz’ 81f8f45b37 Replace all include guards by #pragma once
It’s $CURRENT_YEAR
2016-07-04 17:53:53 +02:00
louiz’ af42073830 Style fix
Move all constructors at the top of classes
2016-05-04 14:16:40 +02:00
Florent Le Coz 421c960df5 Add a ChannelOptions table in the DB
And a way to retrieve its values, defaulting on the ServerOptions for unset
values.
2016-01-04 13:47:26 +01:00
Florent Le Coz 580b721ba5 Remove a write to std::cout from Database’s constructor 2015-10-29 03:35:25 +01:00
Florent Le Coz 74c73799ab Only compile database.cpp if configured with litesql 2015-10-24 15:17:53 +02:00
Florent Le Coz 88ae2599f6 Introduce an optional Database module
Uses litesql
2015-09-18 22:09:26 +02:00