loopbackio / loopbackio/loopback-next

Filter by the concatenation of two columns

オープン
#6,840 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

feature Repository
主要言語
TypeScript
スター
5.1k
フォーク
1.1k
平均マージ
2日 21時間
マージ済み PR(30日)
27

説明

Suggestion

It would be nice to be able to filter a Model by the concatenation of two columns.
I mean, to be able to replicate this type of SQL query:

SELECT * FROM User WHERE CONCAT(name, ' ', lastName) LIKE '%PARTIAL FULLNAME%'

Use Cases

The most common example is filtering a User model by its full name when it's stored in two columns (name, lastName).
Currently, the only way this is possible (AFAIK) is by sending the RAW query, which makes it almost incompatible with adding more filters.

Examples

Table example:

id name lastName
1 Jackson Bell
2 Sarah Parker
3 Mason Brown

Example of one (possible) implementation of filter object:

{
  "limit": 10,
  "offset": 0,
  "where": {
    "leavingDate": null,
    "concat": {
      "eq": "%on B%",
      "separator": " ",
      "columns": [
        "name",
        "lastName"
      ]
    }
  }
}

Should return:

id name lastName
1 Jackson Bell
3 Mason Brown

Acceptance criteria

TBD - will be filled by the team.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、提案されている where.concat フィルターオブジェクトと、リポジトリのフィルターが現在 raw query をどのように扱っているかを確認します。サポートするカラム、区切り文字、比較演算子、データベースの動作を含む受け入れ条件をチームと明確にします。他のフィルターと併用して連結によるフィルタリングが機能し、検証結果が文書化されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
api, backend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。