mirror of https://github.com/AMT-Cheif/drift.git
Fix booleans not working as expected in mapFromCompanion (#559)
This commit is contained in:
parent
cf830165e1
commit
5c3671b465
|
@ -68,9 +68,10 @@ mixin TableInfo<TableDsl extends Table, D extends DataClass> on Table
|
|||
'evaluated by a database engine.');
|
||||
}
|
||||
|
||||
final context = GenerationContext(SqlTypeSystem.defaultInstance, null);
|
||||
final rawValues = asColumnMap
|
||||
.cast<String, Variable>()
|
||||
.map((key, value) => MapEntry(key, value.value));
|
||||
.map((key, value) => MapEntry(key, value.mapToSimpleValue(context)));
|
||||
|
||||
return map(rawValues);
|
||||
}
|
||||
|
|
|
@ -39,7 +39,8 @@ void main() {
|
|||
id: Value(3),
|
||||
name: Value('hi'),
|
||||
profilePicture: Value.absent(),
|
||||
isAwesome: Value(true),
|
||||
// false for https://github.com/simolus3/moor/issues/559
|
||||
isAwesome: Value(false),
|
||||
);
|
||||
|
||||
final user = db.users.mapFromCompanion(companion);
|
||||
|
@ -49,7 +50,7 @@ void main() {
|
|||
id: 3,
|
||||
name: 'hi',
|
||||
profilePicture: null,
|
||||
isAwesome: true,
|
||||
isAwesome: false,
|
||||
creationTime: null,
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue