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

Enumeration #258

Merged
merged 45 commits into from
Nov 8, 2021
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8627c8d
Draft ActiveEnum
billy1624 Oct 19, 2021
18f3715
Fixup
billy1624 Oct 20, 2021
30e17a2
Better error messages
billy1624 Oct 20, 2021
e177a33
Minimal trait bounds
billy1624 Oct 20, 2021
5b07200
More tests
billy1624 Oct 20, 2021
b1e10ae
Refactoring
billy1624 Oct 20, 2021
bf16635
Fix clippy warnings
billy1624 Oct 20, 2021
ceba3ef
Add docs
billy1624 Oct 20, 2021
eed8b7c
Add docs
billy1624 Oct 20, 2021
388bf2c
Fixup
billy1624 Oct 20, 2021
f1ef7d9
Add `DbErr::Type`
billy1624 Oct 20, 2021
868a469
Test integer enum
billy1624 Oct 20, 2021
d525c71
Merge remote-tracking branch 'origin/master' into active-enum
billy1624 Oct 20, 2021
7346084
WIP
billy1624 Oct 20, 2021
80c7200
Try Postgres enum
billy1624 Oct 21, 2021
20c66b2
Refactoring
billy1624 Oct 21, 2021
1ee2dab
Fixup
billy1624 Oct 21, 2021
8858d64
create_table_from_entity with DB backend
billy1624 Oct 25, 2021
f20c649
Tests all DB
billy1624 Oct 25, 2021
6059cdd
Remove unused EnumIter
billy1624 Oct 25, 2021
4b1cac7
Refactoring
billy1624 Oct 25, 2021
cf52839
Typo
billy1624 Oct 25, 2021
2ee376d
Try `EnumValue`
billy1624 Oct 26, 2021
db22e70
Refactoring
billy1624 Oct 26, 2021
ded28be
Refactoring
billy1624 Oct 26, 2021
fac528a
Refactoring
billy1624 Oct 27, 2021
a1f57ec
Merge pull request #274 from SeaQL/active-enum-3
billy1624 Oct 27, 2021
e04495b
Refactoring
billy1624 Oct 27, 2021
55de196
Add `create_enum_from_entity`
billy1624 Oct 27, 2021
f88c725
Fixup
billy1624 Oct 27, 2021
70e76eb
Merge pull request #261 from SeaQL/active-enum-1
billy1624 Oct 27, 2021
fe64d53
Merge remote-tracking branch 'origin/master' into active-enum
billy1624 Oct 27, 2021
e21af53
Fix clippy warnings
billy1624 Oct 27, 2021
6018d3f
Merge remote-tracking branch 'origin/master' into active-enum
billy1624 Nov 2, 2021
a95ee31
Use sea-query master
billy1624 Nov 2, 2021
6554230
Add docs
billy1624 Nov 2, 2021
858e1e0
Update docs
billy1624 Nov 2, 2021
0bbb50b
Merge remote-tracking branch 'origin/master' into active-enum
billy1624 Nov 3, 2021
2f7c9cc
Refactoring
billy1624 Nov 3, 2021
bb78a1d
More ergonomic `DeriveActiveEnum` derive macro
billy1624 Nov 3, 2021
2b841b1
Refactoring
billy1624 Nov 4, 2021
f64f1e9
`DeriveActiveEnum` generate code that depends on sea-query inside sea…
billy1624 Nov 4, 2021
67bb168
Correctly apply filters on enum columns
billy1624 Nov 4, 2021
10f3de0
Only `eq` & `ne` operators with enum casting
billy1624 Nov 5, 2021
47e2486
Refactoring
billy1624 Nov 5, 2021
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
Next Next commit
Minimal trait bounds
  • Loading branch information
billy1624 committed Oct 20, 2021
commit e177a338c4e2c9d2670044c5a84319a534c8c8df
3 changes: 1 addition & 2 deletions src/entity/active_enum.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use crate::{ColumnDef, DbErr, TryGetable};
use sea_query::{Nullable, Value, ValueType};
use std::fmt::Debug;

pub trait ActiveEnum: Sized {
type Value: Sized + Send + Debug + PartialEq + Into<Value> + ValueType + Nullable + TryGetable;
type Value: Into<Value> + ValueType + Nullable + TryGetable;

fn to_value(&self) -> Self::Value;

Expand Down