StormByte C++ Library: Database module 0.0.9999
StormByte-Database is a StormByte library module for handling database connections
Loading...
Searching...
No Matches
prepared_stmt.hxx
1#pragma once
2
3#include <StormByte/database/prepared_stmt.hxx>
4
5class sqlite3_stmt; // Forward declaration so we don't have to depend on sqlite3 headers
6
11namespace StormByte::Database::SQLite {
16 class STORMBYTE_DATABASE_PUBLIC PreparedSTMT final: public StormByte::Database::PreparedSTMT {
17 friend class SQLite3;
18 public:
23 PreparedSTMT(const PreparedSTMT& other) = delete;
24
29 PreparedSTMT(PreparedSTMT&& other) noexcept = default;
30
34 ~PreparedSTMT() noexcept override;
35
41 PreparedSTMT& operator=(const PreparedSTMT& other) = delete;
42
48 PreparedSTMT& operator=(PreparedSTMT&& other) noexcept = default;
49
50 private:
54 sqlite3_stmt* m_stmt;
55
61 PreparedSTMT(const std::string& name, const std::string& query);
62
68 PreparedSTMT(std::string&& name, std::string&& query) noexcept;
69
75 void Bind(const int& index, const std::nullptr_t& value) noexcept override;
76
82 void Bind(const int& index, const int& value) noexcept override;
83
89 void Bind(const int& index, const unsigned int& value) noexcept override;
90
96 void Bind(const int& index, const int64_t& value) noexcept override;
97
103 void Bind(const int& index, const uint64_t& value) noexcept override;
104
110 void Bind(const int& index, const double& value) noexcept override;
111
117 void Bind(const int& index, bool value) noexcept override;
118
124 void Bind(const int& index, const std::string& value) noexcept override;
125
131 void Bind(const int& index, const std::vector<std::byte>& value) noexcept override;
132
137 ExpectedRows DoExecute() override;
138
142 void Reset() noexcept override;
143 };
144}
Prepared statement for databases.
Definition prepared_stmt.hxx:14
Prepared statement for SQLite.
Definition prepared_stmt.hxx:16
PreparedSTMT(PreparedSTMT &&other) noexcept=default
PreparedSTMT(const PreparedSTMT &other)=delete
SQLite3 database class.
Definition sqlite3.hxx:22