Feat Req Get Aliased Table Name.

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Feat Req Get Aliased Table Name.

J Decker

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...


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


Visual diff.

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
sqlite-users mailing list
[hidden email]