From 162e09fc62c61b5c0845d8a4ab3222f0347a97ee Mon Sep 17 00:00:00 2001 From: danylo-safonov-solid Date: Thu, 21 Sep 2023 18:46:29 +0300 Subject: [PATCH] fin --- README.md | 8 -------- lib/src/connection.dart | 1 + lib/src/query_client.dart | 7 +++++-- 3 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 lib/src/connection.dart diff --git a/README.md b/README.md index 3f08f3c..60320a8 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,3 @@ The main scenario is Supabase Edge Functions, but it should also work for other Note: your filename may differ from the example 5. You can use the function now. - -## Unimplemented -- [ ] QueryClient - -- errors: - - [ ] TransactionError - - [ ] ConnectionError - - [ ] PostgresError diff --git a/lib/src/connection.dart b/lib/src/connection.dart new file mode 100644 index 0000000..b026934 --- /dev/null +++ b/lib/src/connection.dart @@ -0,0 +1 @@ +class Connection {} diff --git a/lib/src/query_client.dart b/lib/src/query_client.dart index 93e28a7..4482bc6 100644 --- a/lib/src/query_client.dart +++ b/lib/src/query_client.dart @@ -2,6 +2,7 @@ import 'dart:js_interop'; import 'dart:js_util'; import 'package:deno_postgres_interop/src/client_common.dart'; +import 'package:deno_postgres_interop/src/connection.dart'; import 'package:deno_postgres_interop/src/query_array_result.dart'; import 'package:deno_postgres_interop/src/query_object_options.dart'; import 'package:deno_postgres_interop/src/query_object_result.dart'; @@ -15,6 +16,9 @@ import 'package:deno_postgres_interop/src/util.dart'; class QueryClient { /// [deno-postgres@v0.17.0/QueryClient/session](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#accessor_session). external Session get session; + + /// [deno-postgres@v0.17.0/QueryClient/constructor](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#ctor_0). + external factory QueryClient(Connection connection); } /// [deno-postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). @@ -26,8 +30,7 @@ extension QueryClientProps on QueryClient { Future closeConnection() => callFutureMethod(this, 'closeConnection'); /// [deno-postgres@v0.17.0/QueryClient/resetSessionMetadata](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_resetSessionMetadata_0). - Future resetSessionMetadata() => - callFutureMethod(this, 'resetSessionMetadata'); + void resetSessionMetadata() => callMethod(this, 'resetSessionMetadata', []); /// [deno-postgres@v0.17.0/QueryClient/connect](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_connect_0). Future connect() => callFutureMethod(this, 'connect');