public static SpannerDbType ArrayOf(SpannerDbType elementType)
Creates an array of the specified type. This can be done on any arbitrary SpannerDbType.
You may use any type that implements IEnumerable as a source for the array. The type of each
item is determined by elementType.
When calling GetFieldValue<T>(string) the default type
is List<T>. You may, however, specify any type that implements IList which
has a default constructor.
Returns a clone of this type with the specified size constraint.
Only valid on Google.Cloud.Spanner.V1.TypeCode.String and Google.Cloud.Spanner.V1.TypeCode.Bytes
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSpannerDbType\u003c/code\u003e class represents the data types that can be stored in Google Cloud Spanner columns or returned from queries, with a wide range of types available, from \u003ccode\u003eBool\u003c/code\u003e and \u003ccode\u003eInt64\u003c/code\u003e to \u003ccode\u003eJson\u003c/code\u003e and \u003ccode\u003ePgJsonb\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eSpannerDbType\u003c/code\u003e class documentation is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, with many other versions available, allowing users to refer to previous implementations of this data type.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSpannerDbType\u003c/code\u003e provides static properties like \u003ccode\u003eBool\u003c/code\u003e, \u003ccode\u003eBytes\u003c/code\u003e, \u003ccode\u003eDate\u003c/code\u003e, \u003ccode\u003eFloat64\u003c/code\u003e, \u003ccode\u003eInt64\u003c/code\u003e, and more, which represent specific data types supported by Cloud Spanner.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSpannerDbType\u003c/code\u003e also contains methods such as \u003ccode\u003eArrayOf\u003c/code\u003e, \u003ccode\u003eFromClrType\u003c/code\u003e, \u003ccode\u003eTryParse\u003c/code\u003e and \u003ccode\u003eWithSize\u003c/code\u003e to facilitate the creation, parsing, and definition of array and sized types.\u003c/p\u003e\n"],["\u003cp\u003eThis documentation outlines \u003ccode\u003eSpannerDbType\u003c/code\u003e's properties like \u003ccode\u003eDbType\u003c/code\u003e, \u003ccode\u003eDefaultClrType\u003c/code\u003e, and \u003ccode\u003eSize\u003c/code\u003e, providing details on corresponding .NET types and size constraints.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Spanner.Data - Class SpannerDbType (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerDbType)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/5.0.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.6.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.5.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.4.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.3.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.2.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.1.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/4.0.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.15.1/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.14.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.13.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.12.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.11.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.10.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.9.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.8.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.7.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.6.0/Google.Cloud.Spanner.Data.SpannerDbType)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.Data/3.5.0/Google.Cloud.Spanner.Data.SpannerDbType) \n\n public sealed class SpannerDbType\n\nReference documentation and code samples for the Google.Cloud.Spanner.Data class SpannerDbType.\n\nRepresents a Type that can be stored in a Spanner column or returned from a query. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SpannerDbType \n\nInherited Members\n-----------------\n\n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.Data](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.Data.dll\n\nProperties\n----------\n\n### Bool\n\n public static SpannerDbType Bool { get; }\n\n`true` or `false`.\n\n### Bytes\n\n public static SpannerDbType Bytes { get; }\n\nA byte array (byte\\[\\]).\n\n### Date\n\n public static SpannerDbType Date { get; }\n\nA Date.\n\n### DbType\n\n public DbType DbType { get; }\n\nThe corresponding [DbType](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerDbType#Google_Cloud_Spanner_Data_SpannerDbType_DbType) for this Cloud Spanner type.\n\n### DefaultClrType\n\n public Type DefaultClrType { get; }\n\nThe default [Type](https://learn.microsoft.com/dotnet/api/system.type) for this Cloud Spanner type.\n\n### Float32\n\n public static SpannerDbType Float32 { get; }\n\n32 bit floating point number.\n\n### Float64\n\n public static SpannerDbType Float64 { get; }\n\n64 bit floating point number. This is equivalent to Float8 in the PostgreSQL dialect.\n\n### Int64\n\n public static SpannerDbType Int64 { get; }\n\n64 bit signed integer.\n\n### Interval\n\n public static SpannerDbType Interval { get; }\n\nRepresentation of Spanner's Interval type.\n\n### Json\n\n public static SpannerDbType Json { get; }\n\nA JSON-formatted string as described in RFC 7159.\n\n### Numeric\n\n public static SpannerDbType Numeric { get; }\n\nA fixed-point number with 29 decimal digits of precision in the whole component and 9 decimal digits of precision in the fractional component.\n\n### PgJsonb\n\n public static SpannerDbType PgJsonb { get; }\n\nRepresentation of PostgreSQL JSONB type.\n\n### PgNumeric\n\n public static SpannerDbType PgNumeric { get; }\n\nRepresentation of PostgreSQL numeric type.\nThe PostgreSQL numeric type has max precision of 147,455 and a max scale of 16383.\n\n### PgOid\n\n public static SpannerDbType PgOid { get; }\n\nRepresentation of PostgreSQL OID type.\n\n### Size\n\n public int? Size { get; }\n\nThe size of the Type, if set.\n\n### String\n\n public static SpannerDbType String { get; }\n\nA string.\n\n### Timestamp\n\n public static SpannerDbType Timestamp { get; }\n\nDate and Time.\n\n### Unspecified\n\n public static SpannerDbType Unspecified { get; }\n\nNot specified.\n\nMethods\n-------\n\n### ArrayOf(SpannerDbType)\n\n public static SpannerDbType ArrayOf(SpannerDbType elementType)\n\nCreates an array of the specified type. This can be done on any arbitrary [SpannerDbType](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerDbType).\nYou may use any type that implements IEnumerable as a source for the array. The type of each\nitem is determined by `elementType`.\nWhen calling [GetFieldValue\\\u003cT\\\u003e(string)](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerDataReader#Google_Cloud_Spanner_Data_SpannerDataReader_GetFieldValue__1_System_String_) the default type\nis [List\\\u003cT\\\u003e](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1). You may, however, specify any type that implements IList which\nhas a default constructor.\n\n### FromClrType(Type)\n\n public static SpannerDbType FromClrType(Type type)\n\nReturns a SpannerDbType given a ClrType.\nIf the type cannot be determined, [Unspecified](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerDbType#Google_Cloud_Spanner_Data_SpannerDbType_Unspecified) is returned.\n\n### GetHashCode()\n\n public override int GetHashCode()\n\nServes as the default hash function.\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### ToString()\n\n public override string ToString()\n\nReturns a string that represents the current object.\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### TryParse(string, out SpannerDbType)\n\n public static bool TryParse(string spannerType, out SpannerDbType spannerDbType)\n\nGiven a string representation, returns an instance of [SpannerDbType](/dotnet/docs/reference/Google.Cloud.Spanner.Data/latest/Google.Cloud.Spanner.Data.SpannerDbType).\n\n### WithSize(int)\n\n public SpannerDbType WithSize(int size)\n\nReturns a clone of this type with the specified size constraint.\nOnly valid on Google.Cloud.Spanner.V1.TypeCode.String and Google.Cloud.Spanner.V1.TypeCode.Bytes"]]