@@ -7,20 +7,24 @@ use crate::types::tuple::Tuple;
7
7
use crate :: types:: value:: { DataValue , Utf8Type , ValueRef } ;
8
8
use futures_async_stream:: try_stream;
9
9
use lazy_static:: lazy_static;
10
+ use sqlparser:: ast:: CharLengthUnits ;
10
11
use std:: sync:: Arc ;
11
12
12
13
lazy_static ! {
13
14
static ref PRIMARY_KEY_TYPE : ValueRef = Arc :: new( DataValue :: Utf8 {
14
15
value: Some ( String :: from( "PRIMARY" ) ) ,
15
- ty: Utf8Type :: Variable
16
+ ty: Utf8Type :: Variable ( None ) ,
17
+ unit: CharLengthUnits :: Characters
16
18
} ) ;
17
19
static ref UNIQUE_KEY_TYPE : ValueRef = Arc :: new( DataValue :: Utf8 {
18
20
value: Some ( String :: from( "UNIQUE" ) ) ,
19
- ty: Utf8Type :: Variable
21
+ ty: Utf8Type :: Variable ( None ) ,
22
+ unit: CharLengthUnits :: Characters
20
23
} ) ;
21
24
static ref EMPTY_KEY_TYPE : ValueRef = Arc :: new( DataValue :: Utf8 {
22
25
value: Some ( String :: from( "EMPTY" ) ) ,
23
- ty: Utf8Type :: Variable
26
+ ty: Utf8Type :: Variable ( None ) ,
27
+ unit: CharLengthUnits :: Characters
24
28
} ) ;
25
29
}
26
30
@@ -69,24 +73,29 @@ impl Describe {
69
73
let values = vec ! [
70
74
Arc :: new( DataValue :: Utf8 {
71
75
value: Some ( column. name( ) . to_string( ) ) ,
72
- ty: Utf8Type :: Variable ,
76
+ ty: Utf8Type :: Variable ( None ) ,
77
+ unit: CharLengthUnits :: Characters ,
73
78
} ) ,
74
79
Arc :: new( DataValue :: Utf8 {
75
80
value: Some ( datatype. to_string( ) ) ,
76
- ty: Utf8Type :: Variable ,
81
+ ty: Utf8Type :: Variable ( None ) ,
82
+ unit: CharLengthUnits :: Characters ,
77
83
} ) ,
78
84
Arc :: new( DataValue :: Utf8 {
79
85
value: datatype. raw_len( ) . map( |len| len. to_string( ) ) ,
80
- ty: Utf8Type :: Variable ,
86
+ ty: Utf8Type :: Variable ( None ) ,
87
+ unit: CharLengthUnits :: Characters ,
81
88
} ) ,
82
89
Arc :: new( DataValue :: Utf8 {
83
90
value: Some ( column. nullable. to_string( ) ) ,
84
- ty: Utf8Type :: Variable ,
91
+ ty: Utf8Type :: Variable ( None ) ,
92
+ unit: CharLengthUnits :: Characters ,
85
93
} ) ,
86
94
key_fn( column) ,
87
95
Arc :: new( DataValue :: Utf8 {
88
96
value: Some ( default ) ,
89
- ty: Utf8Type :: Variable ,
97
+ ty: Utf8Type :: Variable ( None ) ,
98
+ unit: CharLengthUnits :: Characters ,
90
99
} ) ,
91
100
] ;
92
101
yield Tuple { id : None , values } ;
0 commit comments