StormByte-Database 2.0.0
C++26 database module of the StormByte suite
 
Loading...
Searching...
No Matches
prepared_stmt.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Database.
5 *
6 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
7 */
8
9#pragma once
10
13
14#include <vector>
15
16struct tds_dblib_dbprocess;
17
22namespace StormByte {
27 namespace Database {
32 namespace MSSQL {
33 class MSSQL;
34
40 friend class MSSQL;
41 struct ConstructionKey {
42 private:
43 ConstructionKey() noexcept = default;
44 friend class MSSQL;
45 };
46 public:
48 PreparedSTMT(const PreparedSTMT&) = delete;
50 PreparedSTMT(PreparedSTMT&& other) noexcept;
52 ~PreparedSTMT() noexcept override;
54 PreparedSTMT& operator=(const PreparedSTMT&) = delete;
56 PreparedSTMT& operator=(PreparedSTMT&& other) noexcept;
66 PreparedSTMT(ConstructionKey key, std::string_view name, std::string_view query,
67 struct tds_dblib_dbprocess* connection,
68 const StormByte::Safe::Shared<Logger::Log>& logger,
69 const StormByte::Safe::Shared<StormByte::Database::Telemetry>& telemetry);
70
71 private:
72 struct tds_dblib_dbprocess* m_connection;
73 std::vector<Value> m_parameters;
74 bool m_bind_error;
75
77 void Binder(StormByte::Size index, Value&& value) noexcept override;
79 void Reset() noexcept override;
81 ExpectedRows DoExecute() override;
82 };
83 }
84 }
85}
Abstract backend.
Definition database.hxx:76
Microsoft SQL Server backend.
Definition mssql.hxx:43
A logical SQL statement executed through sp_executesql RPC.
Definition prepared_stmt.hxx:39
SQL Server-specific counters layered on common database telemetry.
Definition telemetry.hxx:37
Abstract prepared statement.
Definition prepared_stmt.hxx:69
Type-erased SQL value (NULL, integers, double, text, blob, bool).
Definition value.hxx:68
Expected< Rows, QueryException > ExpectedRows
Query result: Rows or QueryException.
Definition typedefs.hxx:82
Root namespace of the StormByte C++ suite.
STL namespace.
#define STORMBYTE_DATABASE_PUBLIC
Definition visibility.h:54