-
-
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:
-
PrimaryKeyThis property is the primary key of the table. Only single-column primary keys are supported. -
AutoIncrementThis property is automatically generated by the database upon insert. The propertytype should be an integer and should also be marked with thePrimaryKeyattribute. -
IndexedThis property should have an index created for it. -
MaxLengthIf this property is aStringthenMaxLengthis used to specify thevarcharmax size. The default max length is 140. -
IgnoreThis property will not be in the table.
The following data types are supported in properties:
-
Integersare stored using theintegerorbigintSQLite types. -
Booleanare stored asintegerswith the value1designated astruewhile all other values arefalse. -
Enumsare stored asintegersusing the enum's value. -
SinglesandDoublesFloats are stored asfloatcolumns. -
Stringsare stored usingvarcharswith a maximum size specified by theMaxLengthattribute. If the attribute isn't specified, the max length defaults to 140. -
DateTimesare stored asdatetimecolumns and are subject to the precision offered by SQLite. -
Byte arrays
byte[]are stored asblobcolumns. -
Guidstructures are stored asvarchar(36)columns.