Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement FromStr for ColumnTrait #99

Merged
merged 5 commits into from
Aug 22, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ColumnTrait extends FromStr
  • Loading branch information
tyt2y3 committed Aug 22, 2021
commit 5966100244e8b327734773e4e8f3332d47ac283a
3 changes: 2 additions & 1 deletion src/entity/column.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::str::FromStr;
use crate::{EntityName, IdenStatic, Iterable};
use sea_query::{DynIden, Expr, SeaRc, SelectStatement, SimpleExpr, Value};

Expand Down Expand Up @@ -77,7 +78,7 @@ macro_rules! bind_subquery_func {

// LINT: when the operand value does not match column type
/// Wrapper of the identically named method in [`sea_query::Expr`]
pub trait ColumnTrait: IdenStatic + Iterable {
pub trait ColumnTrait: IdenStatic + Iterable + FromStr {
type EntityName: EntityName;

fn def(&self) -> ColumnDef;
Expand Down