Skip to content

Commit

Permalink
rename Type.char -> character (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Dec 23, 2023
1 parent adb99ec commit 26ad21e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/src/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ abstract class Type<T extends Object> {
static const unspecified = UnspecifiedType();

/// Must be a [String]
static const char = GenericType<String>(TypeOid.char);
static const character = GenericType<String>(TypeOid.character);

/// Must be a [String].
static const text = GenericType<String>(TypeOid.text);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/types/binary_codec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class PostgresBinaryEncoder {
throw FormatException(
'Invalid type for parameter value. Expected: int Got: ${input.runtimeType}');
}
case TypeOid.char:
case TypeOid.character:
case TypeOid.name:
case TypeOid.text:
case TypeOid.varChar:
Expand Down Expand Up @@ -519,7 +519,7 @@ class PostgresBinaryDecoder {
ByteData.view(input.buffer, input.offsetInBytes, input.lengthInBytes);

switch (typeOid) {
case TypeOid.char:
case TypeOid.character:
case TypeOid.name:
case TypeOid.text:
case TypeOid.varChar:
Expand Down
2 changes: 1 addition & 1 deletion lib/src/types/text_codec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class PostgresTextDecoder {
Object? convert(DecodeInput di) {
// ignore: unnecessary_cast
switch (_typeOid) {
case TypeOid.char:
case TypeOid.character:
case TypeOid.name:
case TypeOid.text:
case TypeOid.varChar:
Expand Down
10 changes: 5 additions & 5 deletions lib/src/types/type_registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TypeOid {
static const boolean = 16;
static const booleanArray = 1000;
static const byteArray = 17;
static const char = 1042;
static const character = 1042;
static const date = 1082;
static const double = 701;
static const doubleArray = 1022;
Expand Down Expand Up @@ -48,7 +48,7 @@ class TypeOid {

final _builtInTypes = <Type>{
Type.unspecified,
Type.char,
Type.character,
Type.name,
Type.text,
Type.varChar,
Expand Down Expand Up @@ -83,9 +83,9 @@ final _builtInTypeNames = <String, Type>{
'bigint': Type.bigInteger,
'boolean': Type.boolean,
'bytea': Type.byteArray,
'bpchar': Type.char,
'char': Type.char,
'character': Type.char,
'bpchar': Type.character,
'char': Type.character,
'character': Type.character,
'date': Type.date,
'double precision': Type.double,
'float4': Type.real,
Expand Down
1 change: 0 additions & 1 deletion test/encoding_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ void main() {
);
});


test('varchar', () async {
await expectReversible(
'varchar',
Expand Down

0 comments on commit 26ad21e

Please sign in to comment.