let table_row: User = User {
id: PrimaryKey::default(),
username: "mjovanc".to_string(),
email: "mjovanc@icloud.com".to_string(),
address: "Some Random Address 1".to_string(),
};
When setting it to ::default we are saying that we want the database to increment the id field automatically using autoincrement.
Just thinking of creating a custom field type called
PrimaryKey
to add to a field for exampleid
: https://github.com/njord-rs/njord/blob/master/njord/tests/sqlite_test.rs#L15Some example implementation:
Usage example:
When setting it to ::default we are saying that we want the database to increment the id field automatically using autoincrement.