Sqlite Datatype Mapping to .net (CLR) framework datatypes
Please can any one give me some authentic information regarding data type mappings from Sqlite to开发者_Go百科 .net (CLR) framework.
Regards
Umair
SQLite is kind of odd (for a database) in that it uses a dynamic type system. The type is associated with the data, not the column.
From SQLite website:
Data types supported by SQLite are:
NULL. The value is a NULL value. INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8
bytes depending on the magnitude of the value.
REAL. The value is a floating point value, stored as an 8-byte IEEE
floating point number.
TEXT. The value is a text string, stored using the database encoding
(UTF-8, UTF-16BE or UTF-16LE).
BLOB. The value is a blob of data, stored exactly as it was input.
Even dates are stored as one of those types:
1.2 Date and Time Datatype
SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:
TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS"). REAL as Julian day numbers, the number of days since noon in Greenwich
on November 24, 4714 B.C. according to the proleptic Gregorian calendar. INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.
Applications can chose to store dates and times in any of these formats and freely convert between formats using the built-in date and time functions.
So SQLite associates data with one of those 5 types (including NULL) and the application is responsible for interpreting the data as something more specific (e.g. TEXT to DateTime, in the case of .NET).
Not sure what you entirely mean.
There are no real mappings as such. SQLLite is a separate DB technology on its own and there is .NET wrapper (or wrappers) around it. The most famous one is : http://sqlite.phxsoftware.com/
If you look at this page (Its the official SQL Lite website):
http://www.sqlite.org/datatype3.html
You can see all the Data Types in SQL Lite in there. Now some are pretty obvious like char, int, etc. The ones you're not sure of, you can update your question and post them in?
HTH
精彩评论