FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
159 stars 65 forks source link

Update FbDataReader.cs #1122

Open BFuerchau opened 1 year ago

BFuerchau commented 1 year ago

Change schema reading Change GetValues()

Advantage:

Some more discussion points:

When in the select command are less primary fields selected than the primary key has, the IsPrimary should not be set to true. We have tables with compound primary key with more the 1 field. But not all fields may be selected. So the adapter can't create a correct update- or delete-command. This can now simple be checked, if all primary fields of the resultfields schema are in the _fields-array.

A similar problem is with IsUnique.

We have tables with more than 1 unique index or constraint, so not all unique fields can be used for update/delete command. To set IsUnique must be checked with index columns query. When all fields in the array belongs to the same unique index, the IsUnique can be set. If more fields with IsUnique are selected, IsUnique can not clearly set. This can be checked only with additional requests for all defined unique indexes, when any column has IsUnique checked.