Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement "FOR UPDATE OF" for postgres driver (#7040)
- Loading branch information
Showing
18 changed files
with
517 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
import {ManyToMany} from "../../../../../src/decorator/relations/ManyToMany"; | ||
import {JoinTable} from "../../../../../src/decorator/relations/JoinTable"; | ||
import {Post} from "./Post"; | ||
import {Image} from "./Image"; | ||
|
||
@Entity() | ||
export class Category { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
@Column() | ||
isRemoved: boolean = false; | ||
|
||
@ManyToMany(type => Post, post => post.categories) | ||
posts: Post[]; | ||
|
||
@ManyToMany(type => Image) | ||
@JoinTable() | ||
images: Image[]; | ||
|
||
titleImage: Image; | ||
|
||
removedImages: Image[]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
|
||
@Entity() | ||
export class Image { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
@Column() | ||
isRemoved: boolean = false; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
import {ManyToOne} from "../../../../../src/decorator/relations/ManyToOne"; | ||
import {ManyToMany} from "../../../../../src/decorator/relations/ManyToMany"; | ||
import {JoinTable} from "../../../../../src/decorator/relations/JoinTable"; | ||
import {OneToOne} from "../../../../../src/decorator/relations/OneToOne"; | ||
import {JoinColumn} from "../../../../../src/decorator/relations/JoinColumn"; | ||
import {User} from "./User"; | ||
import {Category} from "./Category"; | ||
import {Tag} from "./Tag"; | ||
import {Image} from "./Image"; | ||
|
||
@Entity() | ||
export class Post { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
title: string; | ||
|
||
@ManyToOne(type => Tag) | ||
tag: Tag; | ||
|
||
@OneToOne(type => User) | ||
@JoinColumn() | ||
author: User; | ||
|
||
@ManyToMany(type => Category, category => category.posts) | ||
@JoinTable() | ||
categories: Category[]; | ||
|
||
subcategories: Category[]; | ||
|
||
removedCategories: Category[]; | ||
|
||
images: Image[]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
|
||
@Entity() | ||
export class Tag { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {Entity} from "../../../../../src/decorator/entity/Entity"; | ||
import {PrimaryGeneratedColumn} from "../../../../../src/decorator/columns/PrimaryGeneratedColumn"; | ||
import {Column} from "../../../../../src/decorator/columns/Column"; | ||
|
||
@Entity() | ||
export class User { | ||
|
||
@PrimaryGeneratedColumn() | ||
id: number; | ||
|
||
@Column() | ||
name: string; | ||
|
||
} |
Oops, something went wrong.