Skip to content

Commit 4e83a97

Browse files
authored
Improve PgBinOper docs (#916)
<!-- Thank you for contributing to this project! If you need any help please feel free to contact us on Discord: https://discord.com/invite/uCPdDXzbdv Or, mention our core members by typing `@GitHub_Handle` on any issue / PR Add some test cases! It help reviewers to understand the behaviour and prevent it to be broken in the future. --> ## PR Info <!-- mention the related issue --> - Closes <!-- issue link --> <!-- is this PR depends on other PR? (if applicable) --> - Dependencies: - <!-- PR link --> <!-- any PR depends on this PR? (if applicable) --> - Dependents: - <!-- PR link --> ## New Features - [ ] <!-- what are the new features? --> ## Bug Fixes - [ ] <!-- if it fixes a bug, please provide a brief analysis of the original bug --> ## Breaking Changes - [ ] <!-- any change in behaviour or method signature? is it backward compatible? --> ## Changes - [ ] <!-- any other non-breaking changes to the codebase -->
1 parent c68b46b commit 4e83a97

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/extension/postgres/mod.rs

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,50 @@ pub(crate) mod types;
2323
pub enum PgBinOper {
2424
ILike,
2525
NotILike,
26+
/// `@@`. Full-text search match
2627
Matches,
28+
/// `@>`. Contains operator - checks if left operand contains right operand (arrays, JSON)
2729
Contains,
30+
/// `<@`. Contained operator - checks if left operand is contained by right operand (arrays, JSON)
2831
Contained,
32+
/// `||`. String/Array concatenation operator
2933
Concatenate,
34+
/// `&&`. Overlap operator - checks if arrays have any elements in common
3035
Overlap,
36+
/// `%`. Text similarity operator,
37+
/// requires `pg_trgm` extension
3138
Similarity,
39+
/// `<%`. Word similarity operator,
40+
/// requires `pg_trgm` extension
3241
WordSimilarity,
42+
/// `<<%`. Strict word similarity operator,
43+
/// requires `pg_trgm` extension
3344
StrictWordSimilarity,
45+
/// `<->`. Similarity distance operator,
46+
/// requires `pg_trgm` extension
3447
SimilarityDistance,
48+
/// `<<->`. Word similarity distance operator,
49+
/// requires `pg_trgm` extension
3550
WordSimilarityDistance,
51+
/// `<<<->`. Strict word similarity distance operator,
52+
/// requires `pg_trgm` extension
3653
StrictWordSimilarityDistance,
37-
/// `->`. Retrieves JSON field as JSON value.
54+
/// `->`. Retrieves JSON field as JSON value
3855
GetJsonField,
39-
/// `->>`. Retrieves JSON field and casts it to an appropriate SQL type.
56+
/// `->>`. Retrieves JSON field and casts it to text
4057
CastJsonField,
41-
/// `~` Regex operator.
58+
/// `~`. Regex operator, case sensitively
4259
Regex,
43-
/// `~*`. Regex operator with case insensitive matching.
60+
/// `~*`. Regex operator, case-insensitively
4461
RegexCaseInsensitive,
4562
#[cfg(feature = "postgres-vector")]
63+
/// `<->`. L2 (Euclidean) distance operator
4664
EuclideanDistance,
4765
#[cfg(feature = "postgres-vector")]
66+
/// `<#>`. Negative inner product operator
4867
NegativeInnerProduct,
4968
#[cfg(feature = "postgres-vector")]
69+
/// `<=>`. Cosine distance operator
5070
CosineDistance,
5171
}
5272

0 commit comments

Comments
 (0)