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>)
Hi! I'm facing an issue with typeorm that I'm having trouble solving:
I have a entity
@Entity('my_entity_table')
class MyEntity implements MyEntityInterface {
@PrimaryColumn({ type: 'int' })
public id: number;
@Column({ type: 'varchar' })
@MaxLength(1000)
public message: string;
}
now when I do a queryBuilder and a getMany()
, I would like to have this new field in the result which is aggregated from other database tables
e.g.
// query builder for myEntity
myQueryBuilder
.addSelect(`EXISTS (
SELECT true
FROM other_table`, 'myAggregateField'
)
.getMany()
how can I include the myAggregateField in the result?
public myAggregateField?: boolean;
to the MyEntity-class, but it didnt help