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
I'm getting an error in a browser app bundled using web pack with sql.js@1.1.0
:
TypeError: Cannot read property 'Database' of undefined
at SqljsDriver.eval (webpack:///./node_modules/typeorm/browser/driver/sqljs/SqljsDriver.js?:278:62)
at step (webpack:///./node_modules/tslib/tslib.es6.js?:120:23)
at Object.eval [as next] (webpack:///./node_modules/tslib/tslib.es6.js?:101:53)
at eval (webpack:///./node_modules/tslib/tslib.es6.js?:94:71)
at new Promise (<anonymous>)
at Module.__awaiter (webpack:///./node_modules/tslib/tslib.es6.js?:90:12)
at SqljsDriver.createDatabaseConnectionWithImport (webpack:///./node_modules/typeorm/browser/driver/sqljs/SqljsDriver.js?:272:63)
at SqljsDriver.eval (webpack:///./node_modules/typeorm/browser/driver/sqljs/SqljsDriver.js?:137:56)
at step (webpack:///./node_modules/tslib/tslib.es6.js?:120:23)
at Object.eval [as next] (webpack:///./node_modules/tslib/tslib.es6.js?:101:53)
it looks like it's inside SqljsDriver.prototype.createDatabaseConnectionWithImport = function (database)
at line isLegacyVersion = typeof this.sqlite.Database === "function";
, downgrading to sql.js@0.5.0
solves that