You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using version package (https://pub.dev/packages/version) and sqlite3 at the same time, there is clash with imports even when of the package is aliased.
part of'db.dart';
@DataClassName('UserProfileRow')
classUserProfilesextendsTable {
IntColumnget id =>integer().autoIncrement()();
TextColumnget userName =>text()();
TextColumnget apiVersion =>text().map(const_VersionConverter())();
@overrideList<Set<Column<Object>>> get uniqueKeys => [
{userName},
];
constUserProfiles();
}
// Version is from `Version` packageclass_VersionConverterextendsTypeConverter<Version, String> {
const_VersionConverter();
@overrideVersionfromSql(String fromDb) {
returnVersion.parse(fromDb);
}
@overrideStringtoSql(Version value) {
return value.toString();
}
}
sqlite3 package is aliased.
Generated part
db.drift.dart
// in $UserProfilesTable // error: A value of type '_VersionConverter' can't be assigned to a variable of type 'TypeConverter<Version, String>'.// Try changing the type of the variable, or casting the right-hand type to 'TypeConverter<Version, String>staticTypeConverter<sqlite.Version, String> $converterapiVersion =const_VersionConverter();
Error:
A value of type '_VersionConverter' can't be assigned to a variable of type 'TypeConverter<Version, String>'.
Try changing the type of the variable, or casting the right-hand type to 'TypeConverter<Version, String>
Thanks for the report. Unfortunately there's always a little bit of guesswork involved when finding import aliases (since we only have the URI and a name available at that point in the generator, and the URI is not always reliable). I have improved this so that we're able to at least distinguish between different packages, the fix will be part of the next drift release.
Describe the bug
When using
version
package (https://pub.dev/packages/version) andsqlite3
at the same time, there is clash with imports even when of the package is aliased.db.dart
UserTable
sqlite3 package is aliased.
Generated part
db.drift.dart
Error:
notice that Version is prefixed with sqlite.
build.yaml configuration
Dart version
Expected behavior
Drift will not mismatch imported aliases Version (from package Version) and sqlite3.Version
The text was updated successfully, but these errors were encountered: