Skip to content

Commit

Permalink
Build from edgedb-js 1e5ad72b7e58de9317a02a201d23552ae086f136
Browse files Browse the repository at this point in the history
  • Loading branch information
edgedb-ci committed Sep 7, 2022
1 parent fe63461 commit 21fd0d6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions _src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* limitations under the License.
*/

import type {Duration} from "./datatypes/datetime.ts";
import {CodecsRegistry} from "./codecs/registry.ts";
import {
ConnectConfig,
Expand Down Expand Up @@ -485,6 +486,16 @@ export interface ClientOptions {
concurrency?: number;
}

type SimpleConfig = Partial<{
session_idle_transaction_timeout: Duration;
query_execution_timeout: Duration;
allow_bare_ddl: "AlwaysAllow" | "NeverAllow";
allow_dml_in_functions: boolean;
allow_user_specified_id: boolean;
apply_access_policies: boolean;
[k: string]: unknown;
}>;

export class Client implements Executor {
private pool: ClientPool;
private options: Options;
Expand Down Expand Up @@ -520,11 +531,9 @@ export class Client implements Executor {
);
}

withConfig(config: {[name: string]: any}): Client {
return new Client(
this.pool,
this.options.withSession(this.options.session.withConfig(config))
);
withConfig(config: SimpleConfig): Client {
const newConfig = this.options.session.withConfig(config);
return new Client(this.pool, this.options.withSession(newConfig));
}

withGlobals(globals: {[name: string]: any}): Client {
Expand Down
2 changes: 1 addition & 1 deletion _src/reflection/syntax.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.22.4
0.22.5

0 comments on commit 21fd0d6

Please sign in to comment.