Closed acorn371 closed 1 year ago
Not sure if it is feasible, since the name is returned by PG server. This package is only a driver. It won't and shan't parse the SQL statement.
Yes, You're probably right, it depends on PS Server and it's correct that a driver don't parse any sql statement at all. Thank You.
Is it possible to add a
table
field to Column class ? It could be useful in queries having joined-tables.I have two tables (
users
andprofiles
) having some fields with the same namename
as in the following table definitions:In my query
List<Row> rows = await cnn.query("select users.*,profiles.* from users inner join profiles on users.profile_id=profiles.id").toList();
calling
rows.first.getColumns()
I can get a list of Column with two of these having the same namename
because table-name alias was stripped. My software cannot decide which column-namename
belongs to which table.Moreover,
rows.first.toMap()
get me a map with a column-namename
collapsed, loosing a column value.I know, I could set an different alias to every column having the same name but this approach isn't easily implemented by a generic software procedure.
Thanks, Marco