Skip to content

postgres connector: implement "like" filter#1764

Merged
tomhoule merged 1 commit intomainfrom
gb-6869-postgres-connector-implement-string-contains-filter
Jun 11, 2024
Merged

postgres connector: implement "like" filter#1764
tomhoule merged 1 commit intomainfrom
gb-6869-postgres-connector-implement-string-contains-filter

Conversation

@tomhoule
Copy link
Copy Markdown
Contributor

It produces a LIKE clause (https://www.postgresql.org/docs/current/functions-matching.html).

The feature request was for a contains filter, but:

  1. The contains name is already used for the array membership filter
  2. "like" better matches database terminology
  3. LIKE is more powerful. It can also serve as startsWith, endsWith, ...

closes GB-6869

@linear
Copy link
Copy Markdown

linear bot commented Jun 11, 2024

@tomhoule tomhoule force-pushed the gb-6869-postgres-connector-implement-string-contains-filter branch 3 times, most recently from 2e836a5 to 6477133 Compare June 11, 2024 13:17
""" nin: [String]
not: StringSearchFilterInput
"""
The string matches the given pattern.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what's happening with the leading whitespace here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if the graphql-parser roundtrip is messing it up. Looks like graphql-parser didn't handle block strings properly prior to this PR: graphql-rust/graphql-parser#75 (which is unreleased as far as I can see)

create_array_update_type(input_ctx, TypeKind::Scalar(scalar), output_ctx);
}

registrer_string_filters(input_ctx, output_ctx);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/registrer/register

@tomhoule tomhoule marked this pull request as ready for review June 11, 2024 13:28
@tomhoule tomhoule requested a review from a team as a code owner June 11, 2024 13:28
@tomhoule tomhoule requested a review from obmarg June 11, 2024 13:28
It produces a `LIKE` clause (https://www.postgresql.org/docs/current/functions-matching.html).

The feature request was for a `contains` filter, but:

1. The `contains` name is already used for the array membership filter
2. "like" better matches database terminology
3. LIKE is more powerful. It can also serve as `startsWith`, `endsWith`, ...

closes GB-6869
@tomhoule tomhoule force-pushed the gb-6869-postgres-connector-implement-string-contains-filter branch from 6477133 to fe074d8 Compare June 11, 2024 15:23
@tomhoule tomhoule enabled auto-merge (squash) June 11, 2024 15:44
@tomhoule tomhoule merged commit 3ec9300 into main Jun 11, 2024
@tomhoule tomhoule deleted the gb-6869-postgres-connector-implement-string-contains-filter branch June 11, 2024 15:47
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the postgres connector (https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two tables. See the pull request (#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for federated graphs. #1766
@tomhoule tomhoule mentioned this pull request Jun 13, 2024
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the postgres connector (https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two tables. See the pull request (#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for federated graphs. #1766
- Expand the scope of files watched for changes in `grafbase dev`. #1774
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the postgres connector (https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two tables. See the pull request (#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for federated graphs. #1766
- Expand the scope of files watched for changes in `grafbase dev`. #1774
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the
postgres connector
(https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single
connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two
tables. See the pull request
(#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for
federated graphs. #1766
- Expand the scope of files watched for changes in `grafbase dev`. #1774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants