mirror of
https://github.com/pocoproject/poco.git
synced 2025-07-05 01:50:01 +02:00
Data::SQLite: added support for named bind parameters
This commit is contained in:
parent
59b5b4e46e
commit
5608e84af4
@ -197,7 +197,11 @@ void SQLiteStatementImpl::bindImpl()
|
|||||||
if (boundRowCount != (*_bindBegin)->numOfRowsHandled())
|
if (boundRowCount != (*_bindBegin)->numOfRowsHandled())
|
||||||
throw BindingException("Size mismatch in Bindings. All Bindings MUST have the same size");
|
throw BindingException("Size mismatch in Bindings. All Bindings MUST have the same size");
|
||||||
|
|
||||||
(*_bindBegin)->bind(pos);
|
std::size_t namedBindPos = 0;
|
||||||
|
if (!(*_bindBegin)->name().empty())
|
||||||
|
namedBindPos = (std::size_t)sqlite3_bind_parameter_index(_pStmt, (*_bindBegin)->name().c_str());
|
||||||
|
|
||||||
|
(*_bindBegin)->bind((namedBindPos != 0) ? namedBindPos : pos);
|
||||||
pos += (*_bindBegin)->numOfColumnsHandled();
|
pos += (*_bindBegin)->numOfColumnsHandled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user