tauri-docs
tauri-docs copied to clipboard
[docs] [sql] Make the distinction clearer between select and execute functions
I ran into this issue recently, that I wanted to run an INSERT query finishing with a "RETURNING" statement from JavaScript (supported in SQLite since 2021 I believe), but using the execute() function did not return any data from the query. After looking around in the code, I think I understand that the difference between the execute() and select() functions is that the first does not do any kind of query result serialisation, while select() does. You can in fact execute any kind of query through the two functions, and the select() function is not limited to SELECT queries ; queries RETURNING data can be run successfully through select().
I think this should be made clearer in the docs, the two function names are not the most explicit, but I don't think this warrants a function rename. Probably a few words about this in the API docs would be enough to prevent such confusion.
I'm down to do it if needed, but I wanted to submit the idea around first as I'm very new to Tauri...