StormByte C++ Library: Database module 0.0.9999
StormByte-Database is a StormByte library module for handling database connections
Loading...
Searching...
No Matches
preparedSTMT.hxx
1#pragma once
2
3#include <StormByte/database/preparedSTMT.hxx>
4#include <StormByte/database/sqlite/alias.hxx>
5
6class sqlite3_stmt; // Forward declaration so we don't have to depend on sqlite3 headers
11namespace StormByte::Database::SQLite {
16 class STORMBYTE_DATABASE_PUBLIC PreparedSTMT final: public StormByte::Database::PreparedSTMT<Row> {
17 friend class SQLite3;
18 public:
22 PreparedSTMT(const PreparedSTMT&) = delete;
23
27 PreparedSTMT(PreparedSTMT&&) noexcept = default;
28
32 PreparedSTMT& operator=(const PreparedSTMT&) = delete;
33
37 PreparedSTMT& operator=(PreparedSTMT&&) noexcept = default;
38
42 ~PreparedSTMT() noexcept override;
43
49 PreparedSTMT& Bind(const int& index, const std::nullptr_t& value) noexcept override;
50
56 PreparedSTMT& Bind(const int& index, const int& value) noexcept override;
57
63 PreparedSTMT& Bind(const int& index, const unsigned int& value) noexcept override;
64
70 PreparedSTMT& Bind(const int& index, const int64_t& value) noexcept override;
71
77 PreparedSTMT& Bind(const int& index, const uint64_t& value) noexcept override;
78
84 PreparedSTMT& Bind(const int& index, const double& value) noexcept override;
85
91 PreparedSTMT& Bind(const int& index, bool value) noexcept override;
92
98 PreparedSTMT& Bind(const int& index, const std::string& value) noexcept override;
99
100
104 void Reset() noexcept override;
105
110 const Row& Step() noexcept override;
111
112 private:
118 PreparedSTMT(const std::string& name, const std::string& query);
119
125 PreparedSTMT(std::string&& name, std::string&& query) noexcept;
126
130 sqlite3_stmt* m_stmt;
131 };
132}
Prepared statement for databases.
Definition preparedSTMT.hxx:15
Row class for databases.
Definition row.hxx:20
Prepared statement for SQLite.
Definition preparedSTMT.hxx:16
PreparedSTMT(const PreparedSTMT &)=delete
PreparedSTMT(PreparedSTMT &&) noexcept=default
Contains classes and functions for SQLite3 database operations.