Skip to content

Commit

Permalink
Merge pull request #1 from TVGSoft/hotfix/fix-query-alias-name
Browse files Browse the repository at this point in the history
Update query alias name for typeorm
  • Loading branch information
TVGSoft authored Oct 28, 2019
2 parents 2b406fc + 0d391d4 commit fa7558b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/TypeormStore/TypeormStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class TypeormStore extends Store {
this.debug('GET "%s"', sid);

this.createQueryBuilder()
.andWhere("id = :id", { id: sid })
.andWhere("session.id = :id", { id: sid })
.getOne()
.then((session) => {
if (!session) { return fn(); }
Expand Down Expand Up @@ -99,9 +99,9 @@ export class TypeormStore extends Store {
(this.cleanupLimit
? (() => {
const $ = this.repository
.createQueryBuilder("_")
.select("_.id")
.where(`_.expiredAt <= ${Date.now()}`)
.createQueryBuilder("session")
.select("session.id")
.where(`session.expiredAt <= ${Date.now()}`)
.limit(this.cleanupLimit);
return this.limitSubquery
? Promise.resolve($.getQuery())
Expand All @@ -110,9 +110,9 @@ export class TypeormStore extends Store {
);
})().then((ids) =>
this.repository
.createQueryBuilder("session")
.createQueryBuilder()
.delete()
.where(`session.id IN (${ids})`)
.where(`id IN (${ids})`)
.execute(),
)
: Promise.resolve()
Expand Down

0 comments on commit fa7558b

Please sign in to comment.