erd-editor icon indicating copy to clipboard operation
erd-editor copied to clipboard

add: UNSIGNED numeric data types for MySQL

Open rapsealk opened this issue 3 years ago • 3 comments

Hi. I found that type suggestion does not provide any unsigned types, which gave me a little inconvenience.

I found the list of types that support unsigned option at https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html.

rapsealk avatar Dec 22 '21 03:12 rapsealk

Hi. I found that type suggestion does not provide any unsigned types, which gave me a little inconvenience.

I found the list of types that support unsigned option at https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html.

To add a type to autocomplete, a list is added from the following file.

  • https://github.com/vuerd/vuerd/blob/master/packages/vuerd/src/core/sql/dataType/MySQL.ts

dineug avatar Dec 22 '21 10:12 dineug

Sorry, it seems that unsigned keyword is an attribute, not a type. Would it be okay to add it to PrimitiveType like..

export type PrimitiveType =
  | 'int'
  | 'int unsigned'
...

or add another field to DataTypeHint like below?

export interface DataTypeHint {
  name: string;
  primitiveType: PrimitiveType;
  unsigned: boolean;
}

rapsealk avatar Dec 22 '21 11:12 rapsealk

Since this type is for cordegenerate mapping purposes, there is no need to divide it in detail. I don't need it right now, so I think I can use the int

dineug avatar Dec 23 '21 14:12 dineug