Skip to content

Commit

Permalink
Add is_null getter for ColumnDef struct (#1381)
Browse files Browse the repository at this point in the history
* Add is_null getter for ColumnDef struct

* Update src/entity/column.rs

* Update src/entity/column.rs

Co-authored-by: Chris Tsang <[email protected]>
  • Loading branch information
karatakis and tyt2y3 authored Jan 10, 2023
1 parent ed7be8a commit c83c674
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/entity/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ColumnType> for sea_query::ColumnType {
Expand Down

0 comments on commit c83c674

Please sign in to comment.