From 62c347f0854ed5445767ccb4128ed8b6e9b81ef9 Mon Sep 17 00:00:00 2001 From: danylo-safonov-solid Date: Fri, 15 Sep 2023 14:16:08 +0300 Subject: [PATCH] partialconnectionoptions upd --- lib/src/client_options.dart | 3 ++- lib/src/partial_connection_options.dart | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 lib/src/partial_connection_options.dart diff --git a/lib/src/client_options.dart b/lib/src/client_options.dart index eff0bae..d5b5b56 100644 --- a/lib/src/client_options.dart +++ b/lib/src/client_options.dart @@ -1,6 +1,7 @@ import 'dart:js_interop'; import 'dart:js_util'; +import 'package:deno_postgres_interop/src/partial_connection_options.dart'; import 'package:deno_postgres_interop/src/transport.dart'; /// [deno-postgres@v0.17.0/ClientOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=ClientOptions). @@ -25,7 +26,7 @@ class ClientOptions { /// [deno-postgres@v0.17.0/ClientOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=ClientOptions). extension ClientOptionsProps on ClientOptions { /// [deno-postgres@v0.17.0/ClientOptions/connection](https://deno.land/x/postgres@v0.17.0/mod.ts?s=ClientOptions#prop_connection). - // external Partial get connection; + external PartialConnectionOptions get connection; /// [deno-postgres@v0.17.0/ClientOptions/host_type](https://deno.land/x/postgres@v0.17.0/mod.ts?s=ClientOptions#prop_host_type). Transport get hostType => Transport.parse(getProperty(this, 'host_type')); diff --git a/lib/src/partial_connection_options.dart b/lib/src/partial_connection_options.dart new file mode 100644 index 0000000..96a2b79 --- /dev/null +++ b/lib/src/partial_connection_options.dart @@ -0,0 +1,12 @@ +import 'dart:js_interop'; + +/// [deno-postgres@v0.17.0/ConnectionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=ConnectionOptions) +/// but [partial](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) (everything is optional). +@JS() +class PartialConnectionOptions { + /// [deno-postgres@v0.17.0/ConnectionOptions/attempts](https://deno.land/x/postgres@v0.17.0/mod.ts?s=ConnectionOptions#prop_attempts). + external int? get attempts; + + /// [deno-postgres@v0.17.0/ConnectionOptions/interval](https://deno.land/x/postgres@v0.17.0/mod.ts?s=ConnectionOptions#interval). + // external int? get interval; +}