Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Data Type Mapping

Trevor Pilley edited this page Apr 18, 2015 · 5 revisions

MicroLite supports mapping any .NET primitive type and some complex types to database types. The following table lists the currently supported type mapping:

TODO: populate the values for MySql, PostgreSQL and SQLite, SQL CE, Firebird

Date and Time Mapping

.NET (C#) MS SQL Server MySql PostgreSQL SQLite SQL CE FireBird
DateTime date, datetime, datetime2, smalldatetime
DateTimeOffset datetimeoffset
TimeSpan bigint

Numeric Mapping

.NET (C#) MS SQL Server MySql PostgreSQL SQLite SQL CE FireBird
bool bit
byte tinyint
short smallint
int int
long bigint
float float, real
double float
decimal decimal, smallmoney, money, numeric

Text and XML Mapping

.NET (C#) MS SQL Server MySql PostgreSQL SQLite SQL CE FireBird
char char(1)
string char(n), nchar(n), varchar(n), nvarchar(n), ntext, text
XDocument varchar(n), nvarchar(n), text, ntext, xml

Other

.NET (C#) MS SQL Server MySql PostgreSQL SQLite SQL CE FireBird
Enum tinyint, smallint, int, bigint
Guid uniqueidentifier
Uri char(n), nchar(n), varchar(n), nvarchar(n)
Clone this wiki locally