Merge pull request #79 from rmachado/master

MySQL bit support
This commit is contained in:
Kononnable 2019-04-01 12:32:48 +02:00 committed by GitHub
commit a5fb41b7f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -73,6 +73,14 @@ export class MysqlDriver extends AbstractDriver {
case "int":
colInfo.tsType = "number";
break;
case "bit":
if (resp.COLUMN_TYPE === "bit(1)") {
colInfo.options.width = 1;
colInfo.tsType = "boolean";
} else {
colInfo.tsType = "number";
}
break;
case "tinyint":
if (resp.COLUMN_TYPE === "tinyint(1)") {
colInfo.options.width = 1;

View File

@ -9,6 +9,9 @@ export class Post {
@Column()
name: string;
@Column("bit")
bit: boolean;
@Column("int")
int: number;

View File

@ -9,6 +9,9 @@ export class Post {
@Column()
name: string;
@Column("bit")
bit: boolean;
@Column("int")
int: number;
@ -113,5 +116,4 @@ export class Post {
@Column("geometrycollection")
geometrycollection: string;
}