@@ -815,7 +815,7 @@ impl fmt::Display for ColumnDef {
815
815
///
816
816
/// Syntax
817
817
/// ```markdown
818
- /// <name> [OPTIONS(option, ...)]
818
+ /// <name> [data_type][ OPTIONS(option, ...)]
819
819
///
820
820
/// option: <name> = <value>
821
821
/// ```
@@ -824,18 +824,23 @@ impl fmt::Display for ColumnDef {
824
824
/// ```sql
825
825
/// name
826
826
/// age OPTIONS(description = "age column", tag = "prod")
827
+ /// created_at DateTime64
827
828
/// ```
828
829
#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
829
830
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
830
831
#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
831
832
pub struct ViewColumnDef {
832
833
pub name : Ident ,
834
+ pub data_type : Option < DataType > ,
833
835
pub options : Option < Vec < SqlOption > > ,
834
836
}
835
837
836
838
impl fmt:: Display for ViewColumnDef {
837
839
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
838
840
write ! ( f, "{}" , self . name) ?;
841
+ if let Some ( data_type) = self . data_type . as_ref ( ) {
842
+ write ! ( f, " {}" , data_type) ?;
843
+ }
839
844
if let Some ( options) = self . options . as_ref ( ) {
840
845
write ! (
841
846
f,
0 commit comments