Columns metadata is invalit for RETURNING clause
Column metadata interfaces such as sqlite3_column_origin_name() and sqlite3_column_decltype() don't work with the RETURNING clause.
Is it possible to fix this?
sqlite version: 3.35.2
(2) By ThanksRyan on 2021-05-05 05:05:29 in reply to 1 [link] [source]
Have you tried SQLite version 3.35.4? It seems some RETURNING things were fixed there:
(By the way, 3.35.5 is the latest release.)
The current trunk does not return metadata for RETURNING columns either, only the column name.
Yes, but are there any plans to implement this? We want to use queries with RETURNING but our software is depends on column type.
Guys, do you know, will this feature be implemented or not? This is important for me to know. Thank you.
My two cents' worth: I think you'd be wise to avoid relying on this feature being implemented soon, if at all. If they plan to implement it for free, they are unlikely to say so before the feature has landed; doing otherwise invites a possibly endless stream of requests for ETAs, with attendant followups when the ETA has passed and the feature isn't implemented yet, effectively turning the ETA into a deadline.
Not that there is anything wrong with asking for features. I've done it myself. Just don't be disappointed if the requested feature doesn't materialise, or it takes much longer than desired to do so.
If the feature truly is important to you, you might consider paying to get it done. See the support page.
This is unlikely to be implemented anytime soon.
Because of the way that RETURNING is implemented, metadata about the returned columns is not easily available when the bytecode for the RETURNING clause is generated. A major refactoring will be required to make that information available. Furthermore, the metadata is of limited utility, and it uses CPU cycles to compute and heap space to store, even in the common case where it is never accessed.
So the down-side of adding metadata to RETURNING columns includes:
- A lot of work for the developers.
- Probably a whole bunch of new bugs.
- Additional CPU cycles required to prepare statements with RETURNING clauses, even if the metadata is never accessed.
- Additional heap memory used by prepared statements with RETURNING clauses, even if the metadata is never accessed.
And there seems to be very little offsetting up-side. In all of the programs I've written in 20 years of using SQLite, I don't recall ever having used the metadata information (except for programs whose purpose is to test the metadata APIs).