-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Features
Documentation of the various features provided by the library
The ORM is able to take a .NET class definition and convert it to a SQL table definition. (Most ORMs go in the other direction.) It does this by examining all public properties of your classes and is assisted by attributes that you can use to specify column details.
The following attributes are used:
-
PrimaryKey
This property is the primary key of the table. Only single-column primary keys are supported. -
AutoIncrement
This property is automatically generated by the database upon insert. The propertytype should be an integer and should also be marked with thePrimaryKey
attribute. -
Indexed
This property should have an index created for it. -
MaxLength
If this property is aString
thenMaxLength
is used to specify thevarchar
max size. The default max length is 140. -
Ignore
This property will not be in the table.
The following data types are supported in properties:
-
Integers
are stored using theinteger
orbigint
SQLite types. -
Boolean
are stored asintegers
with the value1
designated astrue
while all other values arefalse
. -
Enums
are stored asintegers
using the enum's value. -
Singles
andDoubles
Floats are stored asfloat
columns. -
Strings
are stored usingvarchars
with a maximum size specified by theMaxLength
attribute. If the attribute isn't specified, the max length defaults to 140. -
DateTimes
are stored asdatetime
columns and are subject to the precision offered by SQLite. -
Byte arrays
byte[]
are stored asblob
columns. -
Guid
structures are stored asvarchar(36)
columns.