Closed giuliohome closed 4 years ago
Btw, notice also that it would be awesome if the values in ColumnValues
were a union type instead of an obj
. Is there anything preventing from it being considered/done? Because the obj
might produce some issues in the following RPC
serialization, see @Tarmil comment on W# gitter.
Hmm, I don't know straight away the column order, then again, relational database shouldn't trust to any particular column or row order in general, if not explicitely sorted.
obj...nice idea, but breaking backward compatibility and we would have to know all the supported meta-types by different databases.
Just to clarify, of course I trust - e.g. for MS SQL - the column_id
of the sys.columns
table.
And you also trust such table since you are reading the column descriptions from it in the Providers.MsSqlServer.fs: I guess you should simply sort by column_id
in a similar query there, in the point where you get the list of the columns from a table...
Edit
Actually, you are already getting the columns and sorting them by ORDINAL_POSITION
: it looks like then you are not passing such order to the SQLProvider
entities when you map the columns into their internal representation.
The type Column
in the SqlSchema.fs
should have an ordinal: int
to keep track of the ORDINAL_POSITION
.
Maybe it can be tagged as a nice to have and closed for now.
Description
Can I get - from
ColumnValues
- the columns in the original order as they are defined in the table?Repro
Simply refer to the example in the Documentation for Querying
Expected result
The columns listed as they are defined in the
Customers
table: in case one needs to sort them, no problem adding anArray.sortBy
, but I don't see how I can retrieve the original sequence otherwise.Thank you.