@@ -815,7 +815,7 @@ impl fmt::Display for ColumnDef {
815815///
816816/// Syntax
817817/// ```markdown
818- /// <name> [OPTIONS(option, ...)]
818+ /// <name> [data_type][ OPTIONS(option, ...)]
819819///
820820/// option: <name> = <value>
821821/// ```
@@ -824,18 +824,23 @@ impl fmt::Display for ColumnDef {
824824/// ```sql
825825/// name
826826/// age OPTIONS(description = "age column", tag = "prod")
827+ /// created_at DateTime64
827828/// ```
828829#[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
829830#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
830831#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
831832pub struct ViewColumnDef {
832833 pub name : Ident ,
834+ pub data_type : Option < DataType > ,
833835 pub options : Option < Vec < SqlOption > > ,
834836}
835837
836838impl fmt:: Display for ViewColumnDef {
837839 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
838840 write ! ( f, "{}" , self . name) ?;
841+ if let Some ( data_type) = self . data_type . as_ref ( ) {
842+ write ! ( f, " {}" , data_type) ?;
843+ }
839844 if let Some ( options) = self . options . as_ref ( ) {
840845 write ! (
841846 f,
0 commit comments