@@ -710,8 +710,8 @@ extension QueryExpression where QueryValue == String {
710
710
///
711
711
/// - Parameter pattern: A string expression describing the `GLOB` pattern.
712
712
/// - Returns: A predicate expression.
713
- public func glob( _ pattern: QueryValue ) -> some QueryExpression < Bool > {
714
- BinaryOperator ( lhs: self , operator: " GLOB " , rhs: pattern)
713
+ public func glob( _ pattern: some StringProtocol ) -> some QueryExpression < Bool > {
714
+ BinaryOperator ( lhs: self , operator: " GLOB " , rhs: " \( pattern) " )
715
715
}
716
716
717
717
/// A predicate expression from this string expression matched against another _via_ the `LIKE`
@@ -726,8 +726,11 @@ extension QueryExpression where QueryValue == String {
726
726
/// - pattern: A string expression describing the `LIKE` pattern.
727
727
/// - escape: An optional character for the `ESCAPE` clause.
728
728
/// - Returns: A predicate expression.
729
- public func like( _ pattern: QueryValue , escape: Character ? = nil ) -> some QueryExpression < Bool > {
730
- LikeOperator ( string: self , pattern: pattern, escape: escape)
729
+ public func like(
730
+ _ pattern: some StringProtocol ,
731
+ escape: Character ? = nil
732
+ ) -> some QueryExpression < Bool > {
733
+ LikeOperator ( string: self , pattern: " \( pattern) " , escape: escape)
731
734
}
732
735
733
736
/// A predicate expression from this string expression matched against another _via_ the `MATCH`
@@ -740,8 +743,12 @@ extension QueryExpression where QueryValue == String {
740
743
///
741
744
/// - Parameter pattern: A string expression describing the `MATCH` pattern.
742
745
/// - Returns: A predicate expression.
743
- public func match( _ pattern: QueryValue ) -> some QueryExpression < Bool > {
744
- BinaryOperator ( lhs: self , operator: " MATCH " , rhs: pattern)
746
+ public func match( _ pattern: some StringProtocol ) -> some QueryExpression < Bool > {
747
+ BinaryOperator (
748
+ lhs: self ,
749
+ operator: " MATCH " ,
750
+ rhs: " \( pattern) "
751
+ )
745
752
}
746
753
747
754
/// A predicate expression from this string expression matched against another _via_ the `LIKE`
@@ -754,7 +761,7 @@ extension QueryExpression where QueryValue == String {
754
761
///
755
762
/// - Parameter other: A string expression describing the prefix.
756
763
/// - Returns: A predicate expression.
757
- public func hasPrefix( _ other: QueryValue ) -> some QueryExpression < Bool > {
764
+ public func hasPrefix( _ other: some StringProtocol ) -> some QueryExpression < Bool > {
758
765
like ( " \( other) % " )
759
766
}
760
767
@@ -768,7 +775,7 @@ extension QueryExpression where QueryValue == String {
768
775
///
769
776
/// - Parameter other: A string expression describing the suffix.
770
777
/// - Returns: A predicate expression.
771
- public func hasSuffix( _ other: QueryValue ) -> some QueryExpression < Bool > {
778
+ public func hasSuffix( _ other: some StringProtocol ) -> some QueryExpression < Bool > {
772
779
like ( " % \( other) " )
773
780
}
774
781
@@ -783,7 +790,7 @@ extension QueryExpression where QueryValue == String {
783
790
/// - Parameter other: A string expression describing the infix.
784
791
/// - Returns: A predicate expression.
785
792
@_disfavoredOverload
786
- public func contains( _ other: QueryValue ) -> some QueryExpression < Bool > {
793
+ public func contains( _ other: some StringProtocol ) -> some QueryExpression < Bool > {
787
794
like ( " % \( other) % " )
788
795
}
789
796
}
0 commit comments