quds_db 0.0.2+2 quds_db: ^0.0.2+2 copied to clipboard
A sqflite expansion package that simplifies creating databases and tables, crud operations, queries with modelization
Quds Db #
Is an automated version of sqflite!
How to use #
1. To create a model
Model classes should extend DbModel class. Define the schema of your model, Supported field type:
Integers | Strings | DateTimes | Others |
---|---|---|---|
IdField | StringField | DateTimeField (saved as num) | BlobField |
IntField | DateTimeStringField (Saved as string) | BoolField | |
NumField | ColorField | ||
DoubleField |
class Note extends DbModel {
var title = StringField(columnName: 'title');
var content = StringField(columnName: 'content');
var isImportant = BoolField(columnName: 'isImportant');
var color = ColorField(columnName: 'color');
@override
List<FieldWithValue>? getFields() => [title, content, isImportant, color];
}
Note that: Every model has default fields:
- id (Auto incremental integer field)
- creationTime (automatically set once when created)
- modificationTime (automatically set when created, and with every update operation)
#### 2. To create a table manager ``` class NotesProvider extends DbTableProvider