Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
buck-yeh committed Nov 17, 2021
1 parent 7c923da commit 45b2d26
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,32 @@ The goal is to minimize boilerplate code when doing the same things using Connec

## MYSQL_STMT
`MYSQL_STMT*` releated function are highly wrapped into methods of `bux::C_MySqlStmt`. Usages against alternatives are recommended to prevent _SQL injection_.
~~~C++
class C_MySqlStmt
{
public:

// Nonvirtuals
C_MySqlStmt(MYSQL *mysql);
~C_MySqlStmt();
C_MySqlStmt(const C_MySqlStmt &stmt) = delete;
C_MySqlStmt &operator=(const C_MySqlStmt &) = delete;
operator MYSQL_STMT*() const { return m_stmt; }
bool affected() const;
auto bindSize() const { return m_bindSize; }
void bindParams(const std::function<void(MYSQL_BIND *barr)> &binder);
void clear() const;
void exec() const;
MYSQL_BIND *execBindResults(const std::function<void(MYSQL_BIND *barr)> &binder);
unsigned execNoThrow() const;
std::pair<const void*,size_t> getLongBlob(size_t i, std::function<void*(size_t bytes)> alloc) const;
std::string getLongBlob(size_t i) const;
bool nextRow() const;
void prepare(const std::string &sql) const;
bool queryUint(unsigned &dst);
//...
};
~~~
## Funtions
- If your just need to get an single value from SQL, like:
Expand Down

0 comments on commit 45b2d26

Please sign in to comment.