flop
820
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Elixir
语言
—
创建时间
最近更新
项目能做什么
专为 Ecto 设计的数据过滤、排序与分页库。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Flop
[](https://github.com/woylie/flop/actions/workflows/ci.yml) [](https://hex.pm/packages/flop) [](https://codecov.io/gh/woylie/flop)
Flop is an Elixir library that applies filtering, ordering, and pagination to
Ecto queries.
## Features
- **Offset pagination:** with `offset`/`limit` or `page`/`page_size`
parameters.
- **Cursor pagination:** keyset pagination with `first`/`after` and
`last`/`before`, the same arguments Relay uses.
- **Sorting:** by several fields, each in its own direction, with nulls first or
last.
- **Filtering:** by a list of filters, each with a field, an operator and a
value.
- **Parameter validation:** invalid parameters become errors you can show to
the user.
- **Allow-lists:** only fields configured as filterable or sortable can be used.
- **Join fields:** filter and sort by fields of joined tables, and only add the
joins needed for a request.
- **Compound fields:** filter several string fields as one, for example a full
name.
- **Custom fields:** your own filter or order expression for anything the other
field types do not cover.
- **Relay connections:** edges, nodes and page info in Relay format.
- **[Flop Phoenix](https://hex.pm/packages/flop_phoenix):** pagination links,
sortable tables and filter forms.
## Installation
To get started, add `flop` to your dependencies list in your project's `mix.exs`
file:
```elixir
def deps do
[
{:flop, "~> 0.29.1"}
]
end
```
Enable diagnostics in `config/dev.exs` and `config/test.exs`:
```elixir
config :flop, diagnostics: true
```
You can also configure a default repo for Flop by adding the following line to
`config/config.exs`:
```elixir
config :flop, repo: MyApp.Repo
```
If you want to avoid global configuration, you can use a configuration module
instead or pass the repo directly to the functions.
### Compatibility
This package is tested against the Elixir and OTP versions that are still
supported upstream. Older versions down to the requirement in `mix.exs` may
still work, but they are not covered by CI and not officially supported.
### Supported databases
| Database | Status |
| -------- | -------------------------- |
| Postgres | Supported and tested in CI |
| MySQL | Supported and tested in CI |
| SQLite | Supported and tested in CI |
Flop builds queries with `Ecto.Query` and only uses a couple of fragments to
bridge the gap between databases. The library might work with other Ecto
adapters, but it is only tested with the databases listed above.
Some behavior depends on the used adapter.
#### MySQL
Configure the repo with the charset and the collation your columns use, or
cursor pagination over a string column raises `Illegal mix of collations`:
```elixir
config :my_app, MyApp.Repo,
charset: "utf8mb4",
collat
阅读完整原文
项目深度分析 AI 生成
Phoenix LiveView 商业级后台管理模板 / UI 套件
| 产品构想 | 基于 Flop 和 Flop Phoenix,打造开箱即用的商业级 Phoenix LiveView 管理后台模板(包含高级筛选器、可排序数据表、游标分页、导出 CSV/Excel 等完整业务组件)。 |
| 核心功能 | 预设 Tailwind CSS 样式的 Flop Phoenix 表格组件、多条件组合筛选器、保存筛选视图、数据导出、权限集成示例。 |
| 目标用户 | 需要快速交付内部系统、SaaS 后台的 Elixir/Phoenix 独立开发者及中小型技术团队。 |
| 难度/周期 | 中 · 4-6周 · 成本:低(主要是个人开发时间与域名/静态托管成本) |
| 收费模式 | 一次性买断授权(如个人版/团队版)或年费订阅获取更新。 |
| 竞争风险 | Elixir 生态相对小众,市场天花板有限,需精准触达目标开发者社区。 |
| 依据 | AI推测 |
Ecto 复杂查询与性能优化技术咨询/定制服务
| 产品构想 | 针对使用 Flop/Ecto 的企业项目,提供数据库查询性能优化(如 MySQL/Postgres 索引调优、游标分页改造、复杂 Join 查询优化)及定制开发服务。 |
| 核心功能 | 慢查询诊断、Flop Schema 架构设计、Relay 游标分页迁移、自定义查询扩展。 |
| 目标用户 | 数据量增长导致列表页/API 性能下降的 Elixir 商业公司。 |
| 难度/周期 | 低(技术门槛高但无需开发新产品) · 1-2周即可启动接单 · 成本:极低 |
| 收费模式 | 按小时计费或按项目打包收费。 |
| 竞争风险 | 依赖个人时间交付,难以规模化。 |
| 依据 | 尚需验证的假设 |
面向 Elixir 的低代码/可视化报表与查询构建器插件
| 产品构想 | 开发一个可嵌入 Phoenix 应用的商业插件,允许非技术运营人员通过可视化界面配置基于 Flop 的过滤、排序条件并生成可分享的报表视图。 |
| 核心功能 | 可视化条件构建器(对接 Flop.Filter)、视图持久化、权限控制、一键导出。 |
| 目标用户 | 使用 Elixir 构建 SaaS 或内部运营平台,且有频繁临时取数、自定义列表需求的团队。 |
| 难度/周期 | 中高 · 6-10周 · 成本:低至中(开发时间及演示环境服务器成本) |
| 收费模式 | 商业源码授权(按项目/席位)或 SaaS 化托管。 |
| 竞争风险 | 需要深入适配不同宿主应用的 Ecto Schema,集成复杂度较高。 |
| 依据 | AI推测 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建时间待补全,最近推送 ,发布过 59 个 Release |
| 社区活跃 | Star 820 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。