Skip to content

0.29.1

Compare
Choose a tag to compare
@tyt2y3 tyt2y3 released this 20 Jul 10:45
· 192 commits to master since this release

Versions

New Features

  • Added ValueTuple::Many for tuple with length up to 12 #564
  • Added CREATE TABLE CHECK constraints #567
  • Added support generated column spec #581
  • Added BIT_AND, BIT_OR functions #582
  • Added implementation SqlxBinder, RusqliteBinder and PostgresBinder for WithQuery #580
  • Added new type Asteriks #596
  • Added IF NOT EXISTS for DROP INDEX in Postgres and Sqlite #610
  • Added -> and ->> operators for Postgres #617
  • Added TableCreateStatement::set_extra and TableCreateStatement::get_extra #611
  • Added TableCreateStatement::comment and ColumnDef::comment for MySQL comments #622
  • Added PgExpr::get_json_field and PgExpr::cast_json_field methods for constructing Postgres JSON expressions #630
  • Added PgBinOper::Regex and PgBinOper::RegexCaseInsensitive for Postgres Regex operators
  • Added BinOper::Custom for defining custom binary operators
  • Added GLOB operator for Sqlite #651
  • Added CREATE or DROP EXTENSION statements for Postgres #616
  • Added a feature flag hashable-value, which will impl Hash for Value; when enabled, Value::Float(NaN) == Value::Float(NaN) would be true #598
  • Added PgBinOper::Overlap for Postgres operators #653

Enhancements

  • Implemented PartialEq for DynIden, SimpleExpr and related types #620

Breaking changes

  • Removed variants Four, Five, Six from enum ValueTuple as part of #564
  • Removed Expr::tbl, Expr::greater_than, Expr::greater_or_equal, Expr::less_than, Expr::less_or_equal, Expr::into_simple_expr #551
  • Removed SimpleExpr::equals and SimpleExpr::not_equals #551
  • Removed InsertStatement::exprs, InsertStatement::exprs_panic #551
  • Removed OnConflict::update_value, OnConflict::update_values, OnConflict::update_expr, OnConflict::update_exprs #551
  • Removed UpdateStatement::exprs, UpdateStatement::col_expr, UpdateStatement::value_expr #551
  • BigInteger now maps to bigint instead of integer on SQLite #556
  • Table::truncate now panic for Sqlite #590
  • Deprecated Expr::asteriks and Expr::table_asteriks #596
  • Expr::cust, Expr::cust_with_values, Expr::cust_with_expr, Expr::cust_with_exprs, TableForeignKey::name, ForeignKeyCreateStatement::name, ForeignKeyDropStatement::name, TableIndex::name, IndexCreateStatement::name, IndexDropStatement::name, SqlWriterValues::new, ColumnType::custom, TableCreateStatement::engine, TableCreateStatement::collate, TableCreateStatement::character_set, TableRef::new, LikeExpr::str now accept T: Into<String> #594
  • OnConflict::values and OnConflict::update_columns will append the new values keeping the old values intact instead of erasing them #609
  • As part of #620, SeaRc now becomes a wrapper type.
    If you used SeaRc for something other than dyn Iden, you now have to use RcOrArc.
    However be reminded that it is not an intended use of the API anyway.
// new definition
struct SeaRc<I>(RcOrArc<I>);
// remains unchanged
type DynIden = SeaRc<dyn Iden>;

// if you did:
let _: DynIden = Rc::new(Alias::new("char"));
// replace with:
let _: DynIden = SeaRc::new(Alias::new("char"));
  • Added new type Quote and changed the Iden trait:
struct Quote(pub(crate) u8, pub(crate) u8);

trait Iden {
    // then:
    fn prepare(&self, s: &mut dyn fmt::Write, q: char);
    // now:
    fn prepare(&self, s: &mut dyn fmt::Write, q: Quote);

    // then:
    fn quoted(&self, q: char) -> String;
    // now:
    fn quoted(&self, q: Quote) -> String;
}

House keeping

  • Elided unnecessary lifetimes #552
  • Changed all version = "^x.y.z" into version = "x.y.z" in all Cargo.toml #547
  • Disabled default features and enable only the needed ones #547
  • tests_cfg module is available only if you enabled tests-cfg feature #584
  • Removed hard coded quotes #613
  • Enabled required syn v1 features #624
  • Fix macro hygiene (any! / all!) #639 #640

Bug fixes

  • ALTER TABLE now panic if has multiple column for Sqlite #595
  • Fixed alter primary key column statements for Postgres #646

New Contributors

Full Changelog: 0.28.0...0.29.1