@reggi I looked into the github code. Found something like:
hasRelation<T>(target: ObjectType<T>|string, relation: string|string[]): boolean {
const entityMetadata = this.connection.getMetadata(target);
const relations = relation instanceof Array ? relation : [relation];
return relations.every(relation => {
return !!entityMetadata.findRelationWithPropertyPath(relation);
});
}
may this help you? :o
getConnection().getMetadata(Entity);
.createQueryBuilder()
and it's not returning the correct data, but the raw SQL is. Any ideas what I'm missing?databaseColumn type for User#email is not defined and cannot be guessed
error when starting my server. I've seen typeorm/typeorm#2897, but I don't understand how the babel
plugin is supposed to fix the issue.
I've tried with
@ManyToOne(type => Invoice, invoice => invoice.lines, {
primary: true
})
invoice: Invoice;
@PrimaryColumn()
@Column()
orderLineNum: number;
but it overwrites the primary key with the many to one primary key and then after the migration only one column is primary
Hi, I'm using this old sql.js v0.5.0 and don't understand how to change the conection in order to upgrade to 1.0
I'm using the Ionic implementation.
let dbOptions: ConnectionOptions;
dbOptions = {
type: 'sqljs',
location: 'browser',
autoSave: true
};
Object.assign(dbOptions, {
synchronize: true,
autoSchemaSync: true,
migrationsRun: true,
entities: [ tables ]
});
return createConnection(dbOptions).then(connection => {
console.log("Data Access connected!");
return connection;
}).catch(error => {
//console.log("Data Access Error : ", );
return null;
});
Hey, I'm trying out migrations:generate
on an empty DB with postgres. For some reason the generated migration is doing the following:
This seems buggy to me.
hello guys
I am facing a tough day due to FindConditions/FindManyOptions in Repository.find method.
most of the worst, I've got this error :
[Nest] 26433 - 2019-09-06 12:37:02 [ExceptionsHandler] Maximum call stack size exceeded +3373ms
RangeError: Maximum call stack size exceeded
at String.split (<anonymous>)
at Function.QueryBuilderUtils.isAliasProperty (/home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/query-builder/QueryBuilderUtils.ts:17:15)
at JoinAttribute.getValue (/home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/query-builder/JoinAttribute.ts:143:40)
at JoinAttribute.get [as relation] (/home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/query-builder/JoinAttribute.ts:162:53)
at JoinAttribute.get [as metadata] (/home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/query-builder/JoinAttribute.ts:175:18)
at SelectQueryBuilder.join (/home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/query-builder/SelectQueryBuilder.ts:1299:27)
at SelectQueryBuilder.leftJoin (/home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/query-builder/SelectQueryBuilder.ts:284:14)
at SelectQueryBuilder.leftJoinAndSelect (/home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/query-builder/SelectQueryBuilder.ts:364:14)
at /home/fethijemli/Documents/dev/node/nest/CIO-FORUM-BACKEND/src/find-options/FindOptionsUtils.ts:246:16
at Array.forEach (<anonymous>)