Data Access has been discontinued. Please refer to this page for more information.

Type Mapping

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

Telerik Data Access supports flexible mappings from .NET types (e.g., System.String) to database specific SQL types (e.g., VARCHAR on PostgreSQL). The default mappings can be customized for a specific datastore. The mapping for specific fields can also be customized. Mappings are resolved by first using any information specified for the field, then looking up a generic type for the type of the field using the .NET Type Mapping, then converting this generic type into actual SQL type information using the Generic Type Mapping. You can have different mapping information for each database supported by Telerik Data Access.

The following table shows the default mapping from .NET types to PostgreSQL specific types:

.NET Type PostgreSQL
System.Boolean BOOL
System.Char BPCHAR(1)
System.SByte INT2
System.Byte INT2
System.Int16 INT2
System.UInt16 INT4
System.Int32 INT4
System.UInt32 INT8
System.Int64 INT8
System.UInt64 NUMERIC(20)
System.Single FLOAT4
System.Double FLOAT8
System.String VARCHAR(255)
System.DateTime TIMESTAMP
System.Decimal NUMERIC(20,10)
System.Guid UUID
Byte[] BYTEA