sqlx-oldapi 0.6.59

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, MSSQL, and ODBC.
Documentation
use sqlx_oldapi::Sqlite;
use sqlx_test::test_type;

#[derive(Debug, PartialEq, sqlx_oldapi::Type)]
#[repr(u32)]
enum Origin {
    Foo = 1,
    Bar = 2,
}

test_type!(origin_enum<Origin>(Sqlite,
    "1" == Origin::Foo,
    "2" == Origin::Bar,
));

#[derive(Debug, PartialEq, sqlx_oldapi::Type)]
#[sqlx(rename_all = "lowercase")]
enum Color {
    Red,
    Green,
}

test_type!(string_enum<Color>(Sqlite,
    "'red'" == Color::Red,
    "'green'" == Color::Green,
));