question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EntityMetadata ignores Schemas for OracleDriver

See original GitHub issue

Issue type:

[ ] question [X] bug report [ ] 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:

I’m using the OracleDriver and after upgrading to the 0.2.19, the generated queries ignore the schemas defined on my Entity Definition.

Example Entity

import {
  Column,
  Entity,
  PrimaryColumn,
} from "typeorm";

@Entity({
  name: "PERSON",
  schema: "DW_ADMIN"
})
export class Person {
    @PrimaryColumn({ name: "ID" })
    public id: number;

    @Column({ name: "NAME" })
    public name: string;
}

The resulting query:

SELECT "p"."ID" AS "p_ID", "p"."NAME" AS "p_NAME" FROM "PERSON"

The result is an oracle error because there is no schema attached to the table in the query ORA-00942: table or view does not exist

Prior to upgrading the query was:

SELECT "p"."ID" AS "p_ID", "p"."NAME" AS "p_NAME" FROM "DW_ADMIN"."PERSON"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
marrasencommented, Feb 11, 2020

@jf214 Just discovered that if you change your entities from saying schema to database you can avoid this bug

@Entity("table_name", {database: "schemaname"})
1reaction
marrasencommented, Oct 26, 2019

The same problem. Any workaround?

We reverted to version 0.2.18 until this is resolved

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Unable to connect to database as the schema user ...
The Upgrade Assistant (UA) Fails To Connect to the Portal Schema in ... The auto-datasource mode is ignoring data source XXX_PORTAL because ...
Read more >
Spring JDBC Could not load JDBC driver class [oracle.jdbc ...
Make sure that you have ojdbc.jar gets added into your class path. If you want, you can also double check it by opening...
Read more >
Using Oracle Database as a source for AWS SCT
You can use AWS SCT to convert schemas, database code objects, and application code from Oracle Database to the following targets:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found