0.22.0
This release includes a substantial refactoring to lay the groundwork for the
upcoming adapter feature. While this release contains deprecations and changes,
they are either backward compatible or affect functions that are unlikely to be
used by end users. The primary aim has been to ensure a seamless transition and
maintain compatibility with previous versions.
Added
- Added a
Flop.FieldInfo
struct that contains metadata for a field for use
by adapters. - Added the
Flop.Schema.field_info/2
function, which derives field information
and replaces the previousFlop.Schema.field_type/2
function with a more
standardized and structured output.
Changed
- The Ecto-specific options
alias_fields
,compound_fields
,custom_fields
,
andjoin_fields
withinFlop.Schema
, as well asrepo
andquery_opts
withinuse Flop
, are now nested under theadapter_opts
keyword. The old
configuration format is still supported.
Deprecated
Flop.Schema.field_type/2
was deprecated in favor of
Flop.Schema.field_info/2
.
Removed
- Removed
Flop.Schema.apply_order_by/3
. - Removed
Flop.Schema.cursor_dynamic/3
.
Upgrade guide
While the old configuration format is still supported, you are invited to
update your application to the new structure to prepare for future versions.
To do this, place the field configuration for Flop.Schema
under
adapter_opts
:
@derive {
Flop.Schema,
filterable: [],
sortable: [],
- alias_fields: [],
- compound_fields: [],
- custom_fields: [],
- join_fields: []
+ adapter_opts: [
+ alias_fields: [],
+ compound_fields: [],
+ custom_fields: [],
+ join_fields: []
+ ]
}
Similarly for use Flop
, you can nest repo
and query_opts
under
adapter_opts
:
use Flop,
default_limit: 50,
- repo: MyApp.Repo,
- query_opts: [prefix: "some-prefix"]
+ adapter_opts: [
+ repo: MyApp.Repo,
+ query_opts: [prefix: "some-prefix"]
+ ]