diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a8e85..43332bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 3.5.5 - Better exception message when SSL is not supported. +- Fix: typo in type specification (`read` -> `real`, also keeping `read` for compatibility). ## 3.5.4 diff --git a/lib/src/types/type_registry.dart b/lib/src/types/type_registry.dart index 0226dad..a1aad50 100644 --- a/lib/src/types/type_registry.dart +++ b/lib/src/types/type_registry.dart @@ -207,7 +207,7 @@ final _builtInTypeNames = { 'polygon': Type.polygon, 'path': Type.path, 'circle': Type.circle, - 'read': Type.real, + 'real': Type.real, 'regtype': Type.regtype, 'serial4': Type.serial, 'serial8': Type.bigSerial, @@ -327,7 +327,14 @@ extension TypeRegistryExt on TypeRegistry { return _byTypeOid[oid] ?? UnknownType(oid); } - Type? resolveSubstitution(String name) => _bySubstitutionName[name]; + Type? resolveSubstitution(String name) { + if (name == 'read') { + print( + 'WARNING: Use `real` instead of `read` - will be removed in a future release.'); + return Type.real; + } + return _bySubstitutionName[name]; + } } EncodedValue? _defaultTextEncoder(TypedValue input, CodecContext context) {