Returns the Statement's bind map (creates it upon first execution).
| 38 | |
| 39 | // Returns the Statement's bind map (creates it upon first execution). |
| 40 | BindMap* 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 | |
| 52 | Statement::Extras::Extras(sqlite3_uint64 id) |
| 53 | : bind_map(0), id(id) {} |
no test coverage detected