diff options
Diffstat (limited to 'server/src/database/connection.cppm')
| -rw-r--r-- | server/src/database/connection.cppm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/server/src/database/connection.cppm b/server/src/database/connection.cppm new file mode 100644 index 0000000..22e6495 --- /dev/null +++ b/server/src/database/connection.cppm | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | export module routemon:database.connection; | ||
| 2 | |||
| 3 | import std; | ||
| 4 | import :database.schema; | ||
| 5 | import :database.sqlite3; | ||
| 6 | import :time; | ||
| 7 | |||
| 8 | namespace routemon::database { | ||
| 9 | |||
| 10 | export class connection | ||
| 11 | { | ||
| 12 | sqlite3::connection dbc_; | ||
| 13 | |||
| 14 | explicit connection(sqlite3::connection dbc) : dbc_{std::move(dbc)} {} | ||
| 15 | |||
| 16 | friend auto open(std::filesystem::path const& filename) | ||
| 17 | -> std::shared_ptr<connection>; | ||
| 18 | |||
| 19 | public: | ||
| 20 | auto insert_rwgps_notifications( | ||
| 21 | std::vector<std::pair< | ||
| 22 | schema::rwgps_notification, | ||
| 23 | std::optional<schema::rwgps_notification_target_collection> | ||
| 24 | >>& notifs) -> void; | ||
| 25 | }; | ||
| 26 | |||
| 27 | export auto open(std::filesystem::path const& filename) | ||
| 28 | -> std::shared_ptr<connection>; | ||
| 29 | |||
| 30 | } // namespace routemon::database | ||