11use super :: * ;
2+ use crate :: write_int;
23
34impl TableBuilder for MysqlQueryBuilder {
45 fn prepare_table_opt ( & self , create : & TableCreateStatement , sql : & mut impl SqlWriter ) {
@@ -27,15 +28,15 @@ impl TableBuilder for MysqlQueryBuilder {
2728 ColumnType :: Char ( length) => match length {
2829 Some ( length) => {
2930 sql. write_str ( "char(" ) . unwrap ( ) ;
30- write ! ( sql, "{ length}" ) . unwrap ( ) ;
31+ write_int ( sql, * length) ;
3132 sql. write_str ( ")" )
3233 }
3334 None => sql. write_str ( "char" ) ,
3435 } ,
3536 ColumnType :: String ( length) => match length {
3637 StringLen :: N ( length) => {
3738 sql. write_str ( "varchar(" ) . unwrap ( ) ;
38- write ! ( sql, "{ length}" ) . unwrap ( ) ;
39+ write_int ( sql, * length) ;
3940 sql. write_char ( ')' )
4041 }
4142 StringLen :: None => sql. write_str ( "varchar(255)" ) ,
@@ -51,9 +52,9 @@ impl TableBuilder for MysqlQueryBuilder {
5152 ColumnType :: Decimal ( precision) => match precision {
5253 Some ( ( precision, scale) ) => {
5354 sql. write_str ( "decimal(" ) . unwrap ( ) ;
54- write ! ( sql, "{ precision}" ) . unwrap ( ) ;
55+ write_int ( sql, * precision) ;
5556 sql. write_str ( ", " ) . unwrap ( ) ;
56- write ! ( sql, "{ scale}" ) . unwrap ( ) ;
57+ write_int ( sql, * scale) ;
5758 sql. write_char ( ')' )
5859 }
5960 None => sql. write_str ( "decimal" ) ,
@@ -67,13 +68,13 @@ impl TableBuilder for MysqlQueryBuilder {
6768 ColumnType :: Interval ( _, _) => sql. write_str ( "unsupported" ) ,
6869 ColumnType :: Binary ( length) => {
6970 sql. write_str ( "binary(" ) . unwrap ( ) ;
70- write ! ( sql, "{ length}" ) . unwrap ( ) ;
71+ write_int ( sql, * length) ;
7172 sql. write_char ( ')' )
7273 }
7374 ColumnType :: VarBinary ( length) => match length {
7475 StringLen :: N ( length) => {
7576 sql. write_str ( "varbinary(" ) . unwrap ( ) ;
76- write ! ( sql, "{ length}" ) . unwrap ( ) ;
77+ write_int ( sql, * length) ;
7778 sql. write_char ( ')' )
7879 }
7980 StringLen :: None => sql. write_str ( "varbinary(255)" ) ,
@@ -83,23 +84,23 @@ impl TableBuilder for MysqlQueryBuilder {
8384 ColumnType :: Bit ( length) => match length {
8485 Some ( length) => {
8586 sql. write_str ( "bit(" ) . unwrap ( ) ;
86- write ! ( sql, "{ length}" ) . unwrap ( ) ;
87+ write_int ( sql, * length) ;
8788 sql. write_char ( ')' )
8889 }
8990 None => sql. write_str ( "bit" ) ,
9091 } ,
9192 ColumnType :: VarBit ( length) => {
9293 sql. write_str ( "bit(" ) . unwrap ( ) ;
93- write ! ( sql, "{ length}" ) . unwrap ( ) ;
94+ write_int ( sql, * length) ;
9495 sql. write_char ( ')' )
9596 }
9697 ColumnType :: Boolean => sql. write_str ( "bool" ) ,
9798 ColumnType :: Money ( precision) => match precision {
9899 Some ( ( precision, scale) ) => {
99100 sql. write_str ( "decimal(" ) . unwrap ( ) ;
100- write ! ( sql, "{ precision}" ) . unwrap ( ) ;
101+ write_int ( sql, * precision) ;
101102 sql. write_str ( ", " ) . unwrap ( ) ;
102- write ! ( sql, "{ scale}" ) . unwrap ( ) ;
103+ write_int ( sql, * scale) ;
103104 sql. write_char ( ')' )
104105 }
105106 None => sql. write_str ( "decimal" ) ,
0 commit comments