Skip to content

Commit 6491e35

Browse files
authored
Fix read->real typo. (#422)
1 parent cf7b950 commit 6491e35

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 3.5.5
44

55
- Better exception message when SSL is not supported.
6+
- Fix: typo in type specification (`read` -> `real`, also keeping `read` for compatibility).
67

78
## 3.5.4
89

lib/src/types/type_registry.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ final _builtInTypeNames = <String, Type>{
207207
'polygon': Type.polygon,
208208
'path': Type.path,
209209
'circle': Type.circle,
210-
'read': Type.real,
210+
'real': Type.real,
211211
'regtype': Type.regtype,
212212
'serial4': Type.serial,
213213
'serial8': Type.bigSerial,
@@ -327,7 +327,14 @@ extension TypeRegistryExt on TypeRegistry {
327327
return _byTypeOid[oid] ?? UnknownType(oid);
328328
}
329329

330-
Type? resolveSubstitution(String name) => _bySubstitutionName[name];
330+
Type? resolveSubstitution(String name) {
331+
if (name == 'read') {
332+
print(
333+
'WARNING: Use `real` instead of `read` - will be removed in a future release.');
334+
return Type.real;
335+
}
336+
return _bySubstitutionName[name];
337+
}
331338
}
332339

333340
EncodedValue? _defaultTextEncoder(TypedValue input, CodecContext context) {

0 commit comments

Comments
 (0)