Skip to content

Commit

Permalink
Remove legacy v2 APIs (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Aug 21, 2024
1 parent 794a99d commit 6350455
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 748 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 3.3.0

**Removed legacy v2 APIs.** These APIs were meant to be removed in `3.1.0`, but
were kept for a bit longer, as they didn't have any drawback to be around.
However, a planned redesign of the type customization would require to touch the
v2 codebase and it is not worth the effort to keep it much longer.

## 3.2.1

- Added or fixed decoders support for `QueryMode.simple`:
Expand Down
13 changes: 0 additions & 13 deletions lib/legacy.dart

This file was deleted.

13 changes: 0 additions & 13 deletions lib/src/types/type_registry.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import 'dart:convert';
import 'dart:typed_data';

import 'package:collection/collection.dart';
import 'package:meta/meta.dart';

import '../exceptions.dart';
import '../types.dart';
import 'generic_type.dart';
Expand Down Expand Up @@ -211,22 +208,12 @@ class TypeRegistry {
final _textEncoder = const PostgresTextEncoder();

extension TypeRegistryExt on TypeRegistry {
String? lookupTypeName(Type type) {
return _bySubstitutionName.entries
.firstWhereOrNull((e) => e.value == type)
?.key;
}

Type resolveOid(int oid) {
return _byTypeOid[oid] ?? UnknownType(oid);
}

Type? resolveSubstitution(String name) => _bySubstitutionName[name];

/// Note: this returns only types with oids.
@internal
Iterable<Type> get registered => _byTypeOid.values;

EncodeOutput? encodeValue(
Object? value, {
required Type type,
Expand Down
199 changes: 0 additions & 199 deletions lib/src/v2/connection.dart

This file was deleted.

Loading

0 comments on commit 6350455

Please sign in to comment.