MCPcopy Create free account
hub / github.com/WiseLibs/better-sqlite3 / GetBindMap

Method GetBindMap

src/objects/statement.cpp:40–50  ·  view source on GitHub ↗

Returns the Statement's bind map (creates it upon first execution).

Source from the content-addressed store, hash-verified

38
39// Returns the Statement's bind map (creates it upon first execution).
40BindMap* Statement::GetBindMap(v8::Isolate* isolate) {
41 if (has_bind_map) return &extras->bind_map;
42 BindMap* bind_map = &extras->bind_map;
43 int param_count = sqlite3_bind_parameter_count(handle);
44 for (int i = 1; i <= param_count; ++i) {
45 const char* name = sqlite3_bind_parameter_name(handle, i);
46 if (name != NULL) bind_map->Add(isolate, name + 1, i);
47 }
48 has_bind_map = true;
49 return bind_map;
50}
51
52Statement::Extras::Extras(sqlite3_uint64 id)
53 : bind_map(0), id(id) {}

Callers 3

BindMethod · 0.80
BindObjectMethod · 0.80
BindArgsMethod · 0.80

Calls 1

AddMethod · 0.80

Tested by

no test coverage detected