Remove legacy type inference

This commit is contained in:
Simon Binder 2020-12-12 19:55:43 +01:00
parent 9025280a89
commit 5eda201749
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
5 changed files with 4 additions and 15 deletions

View File

@ -58,9 +58,6 @@ At the moment, moor supports these options:
details.
* `eagerly_load_dart_ast`: Moor's builder will load the resolved AST whenever it encounters a Dart file,
instead of lazily when it reads a table. This is used to investigate rare builder crashes.
* `legacy_type_inference`: Use the old type inference from moor 1 and 2. Note that `use_experimental_inference`
is now the default and no longer exists.
If you're using this flag, please open an issue and explain how the new inference isn't working for you, thanks!
* `data_class_to_companions` (defaults to `true`): Controls whether moor will write the `toCompanion` method in generated
data classes.
* `mutable_classes` (defaults to `false`): The fields generated in generated data, companion and result set classes are final

View File

@ -1,3 +1,7 @@
## 4.0.0
- Remove the `legacy_type_inference` option
## 3.4.0
- Add experimental apis for schema verification

View File

@ -57,11 +57,6 @@ class MoorOptions {
@JsonKey(name: 'generate_connect_constructor', defaultValue: false)
final bool generateConnectConstructor;
/// Whether the old, legacy type inference engine should be used when
/// analyzing custom sql queries.
@JsonKey(name: 'legacy_type_inference', defaultValue: false)
final bool legacyTypeInference;
@JsonKey(name: 'sqlite_modules', defaultValue: [])
final List<SqlModule> modules;
@ -96,7 +91,6 @@ class MoorOptions {
this.useDataClassNameForCompanions = false,
this.useColumnNameAsJsonKeyWhenDefinedInMoorFile = false,
this.generateConnectConstructor = false,
this.legacyTypeInference = false,
this.eagerlyLoadDartAst = false,
this.dataClassToCompanions = true,
this.generateMutableClasses = false,

View File

@ -16,7 +16,6 @@ MoorOptions _$MoorOptionsFromJson(Map<String, dynamic> json) {
'use_data_class_name_for_companions',
'use_column_name_as_json_key_when_defined_in_moor_file',
'generate_connect_constructor',
'legacy_type_inference',
'sqlite_modules',
'eagerly_load_dart_ast',
'data_class_to_companions',
@ -50,9 +49,6 @@ MoorOptions _$MoorOptionsFromJson(Map<String, dynamic> json) {
generateConnectConstructor: $checkedConvert(
json, 'generate_connect_constructor', (v) => v as bool) ??
false,
legacyTypeInference:
$checkedConvert(json, 'legacy_type_inference', (v) => v as bool) ??
false,
eagerlyLoadDartAst:
$checkedConvert(json, 'eagerly_load_dart_ast', (v) => v as bool) ??
false,
@ -91,7 +87,6 @@ MoorOptions _$MoorOptionsFromJson(Map<String, dynamic> json) {
'useColumnNameAsJsonKeyWhenDefinedInMoorFile':
'use_column_name_as_json_key_when_defined_in_moor_file',
'generateConnectConstructor': 'generate_connect_constructor',
'legacyTypeInference': 'legacy_type_inference',
'eagerlyLoadDartAst': 'eagerly_load_dart_ast',
'dataClassToCompanions': 'data_class_to_companions',
'generateMutableClasses': 'mutable_classes',

View File

@ -44,7 +44,6 @@ class MoorSession {
if (options.hasModule(SqlModule.json1)) const Json1Extension(),
if (options.hasModule(SqlModule.moor_ffi)) const MoorFfiExtension(),
],
useLegacyTypeInference: options.legacyTypeInference,
);
return SqlEngine(sqlOptions);