Skip to content

Fix read->real typo. #422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 9 additions & 2 deletions lib/src/types/type_registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ final _builtInTypeNames = <String, Type>{
'polygon': Type.polygon,
'path': Type.path,
'circle': Type.circle,
'read': Type.real,
'real': Type.real,
'regtype': Type.regtype,
'serial4': Type.serial,
'serial8': Type.bigSerial,
Expand Down Expand Up @@ -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) {
Expand Down