From d3f8d9056d0a29d30af66328b21eeb0600541673 Mon Sep 17 00:00:00 2001 From: danylo-safonov-solid Date: Mon, 18 Sep 2023 19:51:19 +0300 Subject: [PATCH 1/3] working --- example/lib/main.dart | 7 ++++++- lib/deno_postgres_interop.dart | 2 ++ lib/src/command_type.dart | 27 +++++++++++++++++++++++++++ lib/src/query.dart | 4 ++++ lib/src/query_object_result.dart | 8 +++++++- lib/src/query_result.dart | 16 ++++++++++++++++ 6 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 lib/src/command_type.dart create mode 100644 lib/src/query.dart create mode 100644 lib/src/query_result.dart diff --git a/example/lib/main.dart b/example/lib/main.dart index b3a01fb..5f04316 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -16,7 +16,12 @@ Future fetch(Request _) async { ); await client.end(); - return Response(result.rows.map(rowToPrettyString).join('\n\n')); + return Response( + [ + result.command == CommandType.select, + ...result.rows.map(rowToPrettyString), + ].join('\n\n'), + ); } Future> transaction(Transaction transaction) async { diff --git a/lib/deno_postgres_interop.dart b/lib/deno_postgres_interop.dart index 720e5c9..1ba90c6 100644 --- a/lib/deno_postgres_interop.dart +++ b/lib/deno_postgres_interop.dart @@ -2,9 +2,11 @@ library; export 'src/client.dart'; +export 'src/command_type.dart'; export 'src/isolation_level.dart'; export 'src/query_client.dart'; export 'src/query_object.dart' show QueryArguments; export 'src/query_object_result.dart'; +export 'src/query_result.dart'; export 'src/transaction.dart'; export 'src/transaction_options.dart'; diff --git a/lib/src/command_type.dart b/lib/src/command_type.dart new file mode 100644 index 0000000..13a781f --- /dev/null +++ b/lib/src/command_type.dart @@ -0,0 +1,27 @@ +/// All sql commands. +enum CommandType { + /// insert. + insert, + + /// delete. + delete, + + /// update. + update, + + /// select. + select, + + /// move. + move, + + /// fetch. + fetch, + + /// copy. + copy; + + /// Parses a string containing an [CommandType] literal into its instance. + static CommandType parse(String string) => + values.firstWhere((e) => e.name.toUpperCase() == string); +} diff --git a/lib/src/query.dart b/lib/src/query.dart new file mode 100644 index 0000000..c1c05ff --- /dev/null +++ b/lib/src/query.dart @@ -0,0 +1,4 @@ +import 'dart:js_interop'; + +@JS() +class Query {} diff --git a/lib/src/query_object_result.dart b/lib/src/query_object_result.dart index 23ed729..2fe92ee 100644 --- a/lib/src/query_object_result.dart +++ b/lib/src/query_object_result.dart @@ -1,11 +1,17 @@ import 'dart:js_interop'; import 'dart:js_util'; +import 'package:deno_postgres_interop/src/query.dart'; +import 'package:deno_postgres_interop/src/query_result.dart'; + /// [postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). @JS() -class QueryObjectResult { +class QueryObjectResult extends QueryResult { /// [postgres@v0.17.0/QueryObjectResult/columns](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_columns). external List? get columns; + + /// [postgres@v0.17.0/QueryResult/constructor](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult#ctor_0). + external factory QueryObjectResult(Query query); } /// [postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). diff --git a/lib/src/query_result.dart b/lib/src/query_result.dart new file mode 100644 index 0000000..2d11580 --- /dev/null +++ b/lib/src/query_result.dart @@ -0,0 +1,16 @@ +import 'dart:js_interop'; +import 'dart:js_util'; + +import 'package:deno_postgres_interop/src/command_type.dart'; + +/// [postgres@v0.17.0/QueryResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult). +@JS() +class QueryResult {} + +/// [postgres@v0.17.0/QueryResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult). +extension QueryResultProps on QueryResult { + /// [postgres@v0.17.0/QueryResult/command](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult#prop_command). + CommandType get command => CommandType.parse( + getProperty(this, 'command'), + ); +} From c92dd81962ad856981e84e11cfcf9d35b96e8fe6 Mon Sep 17 00:00:00 2001 From: danylo-safonov-solid Date: Mon, 18 Sep 2023 19:54:32 +0300 Subject: [PATCH 2/3] more consistent comments --- lib/src/isolation_level.dart | 8 ++++---- lib/src/query.dart | 1 + lib/src/query_client.dart | 12 ++++++------ lib/src/query_object.dart | 6 +++--- lib/src/query_object_result.dart | 10 +++++----- lib/src/query_result.dart | 6 +++--- lib/src/transaction.dart | 10 +++++----- lib/src/transaction_options.dart | 12 ++++++------ 8 files changed, 33 insertions(+), 32 deletions(-) diff --git a/lib/src/isolation_level.dart b/lib/src/isolation_level.dart index afb85bf..26295e6 100644 --- a/lib/src/isolation_level.dart +++ b/lib/src/isolation_level.dart @@ -1,12 +1,12 @@ -/// [postgresql/Transaction Isolation](https://www.postgresql.org/docs/current/transaction-iso.html). +/// [deno-postgres@0.17.0/Transaction Isolation](https://www.postgresql.org/docs/current/transaction-iso.html). enum IsolationLevel { - /// [postgresql/Transaction Isolation/Read Committed Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-READ-COMMITTED). + /// [deno-postgres@0.17.0/Transaction Isolation/Read Committed Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-READ-COMMITTED). readCommitted, - /// [postgresql/Transaction Isolation/Repeatable Read Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-REPEATABLE-READ). + /// [deno-postgres@0.17.0/Transaction Isolation/Repeatable Read Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-REPEATABLE-READ). repeatableRead, - /// [postgresql/Transaction Isolation/Serializable Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-SERIALIZABLE). + /// [deno-postgres@0.17.0/Transaction Isolation/Serializable Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-SERIALIZABLE). serializable; /// Parses a string containing an [IsolationLevel] literal into its instance. diff --git a/lib/src/query.dart b/lib/src/query.dart index c1c05ff..cd45632 100644 --- a/lib/src/query.dart +++ b/lib/src/query.dart @@ -1,4 +1,5 @@ import 'dart:js_interop'; +/// [deno-postgres@0.17.0/Query](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=Query). @JS() class Query {} diff --git a/lib/src/query_client.dart b/lib/src/query_client.dart index 4c785ed..180d6ba 100644 --- a/lib/src/query_client.dart +++ b/lib/src/query_client.dart @@ -7,19 +7,19 @@ import 'package:deno_postgres_interop/src/transaction.dart'; import 'package:deno_postgres_interop/src/transaction_options.dart'; import 'package:deno_postgres_interop/src/util.dart'; -/// [postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). +/// [deno-postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). @JS() class QueryClient {} -/// [postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). +/// [deno-postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). extension QueryClientProps on QueryClient { - /// [postgres@v0.17.0/QueryClient/connect](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_connect_0). + /// [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'); - /// [postgres@v0.17.0/QueryClient/end](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_end_0). + /// [deno-postgres@v0.17.0/QueryClient/end](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_end_0). Future end() => callFutureMethod(this, 'end'); - /// [postgres@v0.17.0/QueryClient/createTransaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_createTransaction_0). + /// [deno-postgres@v0.17.0/QueryClient/createTransaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_createTransaction_0). Transaction createTransaction(String name, [TransactionOptions? options]) => callMethod( this, @@ -46,7 +46,7 @@ extension QueryClientProps on QueryClient { return result; } - /// [postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). + /// [deno-postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). Future> queryObject( String query, [ QueryArguments? arguments, diff --git a/lib/src/query_object.dart b/lib/src/query_object.dart index ed0074d..b45bea8 100644 --- a/lib/src/query_object.dart +++ b/lib/src/query_object.dart @@ -1,13 +1,13 @@ import 'package:deno_postgres_interop/deno_postgres_interop.dart'; import 'package:deno_postgres_interop/src/util.dart'; -/// [postgres@v0.17.0/QueryArguments](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryArguments). +/// [deno-postgres@v0.17.0/QueryArguments](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryArguments). typedef QueryArguments = Object; /// Common method between all Clients. /// -/// [postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). -/// [postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). +/// [deno-postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). +/// [deno-postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). Future> queryObjectCommon( Object queryable, String query, [ diff --git a/lib/src/query_object_result.dart b/lib/src/query_object_result.dart index 2fe92ee..796335a 100644 --- a/lib/src/query_object_result.dart +++ b/lib/src/query_object_result.dart @@ -4,19 +4,19 @@ import 'dart:js_util'; import 'package:deno_postgres_interop/src/query.dart'; import 'package:deno_postgres_interop/src/query_result.dart'; -/// [postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). +/// [deno-postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). @JS() class QueryObjectResult extends QueryResult { - /// [postgres@v0.17.0/QueryObjectResult/columns](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_columns). + /// [deno-postgres@v0.17.0/QueryObjectResult/columns](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_columns). external List? get columns; - /// [postgres@v0.17.0/QueryResult/constructor](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult#ctor_0). + /// [deno-postgres@v0.17.0/QueryResult/constructor](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult#ctor_0). external factory QueryObjectResult(Query query); } -/// [postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). +/// [deno-postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). extension QueryObjectResultProps on QueryObjectResult { - /// [postgres@v0.17.0/QueryObjectResult/rows](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_rows). + /// [deno-postgres@v0.17.0/QueryObjectResult/rows](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_rows). List> get rows => // ignore: cast_nullable_to_non_nullable (dartify(getProperty(this, 'rows')) as List) diff --git a/lib/src/query_result.dart b/lib/src/query_result.dart index 2d11580..c3db0e5 100644 --- a/lib/src/query_result.dart +++ b/lib/src/query_result.dart @@ -3,13 +3,13 @@ import 'dart:js_util'; import 'package:deno_postgres_interop/src/command_type.dart'; -/// [postgres@v0.17.0/QueryResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult). +/// [deno-postgres@v0.17.0/QueryResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult). @JS() class QueryResult {} -/// [postgres@v0.17.0/QueryResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult). +/// [deno-postgres@v0.17.0/QueryResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult). extension QueryResultProps on QueryResult { - /// [postgres@v0.17.0/QueryResult/command](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult#prop_command). + /// [deno-postgres@v0.17.0/QueryResult/command](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryResult#prop_command). CommandType get command => CommandType.parse( getProperty(this, 'command'), ); diff --git a/lib/src/transaction.dart b/lib/src/transaction.dart index 583595d..88b4cd0 100644 --- a/lib/src/transaction.dart +++ b/lib/src/transaction.dart @@ -4,19 +4,19 @@ import 'package:deno_postgres_interop/src/query_object.dart'; import 'package:deno_postgres_interop/src/query_object_result.dart'; import 'package:deno_postgres_interop/src/util.dart'; -/// [postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). +/// [deno-postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). @JS() class Transaction {} -/// [postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). +/// [deno-postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). extension TransactionProps on Transaction { - /// [postgres@v0.17.0/Transaction/begin](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_begin_0). + /// [deno-postgres@v0.17.0/Transaction/begin](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_begin_0). Future begin() => callFutureMethod(this, 'begin'); - /// [postgres@v0.17.0/Transaction/commit](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_commit_0). + /// [deno-postgres@v0.17.0/Transaction/commit](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_commit_0). Future commit() => callFutureMethod(this, 'commit'); - /// [postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). + /// [deno-postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). Future> queryObject( String query, [ QueryArguments? arguments, diff --git a/lib/src/transaction_options.dart b/lib/src/transaction_options.dart index bb1c924..65108c6 100644 --- a/lib/src/transaction_options.dart +++ b/lib/src/transaction_options.dart @@ -3,13 +3,13 @@ import 'dart:js_util'; import 'package:deno_postgres_interop/src/isolation_level.dart'; -/// [postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). +/// [deno-postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). @JS() class TransactionOptions { - /// [postgres@v0.17.0/TransactionOptions/snapshot](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/snapshot](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). external String? get snapshot; - /// [postgres@v0.17.0/TransactionOptions/constructor](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/constructor](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). factory TransactionOptions({ IsolationLevel? isolationLevel, bool? isReadOnly, @@ -22,15 +22,15 @@ class TransactionOptions { }) as TransactionOptions; } -/// [postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). +/// [deno-postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). extension TransactionOptionsProps on TransactionOptions { - /// [postgres@v0.17.0/TransactionOptions/isolation_level](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/isolation_level](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). IsolationLevel? get isolationLevel { final jsProperty = getProperty(this, 'isolation_level'); return jsProperty == null ? null : IsolationLevel.parse(jsProperty); } - /// [postgres@v0.17.0/TransactionOptions/read_only](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/read_only](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). bool? get isReadOnly => getProperty(this, 'read_only'); } From 37850cf7d47615424cc564372d055748e80a8c86 Mon Sep 17 00:00:00 2001 From: danylo-safonov-solid <116712879+danylo-safonov-solid@users.noreply.github.com> Date: Mon, 18 Sep 2023 20:07:12 +0300 Subject: [PATCH 3/3] comment consistency (#13) --- lib/src/isolation_level.dart | 8 ++++---- lib/src/query_client.dart | 12 ++++++------ lib/src/query_object.dart | 6 +++--- lib/src/query_object_result.dart | 8 ++++---- lib/src/transaction.dart | 10 +++++----- lib/src/transaction_options.dart | 12 ++++++------ 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/src/isolation_level.dart b/lib/src/isolation_level.dart index afb85bf..46ee541 100644 --- a/lib/src/isolation_level.dart +++ b/lib/src/isolation_level.dart @@ -1,12 +1,12 @@ -/// [postgresql/Transaction Isolation](https://www.postgresql.org/docs/current/transaction-iso.html). +/// [deno-postgres@v0.17.0/Transaction Isolation](https://www.postgresql.org/docs/current/transaction-iso.html). enum IsolationLevel { - /// [postgresql/Transaction Isolation/Read Committed Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-READ-COMMITTED). + /// [deno-postgres@v0.17.0/Transaction Isolation/Read Committed Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-READ-COMMITTED). readCommitted, - /// [postgresql/Transaction Isolation/Repeatable Read Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-REPEATABLE-READ). + /// [deno-postgres@v0.17.0/Transaction Isolation/Repeatable Read Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-REPEATABLE-READ). repeatableRead, - /// [postgresql/Transaction Isolation/Serializable Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-SERIALIZABLE). + /// [deno-postgres@v0.17.0/Transaction Isolation/Serializable Isolation Level](https://www.postgresql.org/docs/current/transaction-iso.html#XACT-SERIALIZABLE). serializable; /// Parses a string containing an [IsolationLevel] literal into its instance. diff --git a/lib/src/query_client.dart b/lib/src/query_client.dart index 4c785ed..180d6ba 100644 --- a/lib/src/query_client.dart +++ b/lib/src/query_client.dart @@ -7,19 +7,19 @@ import 'package:deno_postgres_interop/src/transaction.dart'; import 'package:deno_postgres_interop/src/transaction_options.dart'; import 'package:deno_postgres_interop/src/util.dart'; -/// [postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). +/// [deno-postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). @JS() class QueryClient {} -/// [postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). +/// [deno-postgres@v0.17.0/QueryClient](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient). extension QueryClientProps on QueryClient { - /// [postgres@v0.17.0/QueryClient/connect](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_connect_0). + /// [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'); - /// [postgres@v0.17.0/QueryClient/end](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_end_0). + /// [deno-postgres@v0.17.0/QueryClient/end](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_end_0). Future end() => callFutureMethod(this, 'end'); - /// [postgres@v0.17.0/QueryClient/createTransaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_createTransaction_0). + /// [deno-postgres@v0.17.0/QueryClient/createTransaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_createTransaction_0). Transaction createTransaction(String name, [TransactionOptions? options]) => callMethod( this, @@ -46,7 +46,7 @@ extension QueryClientProps on QueryClient { return result; } - /// [postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). + /// [deno-postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). Future> queryObject( String query, [ QueryArguments? arguments, diff --git a/lib/src/query_object.dart b/lib/src/query_object.dart index ed0074d..b45bea8 100644 --- a/lib/src/query_object.dart +++ b/lib/src/query_object.dart @@ -1,13 +1,13 @@ import 'package:deno_postgres_interop/deno_postgres_interop.dart'; import 'package:deno_postgres_interop/src/util.dart'; -/// [postgres@v0.17.0/QueryArguments](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryArguments). +/// [deno-postgres@v0.17.0/QueryArguments](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryArguments). typedef QueryArguments = Object; /// Common method between all Clients. /// -/// [postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). -/// [postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). +/// [deno-postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). +/// [deno-postgres@v0.17.0/QueryClient/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=QueryClient#method_queryObject_0). Future> queryObjectCommon( Object queryable, String query, [ diff --git a/lib/src/query_object_result.dart b/lib/src/query_object_result.dart index 23ed729..5e8a900 100644 --- a/lib/src/query_object_result.dart +++ b/lib/src/query_object_result.dart @@ -1,16 +1,16 @@ import 'dart:js_interop'; import 'dart:js_util'; -/// [postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). +/// [deno-postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). @JS() class QueryObjectResult { - /// [postgres@v0.17.0/QueryObjectResult/columns](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_columns). + /// [deno-postgres@v0.17.0/QueryObjectResult/columns](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_columns). external List? get columns; } -/// [postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). +/// [deno-postgres@v0.17.0/QueryObjectResult](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult). extension QueryObjectResultProps on QueryObjectResult { - /// [postgres@v0.17.0/QueryObjectResult/rows](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_rows). + /// [deno-postgres@v0.17.0/QueryObjectResult/rows](https://deno.land/x/postgres@v0.17.0/query/query.ts?s=QueryObjectResult#prop_rows). List> get rows => // ignore: cast_nullable_to_non_nullable (dartify(getProperty(this, 'rows')) as List) diff --git a/lib/src/transaction.dart b/lib/src/transaction.dart index 583595d..88b4cd0 100644 --- a/lib/src/transaction.dart +++ b/lib/src/transaction.dart @@ -4,19 +4,19 @@ import 'package:deno_postgres_interop/src/query_object.dart'; import 'package:deno_postgres_interop/src/query_object_result.dart'; import 'package:deno_postgres_interop/src/util.dart'; -/// [postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). +/// [deno-postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). @JS() class Transaction {} -/// [postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). +/// [deno-postgres@v0.17.0/Transaction](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction). extension TransactionProps on Transaction { - /// [postgres@v0.17.0/Transaction/begin](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_begin_0). + /// [deno-postgres@v0.17.0/Transaction/begin](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_begin_0). Future begin() => callFutureMethod(this, 'begin'); - /// [postgres@v0.17.0/Transaction/commit](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_commit_0). + /// [deno-postgres@v0.17.0/Transaction/commit](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_commit_0). Future commit() => callFutureMethod(this, 'commit'); - /// [postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). + /// [deno-postgres@v0.17.0/Transaction/queryObject](https://deno.land/x/postgres@v0.17.0/mod.ts?s=Transaction#method_queryObject_0). Future> queryObject( String query, [ QueryArguments? arguments, diff --git a/lib/src/transaction_options.dart b/lib/src/transaction_options.dart index bb1c924..65108c6 100644 --- a/lib/src/transaction_options.dart +++ b/lib/src/transaction_options.dart @@ -3,13 +3,13 @@ import 'dart:js_util'; import 'package:deno_postgres_interop/src/isolation_level.dart'; -/// [postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). +/// [deno-postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). @JS() class TransactionOptions { - /// [postgres@v0.17.0/TransactionOptions/snapshot](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/snapshot](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). external String? get snapshot; - /// [postgres@v0.17.0/TransactionOptions/constructor](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/constructor](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). factory TransactionOptions({ IsolationLevel? isolationLevel, bool? isReadOnly, @@ -22,15 +22,15 @@ class TransactionOptions { }) as TransactionOptions; } -/// [postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). +/// [deno-postgres@v0.17.0/TransactionOptions](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). extension TransactionOptionsProps on TransactionOptions { - /// [postgres@v0.17.0/TransactionOptions/isolation_level](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/isolation_level](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). IsolationLevel? get isolationLevel { final jsProperty = getProperty(this, 'isolation_level'); return jsProperty == null ? null : IsolationLevel.parse(jsProperty); } - /// [postgres@v0.17.0/TransactionOptions/read_only](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). + /// [deno-postgres@v0.17.0/TransactionOptions/read_only](https://deno.land/x/postgres@v0.17.0/mod.ts?s=TransactionOptions). bool? get isReadOnly => getProperty(this, 'read_only'); }