SqliteModernCpp / sqlite_modern_cpp

The C++14 wrapper around sqlite library
MIT License
896 stars 155 forks source link

read access to _inx in database_binder class #112

Open bstarynk opened 7 years ago

bstarynk commented 7 years ago

It would be nice to get some read access to _inx field of sqlite::database_binder class by adding

  public:
       current_index() const { return _inx; };

to that class database_binder

I'm trying to debug my melt-monitor which gets a sqlite::errors::range error, and such a database_binder::current_index member function would be useful for debugging purposes.

aminroosta commented 7 years ago

@bstarynk I think this is not a general purpose feature, We can either add an undocumented function _current_index() or maybe you can add it yourself while you are debugging :-)

bstarynk commented 7 years ago

Why do you think that? Some programs are calling << (for the same database_binder) in several places, and querying the current index is useful for them. And that information is already in the database_binder instance.

zauguin commented 7 years ago

@bstarynk How would a SQL statement of a program look like, so that this program can bind the next parameter in multiple places without keeping track of the current index anyway?