Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 3.54 KB

MIGRATION-v03x-v04x.md

File metadata and controls

33 lines (28 loc) · 3.54 KB

Here are some migration information for version 0.3.x to 0.4.x.

Version 0.4.x focuses primarily on cleaning up naming conventions and decoupling sea-query to enable certain #[derive(Fields)] functionalities even without the with-sea-query feature.

Note: The latest version is currently on the rc stream (e.g., 0.4.0-rc.1), as sea-query 0.31.0 is still in rc. It will become the full 0.4.0 release once sea-query 0.31 is released.

Key changes include:

  • The HasFields trait is now used for the common #[derive(Fields)] and provides field_names() -> &'static [&'static str] and field_refs... to access rel and name information.
  • HasSeaFields is the trait that implements the sea-query related functions. It is still generated by #[derive(Fields)] when the with-sea-query feature is enabled.
  • Naming within HasSeaFields has been cleaned up.
  • The #[field(...)] naming convention has been cleaned up (replacing table with rel), similar to the struct #[modql(rel...)].
v0.3.x v0.4.x
Refactor HasFields without sea-query dependencies
field::HasFields::field_names() field::HasFields::field_names()
field::HasFields::field_refs() with new FieldRef struct
Rename Field/s to SeaField/s
field::Field field::SeaField
SeaField::new(iden, value) both have impl into.. so, no .into()
field::Fields field::SeaFields
#[derive(FieldValue)] #[derive(SeaFieldValue)]
Refactor HasFields to HasSeaFields
field::HasFields::not_none_fields field::HasSeaFields::not_none_sea_fields
field::HasFields::all_fields field::HasSeaFields::all_sea_fields
field::HasFields::field_idens field::HasSeaFields::sea_idens
field::HasFields::field_column_refs field::HasSeaFields::sea_column_refs
field::HasFields::field_column_refs_with_rel field::HasSeaFields::sea_column_refs_with_rel
Attributes
#[field(table="table_name",name="col_name")] #[field(rel="table_name",name="col_name")]
SQLite
ToSqliteValue