File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,23 @@ function getParmAttributes(parm: SQLParm): string {
79
79
return lines . join ( `\n ` ) ;
80
80
}
81
81
82
+ function prepareColumnType ( column : TableColumn ) : string {
83
+ if ( column . CHARACTER_MAXIMUM_LENGTH ) {
84
+ return `${ column . DATA_TYPE } (${ column . CHARACTER_MAXIMUM_LENGTH } )` ;
85
+ }
86
+
87
+ if ( column . NUMERIC_PRECISION !== null && column . NUMERIC_SCALE !== null ) {
88
+ return `${ column . DATA_TYPE } (${ column . NUMERIC_PRECISION } , ${ column . NUMERIC_SCALE } )` ;
89
+ }
90
+
91
+ return `${ column . DATA_TYPE } `
92
+ }
93
+
94
+
82
95
function getColumnAttributes ( column : TableColumn ) : string {
83
96
const lines : string [ ] = [
84
97
`Column: ${ column . COLUMN_NAME } ` ,
85
- `Type: ${ column . DATA_TYPE } ` ,
98
+ `Type: ${ prepareColumnType ( column ) } ` ,
86
99
`HAS_DEFAULT: ${ column . HAS_DEFAULT } ` ,
87
100
`IS_IDENTITY: ${ column . IS_IDENTITY } ` ,
88
101
`IS_NULLABLE: ${ column . IS_NULLABLE } ` ,
You can’t perform that action at this time.
0 commit comments