@@ -63,18 +63,22 @@ const decorateType = (type, columnDefinition) => {
6363 const { length, precision, scale, typeModifier, srid, timezone, timePrecision, dimension, subtype, array_type } =
6464 columnDefinition ;
6565
66+ const safeType = wrapInQuotes ( type ) ;
67+
6668 if ( canHaveLength ( type ) && _ . isNumber ( length ) ) {
67- type = addLength ( type , length ) ;
69+ type = addLength ( safeType , length ) ;
6870 } else if ( canHavePrecision ( type ) && canHaveScale ( type ) && _ . isNumber ( precision ) ) {
69- type = addScalePrecision ( type , precision , scale ) ;
71+ type = addScalePrecision ( safeType , precision , scale ) ;
7072 } else if ( canHavePrecision ( type ) && _ . isNumber ( precision ) ) {
71- type = addPrecision ( type , precision ) ;
73+ type = addPrecision ( safeType , precision ) ;
7274 } else if ( canHaveTypeModifier ( type ) ) {
73- type = addTypeModifier ( { type, typeModifier, srid } ) ;
75+ type = addTypeModifier ( { type : safeType , typeModifier, srid } ) ;
7476 } else if ( canHaveTimePrecision ( type ) && ( _ . isNumber ( timePrecision ) || timezone ) ) {
75- type = addWithTimezone ( addPrecision ( type , timePrecision ) , timezone ) ;
77+ type = addWithTimezone ( addPrecision ( safeType , timePrecision ) , timezone ) ;
7678 } else if ( isVector ( type ) ) {
7779 type = dimension ? decorateVector ( subtype , dimension ) : subtype ;
80+ } else {
81+ type = safeType ;
7882 }
7983
8084 return addArrayDecorator ( type , array_type ) ;
0 commit comments