Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
danylo-safonov-solid committed Sep 20, 2023
1 parent be46787 commit 63bb9de
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions lib/src/pool.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'dart:js_util';

import 'package:deno_postgres_interop/src/client_options.dart';
import 'package:deno_postgres_interop/src/pool_client.dart';
import 'package:deno_postgres_interop/src/undefined.dart';
import 'package:deno_postgres_interop/src/util.dart';

/// [[email protected]/Pool](https://deno.land/x/[email protected]/mod.ts?s=Pool).
class Pool {
Expand Down Expand Up @@ -39,13 +41,23 @@ class Pool {
size,
if (lazy != null) lazy,
]);
}

/// [[email protected]/Pool](https://deno.land/x/[email protected]/mod.ts?s=Pool).
extension PoolProps on Pool {
/// [[email protected]/Pool/size](https://deno.land/x/[email protected]/mod.ts?s=Pool#prop_size).
int get connectionsCount => getProperty(this, 'size');

// available: number
// size: number
/// [[email protected]/Pool/available](https://deno.land/x/[email protected]/mod.ts?s=Pool#prop_available).
int get openConnectionsCount => getProperty(this, 'available');

// connect(): Promise<PoolClient>
/// [[email protected]/Pool/connect](https://deno.land/x/[email protected]/mod.ts?s=Pool#method_connect_0).
Future<PoolClient> connect() => callFutureMethod(this, 'connect');

// end(): Promise<void>
/// [[email protected]/Pool/end](https://deno.land/x/[email protected]/mod.ts?s=Pool#method_end_0).
Future<void> end() => callFutureMethod(this, 'end');

// initialized(): Promise<number>
/// [[email protected]/Pool/initialized](https://deno.land/x/[email protected]/mod.ts?s=Pool#method_initialized_0).
Future<int> initializedConnectionsCount() =>
callFutureMethod(this, 'initialized');
}

0 comments on commit 63bb9de

Please sign in to comment.