Of course, the two are not using the same sqlite3 instance, therefore the data loaded by the custom library are not available to the DatabaseLibrary so that the following will fail:
${rows}= Query select COUNT(*) from table1
Is there a way to “share” the same sqlite3 connection instance between the two libraries?
It will get the default/ currently selected database connection and passes it to read_csv. BTW, this also abstracts the new keyword from sqlite3.
General question: Is this the right way to do this or is there any better way which does not require to access the internal structure of the DatabaseLibrary?
Using BuiltIn to fetch the instance is one option, another one if creating a custom library that subclasses DatabaseLibrary and adds the desired keywords to it. Since DatabaseLibrary is a stable release, I’d be inclined to go with that option, personally.
Good idea, this is also an option. In my case, as it was the first occurrence of this requirement, I simply added the function / keyword into the already existing custom library. But your option looks smarter as this would encapsulate the enhancement into a generic custom library.