Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema name to the table path for Oracle driver #5621

Closed
mrcatlait opened this issue Mar 5, 2020 · 5 comments
Closed

Add schema name to the table path for Oracle driver #5621

mrcatlait opened this issue Mar 5, 2020 · 5 comments

Comments

@mrcatlait
Copy link

Issue type:

[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[x] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

Entity metadata doesn't have schema name in tablePath for Oracle driver:

/**
* Builds table path using database name, schema name and table name.
*/
protected buildTablePath(): string {
let tablePath = this.tableName;
if (this.schema && ((this.connection.driver instanceof PostgresDriver) || (this.connection.driver instanceof SqlServerDriver) || (this.connection.driver instanceof SapDriver))) {
tablePath = this.schema + "." + tablePath;
}
if (this.database && !(this.connection.driver instanceof PostgresDriver)) {
if (!this.schema && this.connection.driver instanceof SqlServerDriver) {
tablePath = this.database + ".." + tablePath;
} else {
tablePath = this.database + "." + tablePath;
}
}
return tablePath;
}

As a result it is possible to query tables only with public synonym.
Could OracleDriver be added to the list of drivers which support schema name in tablePath?

@pirouet
Copy link
Contributor

pirouet commented Apr 4, 2020

Hi,

I have pushed a fix through under #5805 for this

@lipeavelar
Copy link

I'm facing this issue, any updates about this?

@pirouet
Copy link
Contributor

pirouet commented Jun 29, 2020

@lipeavelar Not sure how long it takes but I have a Pull Request (#6133) to add it back in waiting

@lipeavelar
Copy link

I think this issue should be closed, since #6673 should solve it

@pirouet
Copy link
Contributor

pirouet commented Sep 16, 2020

Yep, agreed but I can't close it myself :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants