sqlite_modern_cpp icon indicating copy to clipboard operation
sqlite_modern_cpp copied to clipboard

read access to _inx in database_binder class

Open bstarynk opened this issue 8 years ago • 3 comments

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.

bstarynk avatar Apr 28 '17 09:04 bstarynk

@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 :-)

aminroosta avatar Apr 28 '17 09:04 aminroosta

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.

bstarynk avatar Apr 28 '17 09:04 bstarynk

@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?

zauguin avatar Apr 28 '17 10:04 zauguin