We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acc54c9 commit 7d2604fCopy full SHA for 7d2604f
tests/postgres/types.rs
@@ -24,6 +24,38 @@ fn create_2() {
24
);
25
}
26
27
+#[test]
28
+fn create_3() {
29
+ assert_eq!(
30
+ Type::create()
31
+ .as_enum(Tea::Enum)
32
+ .values([Tea::EverydayTea, Tea::BreakfastTea])
33
+ .to_string(PostgresQueryBuilder),
34
+ r#"CREATE TYPE "tea" AS ENUM ('EverydayTea', 'BreakfastTea')"#
35
+ );
36
+
37
+ enum Tea {
38
+ Enum,
39
+ EverydayTea,
40
+ BreakfastTea,
41
+ }
42
43
+ impl sea_query::Iden for Tea {
44
+ fn unquoted(&self, s: &mut dyn std::fmt::Write) {
45
+ write!(
46
+ s,
47
+ "{}",
48
+ match self {
49
+ Self::Enum => "tea",
50
+ Self::EverydayTea => "EverydayTea",
51
+ Self::BreakfastTea => "BreakfastTea",
52
53
+ )
54
+ .unwrap();
55
56
57
+}
58
59
#[test]
60
fn drop_1() {
61
assert_eq!(
0 commit comments