So basically all that meta info is tied to the lifetime of the preparated
query... and if any of what was already implemented are valid, the new one
is valid, and if they are invalid, the new is similarly invalid; but it'll
never be a case that part of that works and the other doesn't.
Can of course generate a patch; but the first link is the patch, visually
It's not a lot to hand implement, it's really just saving that info
Most of the changes are behind SQLITE_ENABLE_COLUMN_METADATA which controls
the other metadata functions in the group.
That group of functions has an array of entries indexed by
> https://sqlite.org/c3ref/column_database_name.html >
> Source Of Data In A Query Result
> The names returned are the original un-aliased names of the database,
> table, and column.
> Okay. and there's...
> https://sqlite.org/c3ref/column_name.html >
> These routines return the name assigned to a particular column in the
> result set of a SELECT <https://sqlite.org/lang_select.html> statement.
> Which is aliased column names (if aliased)
> But there's no way to get the source table aliased. And I don't think
> database ever gets a chance to be aliased?
> SELECT a, sum(b), max(c) FROM t1 m GROUP BY a
> There's no C API to get 'm' from the above.
> Updated my patch to add the above through
> +const char *sqlite3_column_table_alias_name(sqlite3_stmt*,int);
> +const void *sqlite3_column_table_alias_name16(sqlite3_stmt*,int);
> which is added with the top mentionend function groups behind
> https://drive.google.com/open?id=1c24qvtvS57ASJF5RfZxLJSsgI2FhOVk1 >
> Visual diff.
> https://github.com/d3x0r/sqlite3/compare/AddTableAliasForColumn?expand=1 >
> It's not very large. It just has to allocate one more element in the
> array of column info allocated by METADATA flag.... and set it when it sets
> the rest, and expose it with an API call.
> Even if it's just taken as inspiration, please add something to expose the