MCPcopy Create free account
hub / github.com/SOCI/soci / get_parameter_name

Method get_parameter_name

src/backends/sqlite3/statement.cpp:393–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393std::string sqlite3_statement_backend::get_parameter_name(int index) const
394{
395 // Notice that SQLite host parameters are counted from 1, not 0.
396 char const* name = sqlite3_bind_parameter_name(stmt_, index + 1);
397 if (!name)
398 return std::string();
399
400 // SQLite returns parameters with the leading colon which is inconsistent
401 // with the other backends, so get rid of it as well several other
402 // characters which can be used for named parameters with SQLite.
403 switch (*name)
404 {
405 case ':':
406 case '?':
407 case '@':
408 case '$':
409 name++;
410 break;
411 }
412
413 return name;
414}
415
416std::string sqlite3_statement_backend::rewrite_for_procedure_call(
417 std::string const &query)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected