From 6b7397215825e093b4a324a92766c129cf80a581 Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Thu, 14 Dec 2023 23:43:43 +0100 Subject: [PATCH] Remove legacy v2 support. --- CHANGELOG.md | 4 + lib/legacy.dart | 13 -- lib/src/v2/connection.dart | 199 ----------------------- lib/src/v2/execution_context.dart | 158 ------------------ lib/src/v2/query.dart | 67 -------- lib/src/v2/substituter.dart | 18 --- lib/src/v2/transaction_proxy.dart | 20 --- lib/src/v2/v2_v3_delegate.dart | 259 ------------------------------ pubspec.yaml | 2 +- 9 files changed, 5 insertions(+), 735 deletions(-) delete mode 100644 lib/legacy.dart delete mode 100644 lib/src/v2/connection.dart delete mode 100644 lib/src/v2/execution_context.dart delete mode 100644 lib/src/v2/query.dart delete mode 100644 lib/src/v2/substituter.dart delete mode 100644 lib/src/v2/transaction_proxy.dart delete mode 100644 lib/src/v2/v2_v3_delegate.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index ebde1872..8886de85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.1.0 + +**BREAKING CHANGE**: Removed v2 support and `legacy.dart`. + ## 3.0.4 - Fix: SSL connection problem handler. diff --git a/lib/legacy.dart b/lib/legacy.dart deleted file mode 100644 index 0d916470..00000000 --- a/lib/legacy.dart +++ /dev/null @@ -1,13 +0,0 @@ -library legacy; - -import 'src/exceptions.dart'; -import 'src/types.dart'; - -export 'src/v2/connection.dart'; -export 'src/v2/execution_context.dart'; -export 'src/v2/substituter.dart'; - -@Deprecated('Do not use v2 API, will be removed in next release.') -typedef PostgreSQLDataType = Type; -@Deprecated('Do not use v2 API, will be removed in next release.') -typedef PostgreSQLSeverity = Severity; diff --git a/lib/src/v2/connection.dart b/lib/src/v2/connection.dart deleted file mode 100644 index 21334b7a..00000000 --- a/lib/src/v2/connection.dart +++ /dev/null @@ -1,199 +0,0 @@ -library postgres.connection; - -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; - -import 'package:meta/meta.dart'; - -import '../../postgres.dart' show ConnectionSettings, Endpoint, Notification; -import '../exceptions.dart'; -import '../messages/client_messages.dart'; -import '../messages/server_messages.dart'; -import '../replication.dart'; -import 'execution_context.dart'; -import 'v2_v3_delegate.dart'; - -part 'transaction_proxy.dart'; - -typedef PostgreSQLException = ServerException; - -/// Instances of this class connect to and communicate with a PostgreSQL database. -/// -/// The primary type of this library, a connection is responsible for connecting to databases and executing queries. -/// A connection may be opened with [open] after it is created. -@Deprecated('Do not use v2 API, will be removed in next release.') -abstract class PostgreSQLConnection implements PostgreSQLExecutionContext { - /// Returns a somewhat compatible version of [PostgreSQLConnection] - /// that is backed by the new v3 implementation. - static PostgreSQLConnection withV3( - Endpoint endpoint, { - ConnectionSettings? connectionSettings, - }) { - return WrappedPostgreSQLConnection( - endpoint, connectionSettings ?? ConnectionSettings()); - } - - final StreamController _notifications = - StreamController.broadcast(); - - final StreamController _messages = - StreamController.broadcast(); - - /// Hostname of database this connection refers to. - String get host; - - /// Port of database this connection refers to. - int get port; - - /// Name of database this connection refers to. - String get databaseName; - - /// Username for authenticating this connection. - String? get username; - - /// Password for authenticating this connection. - String? get password; - - /// Whether or not this connection should connect securely. - bool get useSSL; - - /// The amount of time this connection will wait during connecting before giving up. - int get timeoutInSeconds; - - /// The default timeout for [PostgreSQLExecutionContext]'s execute and query methods. - int get queryTimeoutInSeconds; - - /// The timezone of this connection for date operations that don't specify a timezone. - String get timeZone; - - /// The processID of this backend. - int get processID => _processID; - - /// If true, connection is made via unix socket. - bool get isUnixSocket; - - /// If true, allows password in clear text for authentication. - bool get allowClearTextPassword; - - /// The replication mode for connecting in streaming replication mode. - /// - /// When the value is set to either [ReplicationMode.physical] or [ReplicationMode.logical], - /// the query protocol will no longer work as the connection will be switched to a replication - /// connection. In other words, using the default [query] or [mappedResultsQuery] will cause - /// the database to throw an error and drop the connection. - /// - /// Use [query] `useSimpleQueryProtocol` set to `true` or [execute] for executing statements - /// while in replication mode. - /// - /// For more info, see [Streaming Replication Protocol] - /// - /// [Streaming Replication Protocol]: https://www.postgresql.org/docs/current/protocol-replication.html - ReplicationMode get replicationMode; - - /// Stream of notification from the database. - /// - /// Listen to this [Stream] to receive events from PostgreSQL NOTIFY commands. - /// - /// To determine whether or not the NOTIFY came from this instance, compare [processID] - /// to [Notification.processId]. - Stream get notifications => _notifications.stream; - - /// Stream of server messages - /// - /// Listen to this [Stream] to receive events for all PostgreSQL server messages - /// - /// This includes all messages whether from Extended Query Protocol, Simple Query Protocol - /// or Streaming Replication Protocol. - Stream get messages => _messages.stream; - - /// Reports on the latest known status of the connection: whether it was open or failed for some reason. - /// - /// This is `true` when this instance is first created and after it has been closed or encountered an unrecoverable error. - /// If a connection has already been opened and this value is now true, the connection cannot be reopened and a instance - /// must be created. - bool get isClosed; - - /// Settings values from the connected database. - /// - /// After connecting to a database, this map will contain the settings values that the database returns. - /// Prior to connection, it is the empty map. - final Map settings = {}; - - Socket? _socket; - late int _processID; - // ignore: unused_field - late int _secretKey; - - Socket? get socket => _socket; - - Encoding get _encoding; - @internal - Encoding get encoding => _encoding; - - /// Establishes a connection with a PostgreSQL database. - /// - /// This method will return a [Future] that completes when the connection is established. Queries can be executed - /// on this connection afterwards. If the connection fails to be established for any reason - including authentication - - /// the returned [Future] will return with an error. - /// - /// Connections may not be reopened after they are closed or opened more than once. If a connection has already been - /// opened and this method is called, an exception will be thrown. - Future open(); - - /// Closes a connection. - /// - /// After the returned [Future] completes, this connection can no longer be used to execute queries. Any queries in progress or queued are cancelled. - Future close(); - - /// Adds a Client Message to the existing connection - /// - /// This is a low level API and the message must follow the protocol of this - /// connection. It's the responsiblity of the caller to ensure this message - /// does not interfere with any running queries or transactions. - void addMessage(ClientMessage message) { - if (isClosed) { - throw PgException( - 'Attempting to add a message, but connection is not open.'); - } - _socket!.add(message.asBytes(encoding: encoding)); - } - - /// Executes a series of queries inside a transaction on this connection. - /// - /// Queries executed inside [queryBlock] will be grouped together in a transaction. The return value of the [queryBlock] - /// will be the wrapped in the [Future] returned by this method if the transaction completes successfully. - /// - /// If a query or execution fails - for any reason - within a transaction block, - /// the transaction will fail and previous statements within the transaction will not be committed. The [Future] - /// returned from this method will be completed with the error from the first failing query. - /// - /// Transactions may be cancelled by invoking [PostgreSQLExecutionContext.cancelTransaction] - /// within the transaction. This will cause this method to return a [Future] with a value of [PostgreSQLRollback]. This method does not throw an exception - /// if the transaction is cancelled in this way. - /// - /// All queries within a transaction block must be executed using the [PostgreSQLExecutionContext] passed into the [queryBlock]. - /// You must not issue queries to the receiver of this method from within the [queryBlock], otherwise the connection will deadlock. - /// - /// Queries within a transaction may be executed asynchronously or be awaited on. The order is still guaranteed. Example: - /// - /// connection.transaction((ctx) { - /// var rows = await ctx.query("SELECT id FROM t"); - /// if (!rows.contains([2])) { - /// ctx.query("INSERT INTO t (id) VALUES (2)"); - /// } - /// }); - /// - /// If specified, the final `"COMMIT"` query of the transaction will use - /// [commitTimeoutInSeconds] as its timeout, otherwise the connection's - /// default query timeout will be used. - Future transaction( - Future Function(PostgreSQLExecutionContext connection) queryBlock, { - int? commitTimeoutInSeconds, - }); - - @override - void cancelTransaction({String? reason}) { - // Default is no-op - } -} diff --git a/lib/src/v2/execution_context.dart b/lib/src/v2/execution_context.dart deleted file mode 100644 index 774441f0..00000000 --- a/lib/src/v2/execution_context.dart +++ /dev/null @@ -1,158 +0,0 @@ -// ignore_for_file: deprecated_member_use_from_same_package - -import 'dart:async'; - -import '../types.dart'; - -import 'connection.dart'; -import 'query.dart'; -import 'substituter.dart'; - -@Deprecated('Do not use v2 API, will be removed in next release.') -abstract class PostgreSQLExecutionContext { - /// Returns this context queue size - int get queueSize; - - /// Executes a query on this context. - /// - /// This method sends the query described by [fmtString] to the database and returns a [Future] whose value is the returned rows from the query after the query completes. - /// The format string may contain parameters that are provided in [substitutionValues]. Parameters are prefixed with the '@' character. Keys to replace the parameters - /// do not include the '@' character. For example: - /// - /// connection.query("SELECT * FROM table WHERE id = @idParam", {"idParam" : 2}); - /// - /// The type of the value is inferred by default, but should be made more specific by adding ':type" to the parameter pattern in the format string. For example: - /// - /// connection.query("SELECT * FROM table WHERE id = @idParam:int4", {"idParam" : 2}); - /// - /// Available types are listed in [PostgreSQLFormatIdentifier.typeStringToCodeMap]. Some types have multiple options. It is preferable to use the [PostgreSQLFormat.id] - /// function to add parameters to a query string. This method inserts a parameter name and the appropriate ':type' string for a [Type]. - /// - /// If successful, the returned [Future] completes with a [List] of rows. Each is row is represented by a [List] of column values for that row that were returned by the query. - /// - /// By default, instances of this class will reuse queries. This allows significantly more efficient transport to and from the database. You do not have to do - /// anything to opt in to this behavior, this connection will track the necessary information required to reuse queries without intervention. (The [fmtString] is - /// the unique identifier to look up reuse information.) You can disable reuse by passing false for [allowReuse]. - /// - /// [useSimpleQueryProtocol] indicates that the query will be executed using - /// the [Simple Query Protocol][]. This is similar to runing [execute] but - /// instead of receiving the `affectedRowCount` only, this method will return - /// [PostgreSQLResult] which contains `affectedRowCount` in addition to any - /// data returned by the executed statement. - /// - /// It's important to understand that when [useSimpleQueryProtocol] is `true`, - /// all values will be of type [String] even if they have different type in the - /// database. For instance, the value of an `int4` column will be returned as - /// a [String] instead of an [int]. - /// - /// Setting [useSimpleQueryProtocol] to `true` is mainly useful for when the - /// connection is established using the Streaming Replication Protocol. When - /// the connection is in replication mode, the default Extended Query Protocol - /// cannot be used as the database will throw an error and drop the connection. - /// In other words, only the Simple Query Protocol can be used with Streaming - /// Replication Protocol. - /// - /// [Simple Query Protocol]: https://www.postgresql.org/docs/current/protocol-flow.html#id-1.10.5.7.4 - Future query(String fmtString, - {Map? substitutionValues, - bool? allowReuse, - int? timeoutInSeconds, - bool? useSimpleQueryProtocol}); - - /// Executes a query on this context. - /// - /// This method sends a SQL string to the database this instance is connected to. Parameters can be provided in [fmtString], see [query] for more details. - /// - /// This method returns the number of rows affected and no additional information. This method uses the least efficient and less secure command - /// for executing queries in the PostgreSQL protocol; [query] is preferred for queries that will be executed more than once, will contain user input, - /// or return rows. - Future execute(String fmtString, - {Map? substitutionValues, int? timeoutInSeconds}); - - /// Cancels a transaction on this context. - /// - /// If this context is an instance of [PostgreSQLConnection], this method has no effect. If the context is a transaction context (passed as the argument - /// to [PostgreSQLConnection.transaction]), this will rollback the transaction. - void cancelTransaction({String? reason}); - - /// Executes a query on this connection and returns each row as a [Map]. - /// - /// This method constructs and executes a query in the same way as [query], but returns each row as a [Map]. - /// - /// (Note: this method will execute additional queries to resolve table names the first time a table is encountered. These table names are cached per instance of this type.) - /// - /// Each row map contains key-value pairs for every table in the query. The value is a [Map] that contains - /// key-value pairs for each column from that table. For example, consider - /// the following query: - /// - /// SELECT employee.id, employee.name FROM employee; - /// - /// This method would return the following structure: - /// - /// [ - /// {"employee" : {"name": "Bob", "id": 1}} - /// ] - /// - /// The purpose of this nested structure is to disambiguate columns that have the same name in different tables. For example, consider a query with a SQL JOIN: - /// - /// SELECT employee.id, employee.name, company.name FROM employee LEFT OUTER JOIN company ON employee.company_id=company.id; - /// - /// Each returned [Map] would contain `employee` and `company` keys. The `name` key would be present in both inner maps. - /// - /// [ - /// { - /// "employee": {"name": "Bob", "id": 1}, - /// "company: {"name": "stable|kernel"} - /// } - /// ] - Future>>> mappedResultsQuery( - String fmtString, - {Map? substitutionValues, - bool? allowReuse, - int? timeoutInSeconds}); -} - -/// A description of a column. -@Deprecated('Do not use v2 API, will be removed in next release.') -class ColumnDescription { - /// The name of the column returned by the query. - final String columnName; - - /// The resolved name of the referenced table. - final String tableName; - - /// The Object Identifier of the column type. - final int typeId; - - ColumnDescription({ - required this.typeId, - required this.tableName, - required this.columnName, - }); -} - -/// A single row of a query result. -/// -/// Column values can be accessed through the `[]` operator. -@Deprecated('Do not use v2 API, will be removed in next release.') -abstract class PostgreSQLResultRow implements List { - List get columnDescriptions; - - /// Returns a two-level map that on the first level contains the resolved - /// table name, and on the second level the column name (or its alias). - Map> toTableColumnMap(); - - /// Returns a single-level map that maps the column name (or its alias) to the - /// value returned on that position. - Map toColumnMap(); -} - -/// The query result. -/// -/// Rows can be accessed through the `[]` operator. -@Deprecated('Do not use v2 API, will be removed in next release.') -abstract class PostgreSQLResult implements List { - /// How many rows did this query affect? - int get affectedRowCount; - List get columnDescriptions; -} diff --git a/lib/src/v2/query.dart b/lib/src/v2/query.dart deleted file mode 100644 index d9e43ccf..00000000 --- a/lib/src/v2/query.dart +++ /dev/null @@ -1,67 +0,0 @@ -import 'package:postgres/src/types/type_registry.dart'; - -import '../types.dart'; - -@Deprecated('Do not use v2 API, will be removed in next release.') -class ParameterValue extends TypedValue { - ParameterValue(Type? type, Object? value) - : super(type ?? Type.unspecified, value); -} - -@Deprecated('Do not use v2 API, will be removed in next release.') -typedef SQLReplaceIdentifierFunction = String Function( - PostgreSQLFormatIdentifier identifier, int index); - -@Deprecated('Do not use v2 API, will be removed in next release.') -enum PostgreSQLFormatTokenType { text, variable } - -@Deprecated('Do not use v2 API, will be removed in next release.') -class PostgreSQLFormatToken { - PostgreSQLFormatToken(this.type); - - PostgreSQLFormatTokenType type; - StringBuffer buffer = StringBuffer(); -} - -@Deprecated('Do not use v2 API, will be removed in next release.') -class PostgreSQLFormatIdentifier { - static final typeStringToCodeMap = TypeRegistry(); - - factory PostgreSQLFormatIdentifier(String t) { - String name; - Type? type; - String? typeCast; - - final components = t.split('::'); - if (components.length > 1) { - typeCast = components.sublist(1).join(''); - } - - final variableComponents = components.first.split(':'); - if (variableComponents.length == 1) { - name = variableComponents.first; - } else if (variableComponents.length == 2) { - name = variableComponents.first; - - final dataTypeString = variableComponents.last; - type = typeStringToCodeMap.resolveSubstitution(dataTypeString); - if (type == null) { - throw FormatException( - "Invalid type code in substitution variable '$t'"); - } - } else { - throw FormatException( - "Invalid format string identifier, must contain identifier name and optionally one data type in format '@identifier:dataType' (offending identifier: $t)"); - } - - // Strip @ - name = name.substring(1, name.length); - return PostgreSQLFormatIdentifier._(name, type, typeCast); - } - - PostgreSQLFormatIdentifier._(this.name, this.type, this.typeCast); - - final String name; - final Type? type; - final String? typeCast; -} diff --git a/lib/src/v2/substituter.dart b/lib/src/v2/substituter.dart deleted file mode 100644 index 674b47aa..00000000 --- a/lib/src/v2/substituter.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:postgres/src/types/type_registry.dart'; - -import '../types.dart'; - -@Deprecated('Do not use v2 API, will be removed in next release.') -class PostgreSQLFormat { - static String id(String name, {Type? type}) { - if (type != null) { - return '@$name:${dataTypeStringForDataType(type)}'; - } - - return '@$name'; - } - - static String? dataTypeStringForDataType(Type? dt) { - return dt == null ? null : TypeRegistry().lookupTypeName(dt); - } -} diff --git a/lib/src/v2/transaction_proxy.dart b/lib/src/v2/transaction_proxy.dart deleted file mode 100644 index 046d6b77..00000000 --- a/lib/src/v2/transaction_proxy.dart +++ /dev/null @@ -1,20 +0,0 @@ -// ignore_for_file: deprecated_member_use_from_same_package - -part of 'connection.dart'; - -/// Represents a rollback from a transaction. -/// -/// If a transaction is cancelled using [PostgreSQLExecutionContext.cancelTransaction], the value of the [Future] -/// returned from [PostgreSQLConnection.transaction] will be an instance of this type. [reason] will be the [String] -/// value of the optional argument to [PostgreSQLExecutionContext.cancelTransaction]. -@Deprecated('Do not use v2 API, will be removed in next release.') -class PostgreSQLRollback { - @internal - PostgreSQLRollback(this.reason); - - /// The reason the transaction was cancelled. - final String reason; - - @override - String toString() => 'PostgreSQLRollback: $reason'; -} diff --git a/lib/src/v2/v2_v3_delegate.dart b/lib/src/v2/v2_v3_delegate.dart deleted file mode 100644 index 68f29626..00000000 --- a/lib/src/v2/v2_v3_delegate.dart +++ /dev/null @@ -1,259 +0,0 @@ -// ignore_for_file: deprecated_member_use_from_same_package - -import 'dart:collection'; -import 'dart:convert'; - -import 'dart:io'; - -import '../../messages.dart'; -import '../../postgres.dart'; -import 'connection.dart'; -import 'execution_context.dart'; - -mixin _DelegatingContext implements PostgreSQLExecutionContext { - Session? get _session; - - @override - void cancelTransaction({String? reason}) { - if (_session is Connection) { - return; - } - throw _CancelTx(); - } - - @override - Future execute(String fmtString, - {Map? substitutionValues, int? timeoutInSeconds}) async { - if (_session case final Session session) { - final rs = await session.execute( - Sql.named(fmtString), - parameters: substitutionValues, - ignoreRows: true, - ); - return rs.affectedRows; - } else { - throw ServerException( - 'Attempting to execute query, but connection is not open.'); - } - } - - @override - Future>>> mappedResultsQuery( - String fmtString, - {Map? substitutionValues, - bool? allowReuse, - int? timeoutInSeconds}) async { - throw UnimplementedError('table name is not resolved in v3'); - } - - @override - Future<_PostgreSQLResult> query(String fmtString, - {Map? substitutionValues, - bool? allowReuse, - int? timeoutInSeconds, - bool? useSimpleQueryProtocol}) async { - if (_session case final Session session) { - final rs = await session.execute( - Sql.named(fmtString), - parameters: substitutionValues, - queryMode: (useSimpleQueryProtocol ?? false) ? QueryMode.simple : null, - timeout: timeoutInSeconds == null - ? null - : Duration(seconds: timeoutInSeconds), - ); - return _PostgreSQLResult(rs, rs.map((e) => _PostgreSQLResultRow(e, e))); - } else { - throw PostgreSQLException( - 'Attempting to execute query, but connection is not open.'); - } - } - - @override - int get queueSize => throw UnimplementedError(); -} - -@Deprecated('Do not use v2 API, will be removed in next release.') -class WrappedPostgreSQLConnection - with _DelegatingContext - implements PostgreSQLConnection { - final Endpoint _endpoint; - final ConnectionSettings _connectionSettings; - Connection? _connection; - bool _hasConnectedPreviously = false; - - WrappedPostgreSQLConnection(this._endpoint, this._connectionSettings); - - @override - Session? get _session => _connection; - - @override - void addMessage(ClientMessage message) { - throw UnimplementedError(); - } - - @override - bool get allowClearTextPassword => throw UnimplementedError(); - - @override - Future close() async { - await _connection?.close(); - _connection = null; - } - - @override - String get databaseName => throw UnimplementedError(); - - @override - Encoding get encoding => throw UnimplementedError(); - - @override - String get host => throw UnimplementedError(); - - @override - bool get isClosed => throw UnimplementedError(); - - @override - bool get isUnixSocket => throw UnimplementedError(); - - @override - Stream get messages => throw UnimplementedError(); - - @override - Stream get notifications => _connection!.channels.all; - - @override - Future open() async { - if (_hasConnectedPreviously) { - throw PostgreSQLException( - 'Attempting to reopen a closed connection. Create a instance instead.'); - } - - _hasConnectedPreviously = true; - _connection = await Connection.open( - _endpoint, - settings: _connectionSettings, - ); - } - - @override - String? get password => throw UnimplementedError(); - - @override - int get port => throw UnimplementedError(); - - @override - int get processID => throw UnimplementedError(); - - @override - int get queryTimeoutInSeconds => throw UnimplementedError(); - - @override - int get queueSize => throw UnimplementedError(); - - @override - ReplicationMode get replicationMode => throw UnimplementedError(); - - @override - Map get settings => throw UnimplementedError(); - - @override - Socket? get socket => throw UnimplementedError(); - - @override - String get timeZone => throw UnimplementedError(); - - @override - int get timeoutInSeconds => throw UnimplementedError(); - - @override - Future transaction( - Future Function(PostgreSQLExecutionContext connection) queryBlock, { - int? commitTimeoutInSeconds, - }) async { - if (_connection case final Connection conn) { - try { - return await conn.runTx((session) async { - return await queryBlock(_PostgreSQLExecutionContext(session)); - }); - } on _CancelTx catch (_) { - return PostgreSQLRollback(''); - } - } else { - throw PostgreSQLException( - 'Attempting to execute query, but connection is not open.'); - } - } - - @override - bool get useSSL => throw UnimplementedError(); - - @override - String? get username => throw UnimplementedError(); -} - -class _CancelTx implements Exception {} - -class _PostgreSQLResult extends UnmodifiableListView - implements PostgreSQLResult { - final Result _result; - _PostgreSQLResult(this._result, super.source); - - @override - int get affectedRowCount => _result.affectedRows; - - @override - late final columnDescriptions = _result.schema.columns - .map((e) => _ColumnDescription( - typeId: e.type.oid ?? 0, - columnName: e.columnName ?? '', - )) - .toList(); -} - -class _PostgreSQLResultRow extends UnmodifiableListView - implements PostgreSQLResultRow { - final ResultRow _row; - _PostgreSQLResultRow(this._row, super.source); - - @override - late final columnDescriptions = _row.schema.columns - .map((e) => _ColumnDescription( - typeId: e.type.oid ?? 0, - columnName: e.columnName ?? '', - )) - .toList(); - - @override - Map toColumnMap() => _row.toColumnMap(); - - @override - Map> toTableColumnMap() { - throw UnimplementedError('table name is not resolved in v3'); - } -} - -class _PostgreSQLExecutionContext - with _DelegatingContext - implements PostgreSQLExecutionContext { - @override - final Session _session; - - _PostgreSQLExecutionContext(this._session); -} - -class _ColumnDescription implements ColumnDescription { - @override - final String columnName; - - @override - String get tableName => - throw UnimplementedError('table name is not resolved in v3'); - - @override - final int typeId; - - _ColumnDescription({ - required this.columnName, - required this.typeId, - }); -} diff --git a/pubspec.yaml b/pubspec.yaml index dcd536ca..f61e1fe1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: postgres description: PostgreSQL database driver. Supports statement reuse and binary protocol and connection pooling. -version: 3.0.4 +version: 3.1.0 homepage: https://github.com/isoos/postgresql-dart topics: - sql