-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] cockroachdb
[x] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)
The Entity schema property is not ignored by databases that don't need it
Steps to reproduce or a small repository showing the problem:
@Entity("test", { schema: "test" })
export class Test {
@PrimaryColumn()
public id: number;
@Column()
public test: string;
}For postgres all will work ok, both syncronize and find will work ok:
const connection = await typeorm.createConnection({
type: "postgres",
url: databaseConnectionUrl,
entities: [Test]
});
await connection.synchronize(true);
const res = await connection.getRepository(Test).save(new Test(42, "Meaning of life"));
const res2 = await connection.getRepository(Test).findOrFail({id: 42});The same code on sqlite will pass the creation, but will fail on working
const connection = await typeorm.createConnection({
type: "sqlite",
database: ":memory:",
entities: [Test]
});
await connection.synchronize(true);
// This will pass and all tables will be created
const res = await connection.getRepository(Test).save(new Test(42, "Meaning of life"));
// This will fail saying table test.test doesn't exist
const res2 = await connection.getRepository(Test).findOrFail({id: 42});Metadata
Metadata
Assignees
Labels
No labels