-
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
162e09f
commit 4973815
Showing
2 changed files
with
50 additions
and
1 deletion.
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 +1,48 @@ | ||
class Connection {} | ||
import 'dart:js_interop'; | ||
import 'dart:js_util'; | ||
|
||
import 'package:deno_postgres_interop/src/client_configuration.dart'; | ||
import 'package:deno_postgres_interop/src/promise.dart'; | ||
import 'package:deno_postgres_interop/src/transport.dart'; | ||
import 'package:deno_postgres_interop/src/util.dart'; | ||
|
||
/// [[email protected]/Connection](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection). | ||
@JS() | ||
class Connection { | ||
/// [[email protected]/Connection/connected](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#accessor_pid). | ||
external int get pid; | ||
|
||
/// [[email protected]/Connection/constructor](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#ctor_0). | ||
factory Connection({ | ||
required ClientConfiguration connectionParams, | ||
required Future<void> Function() disconnectionCallback, | ||
}) => | ||
callConstructor( | ||
'Connection', | ||
[connectionParams, () => futureToPromise(disconnectionCallback())], | ||
); | ||
} | ||
|
||
/// [[email protected]/Connection](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection). | ||
extension ConnectionProps on Connection { | ||
/// [[email protected]/Connection/connected](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#prop_connected). | ||
bool get isConnected => getProperty(this, 'connected'); | ||
|
||
/// [[email protected]/Connection/tls](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#accessor_tls). | ||
bool get isCarriedOverTLS => getProperty(this, 'tls'); | ||
|
||
/// [[email protected]/Connection/transport](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#accessor_transport). | ||
Transport get transport => Transport.parse(getProperty(this, 'transport')); | ||
|
||
/// [[email protected]/Connection/end](https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#method_end_0). | ||
Future<void> end() => callFutureMethod(this, 'end'); | ||
|
||
// https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#method_query_0 | ||
// query(query: Query<ResultType.ARRAY>): Promise<QueryArrayResult> | ||
|
||
// https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#method_query_1 | ||
// query(query: Query<ResultType.OBJECT>): Promise<QueryObjectResult> | ||
|
||
// https://deno.land/x/[email protected]/connection/connection.ts?s=Connection#method_startup_0 | ||
// startup(is_reconnection: boolean) | ||
} |
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,3 +1,4 @@ | ||
import 'dart:js_interop'; | ||
import 'dart:js_util'; | ||
|
||
import 'package:deno_postgres_interop/src/client_options.dart'; | ||
|
@@ -6,6 +7,7 @@ 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). | ||
@JS() | ||
class Pool { | ||
/// [[email protected]/Pool/constructor](https://deno.land/x/[email protected]/mod.ts?s=Pool#ctor_0). | ||
factory Pool({ | ||
|