File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,12 @@ class TableWriter extends TableOrViewWriter {
470
470
void _writeValidityCheckMethod () {
471
471
if (_skipVerification) return ;
472
472
473
+ // dont't verify custom columns, we assume that the user knows what they're
474
+ // doing
475
+ if (table.columns.every ((c) => c.typeConverter != null )) {
476
+ return ;
477
+ }
478
+
473
479
final innerType = emitter.dartCode (emitter.writer.rowType (table));
474
480
emitter
475
481
..writeln ('@override' )
Original file line number Diff line number Diff line change @@ -126,4 +126,32 @@ class Tags extends Table {
126
126
),
127
127
}, result.dartOutputs, result.writer);
128
128
});
129
+
130
+ test (
131
+ 'does not generate integrity check method when every column has a type converter' ,
132
+ () async {
133
+ final result = await emulateDriftBuild (
134
+ inputs: {
135
+ 'a|lib/a.dart' : '''
136
+ import 'package:drift/drift.dart';
137
+
138
+ enum Fruit {
139
+ apple,
140
+ pear,
141
+ }
142
+ class Foo extends Table {
143
+ Column<String> get fruit => textEnum<Fruit>()
144
+ .withDefault(const Variable('apple'))();
145
+ }
146
+ ''' ,
147
+ },
148
+ modularBuild: true ,
149
+ );
150
+
151
+ checkOutputs ({
152
+ 'a|lib/a.drift.dart' :
153
+ decodedMatches (isNot (contains ('instance.toColumns(true);' ))),
154
+ }, result.dartOutputs, result.writer);
155
+ },
156
+ );
129
157
}
You can’t perform that action at this time.
0 commit comments