Skip to content

Commit

Permalink
Merge pull request #94 from MaterializeInc/context-schema-database
Browse files Browse the repository at this point in the history
fix: changing database gets stuck
  • Loading branch information
joacoc authored Sep 14, 2023
2 parents a3d27ec + 3f5b07a commit 436c8bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/context/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class Config {
}
}

setSchema(name: string) {
setSchema(name: string | undefined) {
if (this.profile) {
this.profile.schema = name;
}
Expand Down
5 changes: 5 additions & 0 deletions src/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ export class Context extends EventEmitter {

setDatabase(name: string) {
this.config.setDatabase(name);

// Every database has different schemas.
// Setting an undefined schema before loading the env.
// Triggers a new search for a valid schema.
this.config.setSchema(undefined);
this.loadEnvironment();
}

Expand Down

0 comments on commit 436c8bd

Please sign in to comment.