From c83c6746122f068ad0c1058289bf9a8f62eb08f4 Mon Sep 17 00:00:00 2001 From: Panagiotis Karatakis Date: Tue, 10 Jan 2023 10:36:02 +0200 Subject: [PATCH] Add is_null getter for ColumnDef struct (#1381) * Add is_null getter for ColumnDef struct * Update src/entity/column.rs * Update src/entity/column.rs Co-authored-by: Chris Tsang --- src/entity/column.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/entity/column.rs b/src/entity/column.rs index b949248e..a59d32fd 100644 --- a/src/entity/column.rs +++ b/src/entity/column.rs @@ -401,6 +401,11 @@ impl ColumnDef { pub fn get_column_type(&self) -> &ColumnType { &self.col_type } + + /// Returns true if the column is nullable + pub fn is_null(&self) -> bool { + self.null + } } impl From for sea_query::ColumnType {