Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose MySqlDbType #362

Closed
bgrainger opened this issue Oct 18, 2017 · 4 comments
Closed

Expose MySqlDbType #362

bgrainger opened this issue Oct 18, 2017 · 4 comments
Milestone

Comments

@bgrainger
Copy link
Member

bgrainger commented Oct 18, 2017

The integer values of MySqlDbType are exposed by Connector/NET in GetSchemaTable (#307) and GetSchema (#361). MySqlParameter also has a MySqlDbType property.

Clients may be relying on the presence of this type in the public API and on its exact values.

@Thorium
Copy link
Contributor

Thorium commented Oct 18, 2017

Would it be enough to rename MySql.Data.Serialization.ColumnType to MySql.Data.MySqlClient.MySqlDbType and modify the visiblity from internal to public with Visual Studio rename tool?

Or do the internal types have to match the MySql.Data types:

	public enum MySqlDbType
	{
		Decimal,
		Byte,
		Int16,
		Int24 = 9,
		Int32 = 3,
		Int64 = 8,
		Float = 4,
		Double,
		Timestamp = 7,
		Date = 10,
		Time,
		DateTime,
		[Obsolete("The Datetime enum value is obsolete.  Please use DateTime.")]
		Datetime = 12,
		Year,
		Newdate,
		VarString,
		Bit,
		JSON = 245,
		NewDecimal,
		Enum,
		Set,
		TinyBlob,
		MediumBlob,
		LongBlob,
		Blob,
		VarChar,
		String,
		Geometry,
		UByte = 501,
		UInt16,
		UInt24 = 509,
		UInt32 = 503,
		UInt64 = 508,
		Binary = 600,
		VarBinary,
		TinyText = 749,
		MediumText,
		LongText,
		Text,
		Guid = 800
	}

@bgrainger
Copy link
Member Author

bgrainger commented Oct 18, 2017

ColumnType (an enum expressing values used in the MySQL protocol) should be kept separate from MySqlDbType (a separate enum used in the public API, that must maintain compatibility with Connector/NET).

A lot of the values will probably overlap (because MySql.Data may conflate the two enums).

Thorium added a commit to Thorium/MySqlConnector that referenced this issue Oct 20, 2017
bgrainger added a commit that referenced this issue Oct 20, 2017
Exposed MySqlDbType #362 and initial version of GetSchema() #361
@Thorium
Copy link
Contributor

Thorium commented Oct 21, 2017

Yes I noticed MySqlDbType is missing column types like int and char. They are valid types however, that's why they need to be in GetSchema()

@bgrainger
Copy link
Member Author

bgrainger commented Oct 22, 2017

Implemented in 0.29.0.

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

No branches or pull requests

2 participants