Skip to content

Commit

Permalink
chore: release version v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaertschi committed Aug 7, 2024
1 parent 593c063 commit 35e2022
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline

<!-- changelog -->

## [v1.0.0](https://github.com/zebbra/ash_pagify/compare/v0.1.2...v1.0.0) (2024-08-07)
### Breaking Changes:

* Ash v3: follow ash v3 upgrade guide



## [v0.1.2](https://github.com/zebbra/ash_pagify/compare/v0.1.1...v0.1.2) (2024-08-05)


Expand Down
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Then simply add `ash_pagify` to your list of dependencies in `mix.exs` and run
```elixir
def deps do
[
{:ash_pagify, "~> 0.1.2"}
{:ash_pagify, "~> 1.0.0"}
]
end
```
Expand Down Expand Up @@ -138,35 +138,30 @@ See `t:AshPagify.option/0` for a description of all available options.

## Resource configuration

You need to add the `pagination macro` call to the action of the resource that you
All settings described in the global configuration can be overridden in the resource
module. For this, you need to define the `@ash_pagify_options` module attribute and
set the options you want to override.

Also, you need to add the `pagination macro` call to the action of the resource that you
want to be paginated. The macro call is used to set the default limit, offset and
other options for the pagination.

Furthermore, you can define scopes in the resource module. Scopes are predefined
filters that can be applied to the query.

We allow full-text search using the `tsvector` column in PostgreSQL. To enable full-text search,
you need to either `use AshPagify.Tsearch` in your module or implement the `full_text_search`,
`full_text_search_rank`, `tsquery`, and `tsvector` calculations as described in `AshPagify.Tsearch`
(tsvector calculation is always mandatory).

```elixir
defmodule YourApp.Resource.Post
# only required if you want to implement full-text search
use AshPagify.Tsearch
require Ash.Query

@default_limit 15
def default_limit, do: @default_limit

@ash_pagify_scopes %{
role: [
%{name: :all, filter: nil},
%{name: :admin, filter: %{author: "John"}},
%{name: :user, filter: %{author: "Doe"}}
require Ash.Expr

@ash_pagify_options {
default_limit: 15,
scopes: [
role: [
%{name: :all, filter: nil},
%{name: :admin, filter: %{author: "John"}},
%{name: :user, filter: %{author: "Doe"}}
]
]
}
def ash_pagify_scopes, do: @ash_pagify_scopes

actions do
read :read do
Expand Down
5 changes: 4 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule AshPagify.MixProject do
Adds full-text search, scoping, filtering, ordering, and pagination APIs for the Ash Framework.
"""

@version "0.1.2"
@version "1.0.0"

def project do
[
Expand Down Expand Up @@ -83,6 +83,9 @@ defmodule AshPagify.MixProject do
Filters: [
AshPagify.FilterForm
],
Types: [
AshPagify.Type.SearchQuery
],
Errors: [
AshPagify.Error,
~r/AshPagify.Error\./
Expand Down

0 comments on commit 35e2022

Please sign in to comment.