Open MKuckert opened 7 years ago
I would like those functions too. I'll live this issue open for now, to remind me to explore possibilities.
But they are unusually difficult. They accept a varying number of args which are without a specified type. That doesn't map well onto the semantics of P/Invoke.
So yes, there is a reason they are missing from the bindings. But I agree that it would be nice to have them.
I've had a request/need for them too. In this issue: https://github.com/praeclarum/sqlite-net/issues/382
Also pragma commands don't seem to like to be parameterized so it would be nice to have this to safely set the key
for SQLCipher.
If the binding is difficult, perhaps you can just expose the simplest overload that would let us execute sqlite3_mprintf("%u", unsafeString)
- an overload that expects two strings. This is the trick Xamarin uses to bind to objc_msgSend
- lots of overloads.
Acknowledged. Good idea.
I just committed the lamest possible implementation of this. In efb0a02.
Like I said, this is lame. I'll probably explore more angles.
Even with the overloads approach, the problems are:
I could resolve (1) by only supporting strings.
I could resolve (2) by ignoring the matter and just saying that if you pass %z and your app crashes, you got what you deserved. Or I could maybe scan the format string for %z and give an error.
I just found the
sqlite3_*printf
functions and was wondering if there's a reason those are missing from the bindings. They are pretty handy to escape special chars in strings for example (usingsqlite3_mprintf("%q", str)
).Is there a way to use these printing functions using a custom binding or do I have to implement my own as a port of the original functions?