This repository was archived by the owner on Dec 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
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
| .NET (C#) | MS SQL Server | MySql | PostgreSQL | SQLite | SQL CE | FireBird |
|---|---|---|---|---|---|---|
| DateTime | date, datetime, datetime2, smalldatetime | |||||
| DateTimeOffset | datetimeoffset | |||||
| TimeSpan | bigint |
| .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 |
| .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 |
| .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) |