Skip to content

Commit 29381bf

Browse files
committed
Client: documentation
1 parent 3a7dade commit 29381bf

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/Client/Connection.hpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,32 @@ class Connection {
174174
template <class T>
175175
rid_t call(const std::string &func, const T &args);
176176
rid_t ping();
177+
178+
179+
/**
180+
* Execute the SQL statement contained in the 'statement' parameter.
181+
* @param statement statement, which should conform to the rules for SQL grammar
182+
* @param parameters tuple for placeholders in the statement
183+
* @retval request id
184+
*/
177185
template <class T>
178186
rid_t execute(const std::string& statement, const T& parameters);
179187

188+
/**
189+
* Execute the SQL statement contained in the 'statement' parameter.
190+
* @param stmt_id the statement id obtained with prepare()
191+
* @param parameters tuple for placeholders in the statement
192+
* @retval request id
193+
*/
180194
template <class T>
181195
rid_t execute(unsigned int stmt_id, const T& parameters);
182196

197+
/**
198+
* Prepare the SQL statement contained in the 'statement' parameter.
199+
* The syntax and requirements for Connection::prepare() are the same as for Connection::execute().
200+
* @param statement statement, which should conform to the rules for SQL grammar
201+
* @retval request id
202+
*/
183203
rid_t prepare(const std::string& statement);
184204

185205
void setError(const std::string &msg);
@@ -424,7 +444,6 @@ Connection<BUFFER, NetProvider>::execute(const std::string& statement, const T&
424444
}
425445

426446
template<class BUFFER, class NetProvider>
427-
<<<<<<< HEAD
428447
template <class T>
429448
rid_t
430449
Connection<BUFFER, NetProvider>::execute(unsigned int stmt_id, const T& parameters)
@@ -435,8 +454,6 @@ Connection<BUFFER, NetProvider>::execute(unsigned int stmt_id, const T& paramete
435454
}
436455

437456
template<class BUFFER, class NetProvider>
438-
=======
439-
>>>>>>> fc37e11... Client: prepare()
440457
rid_t
441458
Connection<BUFFER, NetProvider>::prepare(const std::string& statement)
442459
{

src/Client/RequestEncoder.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class RequestEncoder {
8484
IteratorType iterator = EQ);
8585
template <class T>
8686
size_t encodeExecute(const std::string& statement, const T& parameters);
87-
size_t encodePrepare(const std::string& statement);
8887
template <class T>
8988
size_t encodeExecute(unsigned int stmt_id, const T& parameters);
9089
size_t encodePrepare(const std::string& statement);

src/Client/ResponseReader.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ struct ColumnMapKeyReader : mpp::SimpleReaderBase<BUFFER, mpp::MP_UINT> {
426426
break;
427427
}
428428
default:
429-
LOG_ERROR("Invalid error key: ", key);
429+
LOG_ERROR("Invalid column map key: ", key);
430430
dec.AbortAndSkipRead();
431431
}
432432
}

0 commit comments

Comments
 (0)