New Features
- Added support for temporary tables #878
let statement = Table::create()
.table(Font::Table)
.temporary()
.col(
ColumnDef::new(Font::Id)
.integer()
.not_null()
.primary_key()
.auto_increment()
)
.col(ColumnDef::new(Font::Name).string().not_null())
.take();
assert_eq!(
statement.to_string(MysqlQueryBuilder),
[
"CREATE TEMPORARY TABLE `font` (",
"`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT,",
"`name` varchar(255) NOT NULL",
")",
]
.join(" ")
);
use sea_query::Value;
let v = Value::Int(None);
let n = v.dummy_value();
assert_eq!(n, Value::Int(Some(0)));
Bug Fixes
- Quote type properly in
AsEnum casting #880
let query = Query::select()
.expr(Expr::col(Char::FontSize).as_enum(TextArray))
.from(Char::Table)
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT CAST("font_size" AS "text"[]) FROM "character""#
);