-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: mariadb uuid inet4 inet6 column data type support (#9845)
* feat: mariadb inet4, inet6, uuid data type support * refactor: cleanup unnecessary methods * style: mysqldriver formatting * fix: handle length column metadata mariadb uuid * fix: 8832 test suite to verify errors correctly * style: fix 8832 test formatting * fix: 8832 error testing cleanup * fix: remove defaulting column type feature * style: fix formatting * fix: remove unnecessary dbms error test * fix: remove unused import in test * fix: ensure defaulting uuid generation column type
- Loading branch information
Showing
14 changed files
with
376 additions
and
6 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
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,10 @@ | ||
import { Column, Entity, PrimaryGeneratedColumn } from "../../../../src" | ||
|
||
@Entity() | ||
export class BadInet4 { | ||
@PrimaryGeneratedColumn("uuid") | ||
id?: string | ||
|
||
@Column({ type: "inet4", length: "36" }) | ||
inet4: 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,10 @@ | ||
import { Column, Entity, PrimaryGeneratedColumn } from "../../../../src" | ||
|
||
@Entity() | ||
export class BadInet6 { | ||
@PrimaryGeneratedColumn("uuid") | ||
id?: string | ||
|
||
@Column({ type: "inet6", length: "36" }) | ||
inet6: 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,10 @@ | ||
import { Column, Entity, PrimaryGeneratedColumn } from "../../../../src" | ||
|
||
@Entity() | ||
export class BadUuid { | ||
@PrimaryGeneratedColumn("uuid") | ||
id?: string | ||
|
||
@Column({ type: "uuid", length: "36" }) | ||
uuid: 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,22 @@ | ||
import { | ||
Entity, | ||
PrimaryGeneratedColumn, | ||
Column, | ||
ManyToOne, | ||
} from "../../../../src" | ||
import { User } from "./User" | ||
|
||
@Entity() | ||
export class Address { | ||
@PrimaryGeneratedColumn("increment") | ||
id?: number | ||
|
||
@Column() | ||
city: string | ||
|
||
@Column() | ||
state: string | ||
|
||
@ManyToOne(() => User, (user) => user.addresses) | ||
user: User | ||
} |
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,30 @@ | ||
import { | ||
Column, | ||
Entity, | ||
OneToMany, | ||
PrimaryGeneratedColumn, | ||
} from "../../../../src" | ||
import { Address } from "./Address" | ||
|
||
@Entity() | ||
export class User { | ||
@PrimaryGeneratedColumn("uuid") | ||
id?: string | ||
|
||
/** can use a default but testing against mysql since they're shared drivers */ | ||
@Column({ type: "uuid" }) | ||
uuid: string | ||
|
||
@Column({ type: "inet4" }) | ||
inet4: string | ||
|
||
@Column({ type: "inet6" }) | ||
inet6: string | ||
|
||
/** testing generation */ | ||
@Column({ type: "uuid", generated: "uuid" }) | ||
another_uuid_field?: string | ||
|
||
@OneToMany(() => Address, (address) => address.user) | ||
addresses?: Address[] | ||
} |
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,7 @@ | ||
import { Entity, PrimaryGeneratedColumn } from "../../../../src" | ||
|
||
@Entity() | ||
export class UuidEntity { | ||
@PrimaryGeneratedColumn("uuid") | ||
id?: string | ||
} |
Oops, something went wrong.