Skip to content

Commit

Permalink
fix: sqlite connections don't ignore the schema property (#4599)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-acumen authored and pleerock committed Sep 13, 2019
1 parent 0094f61 commit d8f1c81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/metadata/EntityMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,10 @@ export class EntityMetadata {
*/
protected buildTablePath(): string {
let tablePath = this.tableName;
if (this.schema)
if (this.schema && ((this.connection.driver instanceof PostgresDriver) || (this.connection.driver instanceof SqlServerDriver))) {
tablePath = this.schema + "." + tablePath;
}

if (this.database && !(this.connection.driver instanceof PostgresDriver)) {
if (!this.schema && this.connection.driver instanceof SqlServerDriver) {
tablePath = this.database + ".." + tablePath;
Expand Down

1 comment on commit d8f1c81

@marrasen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems to remove the schema prefix from MySQL connections. The query builder for our MySQL connection no longer prefixes the tables with schemas

Please sign in to comment.