Skip to content

Add support for DataSourceInformation Schema#795

Merged
bgrainger merged 4 commits into
mysql-net:masterfrom
vdaron:master
Apr 7, 2020
Merged

Add support for DataSourceInformation Schema#795
bgrainger merged 4 commits into
mysql-net:masterfrom
vdaron:master

Conversation

@vdaron
Copy link
Copy Markdown
Contributor

@vdaron vdaron commented Apr 5, 2020

Some progress on the #375 issue

vdaron added 2 commits April 5, 2020 16:11
Signed-off-by: Vincent DARON <vda@dfakto.com>
Signed-off-by: Vincent DARON <vda@dfakto.com>
Signed-off-by: Vincent DARON <vda@dfakto.com>

var row = dataTable.NewRow();
row["CompositeIdentifierSeparatorPattern"] = @"\.";
row["DataSourceProductName"] = "MysqlConnector";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataSourceProductName is "The name of the product accessed by the provider, such as 'Oracle' or 'SQLServer'." (https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/common-schema-collections)

I don't know if we can accurately determine the remote database (MySQL, Percona, MariaDB, Amazon, etc.) so it might be best to just return "MySQL".

@bgrainger
Copy link
Copy Markdown
Member

Thanks for the contribution! I'll look over it shortly.

row["CompositeIdentifierSeparatorPattern"] = @"\.";
row["DataSourceProductName"] = "MysqlConnector";
row["DataSourceProductVersion"] = m_connection.ServerVersion;
row["DataSourceProductVersionNormalized"] = m_connection.Session.ServerVersion.Version.ToString();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A normalized version for the data source, such that it can be compared with String.Compare().

There would need to be some padding here (e.g., nn.nn.nnnn) to make sure 10 doesn't compare between 1 and 2.

Change DataSourceProductVersionNormalized to have a String Comparable result

Signed-off-by: Vincent DARON <vda@dfakto.com>
@bgrainger bgrainger merged commit d2abfc0 into mysql-net:master Apr 7, 2020
@bgrainger
Copy link
Copy Markdown
Member

Added in 0.63.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants