Driver/SpannerSchemaRetriever.cs
/// <summary>
/// Creates the type definition from the data passed in
/// </summary>
/// <param name="row">The row with meta-data to convert to a TypeDefinition.</param>
/// <returns>
/// a DBTypeDefinition filled with the available information in the row.
/// </returns>
Creates the type definition from the data passed in
Creates the type definition from the data passed in
private DBTypeDefinition CreateTypeDefinition(DataRow row)
		{
			DBTypeDefinition toReturn = new DBTypeDefinition();
			string datatype = (row.Value<string>("SPANNER_TYPE") ?? string.Empty).ToLowerInvariant();
			int maxLength = 0;
			if(datatype.StartsWith("string"))
			{
				maxLength = DetermineMaxLength(datatype.Replace("string", ""));
				datatype = "string";
			}
			if(datatype.StartsWith("bytes"))
			{
				maxLength = DetermineMaxLength(datatype.Replace("bytes", ""));
				datatype = "bytes";
			}
			FillDBTypeDefinitionFromNormalData(toReturn, datatype, maxLength);
			return toReturn;
		}
private DBTypeDefinition CreateTypeDefinition ( DataRow row ) { DBTypeDefinition toReturn = new DBTypeDefinition ( ) ; string datatype = ( row . Value < string > ( " " ) ?? string . Empty ) . ToLowerInvariant ( ) ; int maxLength = 0 ; if ( datatype . StartsWith ( " " ) ) { maxLength = DetermineMaxLength ( datatype . Replace ( " " , " " ) ) ; datatype = " " ; } if ( datatype . StartsWith ( " " ) ) { maxLength = DetermineMaxLength ( datatype . Replace ( " " , " " ) ) ; datatype = " " ; } FillDBTypeDefinitionFromNormalData ( toReturn , datatype , maxLength ) ; return toReturn ; }
Creates the type definition from the data passed in
Creates the type definition from the data passed in
// string and bytes have the length specified in the type. E.g. STRING(50) or STRING(MAX). Same for BYTES(50) or BYTES(MAX)
a DBTypeDefinition filled with the available information in the row.
a DBTypeDefinition filled with the available information in the row .
row
DataRow
The row with meta-data to convert to a TypeDefinition.
The row with meta - data to convert to a TypeDefinition .