Mercurial > hg > orthanc-databases
annotate Framework/MySQL/MySQLStatement.h @ 327:9660def78649 OrthancMySQL-4.3
OrthancMySQL-4.3
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 22 Jul 2021 20:16:30 +0200 |
parents | ab96698c73a3 |
children | 16aac0287485 |
rev | line source |
---|---|
0 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
193
3236894320d6
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
186
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU Affero General Public License | |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #if ORTHANC_ENABLE_MYSQL != 1 | |
25 # error MySQL support must be enabled to use this file | |
26 #endif | |
27 | |
28 #include "MySQLDatabase.h" | |
29 #include "../Common/GenericFormatter.h" | |
30 | |
31 namespace OrthancDatabases | |
32 { | |
33 class MySQLStatement : public IPrecompiledStatement | |
34 { | |
35 private: | |
36 class ResultField; | |
37 class ResultMetadata; | |
38 | |
39 void Close(); | |
40 | |
41 MySQLDatabase& db_; | |
42 MYSQL_STMT *statement_; | |
43 GenericFormatter formatter_; | |
44 std::vector<ResultField*> result_; | |
45 std::vector<MYSQL_BIND> outputs_; | |
46 | |
47 public: | |
48 MySQLStatement(MySQLDatabase& db, | |
49 const Query& query); | |
50 | |
46
6a574d810b98
Compatibility with MySQL 8.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
51 virtual ~MySQLStatement(); |
0 | 52 |
53 MYSQL_STMT* GetObject(); | |
54 | |
55 size_t GetResultFieldsCount() const | |
56 { | |
57 return result_.size(); | |
58 } | |
59 | |
60 IValue* FetchResultField(size_t i); | |
61 | |
23
b2ff1cd2907a
handling of implicit transactions in DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
62 IResult* Execute(ITransaction& transaction, |
0 | 63 const Dictionary& parameters); |
64 | |
23
b2ff1cd2907a
handling of implicit transactions in DatabaseManager
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
65 void ExecuteWithoutResult(ITransaction& transaction, |
0 | 66 const Dictionary& parameters); |
67 }; | |
68 } |