-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be46787
commit 63bb9de
Showing
1 changed file
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
@@ -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'); | ||
} |