@rvoh/dream
    Preparing search index...

    Variable opsConst

    ops: {
        any: <const AnyT>(
            value: AnyT,
        ) => CurriedOpsStatement<any, any, any, AnyT>;
        equal: <const T>(equal: T) => OpsStatement<"=", T, undefined>;
        expression: <
            const T,
            const Operator extends "%" | "<%" | "<<%" | ComparisonOperatorExpression,
            const ComputedT,
        >(
            operator: Operator,
            value: T,
        ) => OpsStatement<Operator, ComputedT, any>;
        greaterThan: <const T>(greaterThan: T) => OpsStatement<">", T, undefined>;
        greaterThanOrEqualTo: <const T>(
            greaterThanOrEqualTo: T,
        ) => OpsStatement<">=", T, undefined>;
        ilike: (ilike: string) => OpsStatement<"ilike", string, undefined>;
        in: <const T extends unknown[]>(
            arr: T,
        ) => OpsStatement<"in", T[number], undefined>;
        jsonb: (
            searchObj: object,
        ) => OpsStatement<"@>", RawBuilder<unknown>, undefined>;
        lessThan: <const T>(lessThan: T) => OpsStatement<"<", T, undefined>;
        lessThanOrEqualTo: <const T>(
            lessThanOrEqualTo: T,
        ) => OpsStatement<"<=", T, undefined>;
        like: (like: string) => OpsStatement<"like", string, undefined> & {
            escape: (input: string) => string;
        };
        match: (
            match: string,
            __namedParameters?: { caseInsensitive?: boolean },
        ) => OpsStatement<"~" | "~*", string, undefined>;
        not: {
            equal: <const T>(equal: T) => OpsStatement<"!=", T, undefined>;
            greaterThan: <const T>(greaterThan: T) => OpsStatement<"<=", T, undefined>;
            greaterThanOrEqualTo: <const T>(
                greaterThanOrEqualTo: T,
            ) => OpsStatement<"<", T, undefined>;
            ilike: (ilike: string) => OpsStatement<"not ilike", string, undefined>;
            in: <const T extends unknown[]>(
                arr: T,
            ) => OpsStatement<"not in", T[number], undefined>;
            lessThan: <const T>(lessThan: T) => OpsStatement<">=", T, undefined>;
            lessThanOrEqualTo: <const T>(
                lessThanOrEqualTo: T,
            ) => OpsStatement<">", T, undefined>;
            like: (like: string) => OpsStatement<"not like", string, undefined>;
            match: (
                match: string,
                __namedParameters?: { caseInsensitive?: boolean },
            ) => OpsStatement<"!~" | "!~*", string, undefined>;
        };
        similarity: (
            similarity: string,
            __namedParameters?: { score?: number },
        ) => OpsStatement<"%", string, { score: number }>;
        strictWordSimilarity: (
            similarity: string,
            __namedParameters?: { score?: number },
        ) => OpsStatement<"<<%", string, { score: number }>;
        wordSimilarity: (
            similarity: string,
            __namedParameters?: { score?: number },
        ) => OpsStatement<"<%", string, { score: number }>;
    } = ...

    Type Declaration

    • any: <const AnyT>(value: AnyT) => CurriedOpsStatement<any, any, any, AnyT>

      Creates a CurriedOpsStatement that checks whether a PostgreSQL array column contains the given value using @> ARRAY[value]::type. The column type is resolved at query-build time from the Dream model's schema.

      Throws AnyRequiresArrayColumn if the target column is not a database array type.

      Post.where({ tags: ops.any('typescript') })
      
    • equal: <const T>(equal: T) => OpsStatement<"=", T, undefined>

      Creates an OpsStatement using the = operator for strict equality.

      User.where({ role: ops.equal('admin') })
      
    • expression: <
          const T,
          const Operator extends "%" | "<%" | "<<%" | ComparisonOperatorExpression,
          const ComputedT,
      >(
          operator: Operator,
          value: T,
      ) => OpsStatement<Operator, ComputedT, any>

      Creates an OpsStatement with an arbitrary Kysely comparison operator or trigram operator. Use this as an escape hatch when none of the named helpers cover your use case.

      User.where({ name: ops.expression('like', '%ello%') })
      
    • greaterThan: <const T>(greaterThan: T) => OpsStatement<">", T, undefined>

      Creates an OpsStatement using the > operator.

      Order.where({ total: ops.greaterThan(50) })
      
    • greaterThanOrEqualTo: <const T>(greaterThanOrEqualTo: T) => OpsStatement<">=", T, undefined>

      Creates an OpsStatement using the >= operator.

      Order.where({ total: ops.greaterThanOrEqualTo(50) })
      
    • ilike: (ilike: string) => OpsStatement<"ilike", string, undefined>

      Creates an OpsStatement using the SQL ILIKE operator for case-insensitive pattern matching. Use % as a wildcard in the pattern string.

      User-supplied patterns: the value is bound as a parameter (no SQL injection), but %, _, and \ in the bound value are still interpreted as wildcards by the SQL engine. Wrap user input with ops.like.escape if you need literal matching.

      User.where({ name: ops.ilike('%alice%') })
      
    • in: <const T extends unknown[]>(arr: T) => OpsStatement<"in", T[number], undefined>

      Creates an OpsStatement for a SQL IN clause, matching rows whose column value is one of the provided array elements.

      User.where({ status: ops.in(['active', 'pending']) })
      
    • jsonb: (searchObj: object) => OpsStatement<"@>", RawBuilder<unknown>, undefined>

      Creates an OpsStatement that checks whether a JSONB column contains the given object using the PostgreSQL @> (contains) operator.

      Post.where({ metadata: ops.jsonb({ published: true }) })
      
    • lessThan: <const T>(lessThan: T) => OpsStatement<"<", T, undefined>

      Creates an OpsStatement using the < operator.

      Order.where({ total: ops.lessThan(100) })
      
    • lessThanOrEqualTo: <const T>(lessThanOrEqualTo: T) => OpsStatement<"<=", T, undefined>

      Creates an OpsStatement using the <= operator.

      Order.where({ total: ops.lessThanOrEqualTo(100) })
      
    • like: (like: string) => OpsStatement<"like", string, undefined> & {
          escape: (input: string) => string;
      }

      Creates an OpsStatement using the SQL LIKE operator for case-sensitive pattern matching. Use % as a wildcard in the pattern string.

      User-supplied patterns: the value is bound as a parameter (no SQL injection), but %, _, and \ in the bound value are still interpreted as wildcards by the SQL engine. Wrap user input with ops.like.escape if you need literal matching:

      User.where({ name: ops.like(`%${ops.like.escape(query)}%`) })
      

      ops.like.escape escapes the three metacharacters that PostgreSQL's LIKE / ILIKE operators treat as wildcards (\, %, _) so the returned string matches literally. The same helper applies to all four LIKE-family ops (like, ilike, not.like, not.ilike); it is exposed here as the canonical entry point. If a caller uses ESCAPE '...' with a non-default character this helper will not be appropriate.

      The pattern string (e.g. '%hello%').

      An OpsStatement using the like operator.

      User.where({ name: ops.like('%alice%') })
      
    • match: (
          match: string,
          __namedParameters?: { caseInsensitive?: boolean },
      ) => OpsStatement<"~" | "~*", string, undefined>

      Creates an OpsStatement that matches a column against a POSIX regular expression. By default the match is case-sensitive (~); pass { caseInsensitive: true } to use ~*.

      User.where({ email: ops.match('^admin', { caseInsensitive: true }) })
      
    • not: {
          equal: <const T>(equal: T) => OpsStatement<"!=", T, undefined>;
          greaterThan: <const T>(greaterThan: T) => OpsStatement<"<=", T, undefined>;
          greaterThanOrEqualTo: <const T>(
              greaterThanOrEqualTo: T,
          ) => OpsStatement<"<", T, undefined>;
          ilike: (ilike: string) => OpsStatement<"not ilike", string, undefined>;
          in: <const T extends unknown[]>(
              arr: T,
          ) => OpsStatement<"not in", T[number], undefined>;
          lessThan: <const T>(lessThan: T) => OpsStatement<">=", T, undefined>;
          lessThanOrEqualTo: <const T>(
              lessThanOrEqualTo: T,
          ) => OpsStatement<">", T, undefined>;
          like: (like: string) => OpsStatement<"not like", string, undefined>;
          match: (
              match: string,
              __namedParameters?: { caseInsensitive?: boolean },
          ) => OpsStatement<"!~" | "!~*", string, undefined>;
      }

      Negated variants of the standard comparison operators.

      • equal: <const T>(equal: T) => OpsStatement<"!=", T, undefined>

        Creates an OpsStatement using the != operator for inequality.

        User.where({ role: ops.not.equal('guest') })
        
      • greaterThan: <const T>(greaterThan: T) => OpsStatement<"<=", T, undefined>

        Creates an OpsStatement that negates >, equivalent to <=.

        Order.where({ total: ops.not.greaterThan(50) }) // total <= 50
        
      • greaterThanOrEqualTo: <const T>(greaterThanOrEqualTo: T) => OpsStatement<"<", T, undefined>

        Creates an OpsStatement that negates >=, equivalent to <.

        Order.where({ total: ops.not.greaterThanOrEqualTo(50) }) // total < 50
        
      • ilike: (ilike: string) => OpsStatement<"not ilike", string, undefined>

        Creates an OpsStatement using the NOT ILIKE operator for case-insensitive pattern exclusion.

        User-supplied patterns: see the note on ops.ilike. Wrap user input with ops.like.escape for literal matching.

        User.where({ email: ops.not.ilike('%@example.com') })
        
      • in: <const T extends unknown[]>(
            arr: T,
        ) => OpsStatement<"not in", T[number], undefined>

        Creates an OpsStatement for a SQL NOT IN clause, excluding rows whose column value is one of the provided array elements.

        User.where({ status: ops.not.in(['banned', 'deleted']) })
        
      • lessThan: <const T>(lessThan: T) => OpsStatement<">=", T, undefined>

        Creates an OpsStatement that negates <, equivalent to >=.

        Order.where({ total: ops.not.lessThan(100) }) // total >= 100
        
      • lessThanOrEqualTo: <const T>(lessThanOrEqualTo: T) => OpsStatement<">", T, undefined>

        Creates an OpsStatement that negates <=, equivalent to >.

        Order.where({ total: ops.not.lessThanOrEqualTo(100) }) // total > 100
        
      • like: (like: string) => OpsStatement<"not like", string, undefined>

        Creates an OpsStatement using the NOT LIKE operator for case-sensitive pattern exclusion.

        User-supplied patterns: see the note on ops.like. Wrap user input with ops.like.escape for literal matching.

        User.where({ email: ops.not.like('%@example.com') })
        
      • match: (
            match: string,
            __namedParameters?: { caseInsensitive?: boolean },
        ) => OpsStatement<"!~" | "!~*", string, undefined>

        Creates an OpsStatement that excludes rows matching a POSIX regular expression. By default the match is case-sensitive (!~); pass { caseInsensitive: true } to use !~*.

        User.where({ email: ops.not.match('^admin', { caseInsensitive: true }) })
        
    • similarity: (
          similarity: string,
          __namedParameters?: { score?: number },
      ) => OpsStatement<"%", string, { score: number }>

      Creates an OpsStatement for PostgreSQL trigram similarity (% operator). Rows are included when the similarity score meets or exceeds score.

      Requires the pg_trgm extension to be enabled.

      User.where({ name: ops.similarity('alice', { score: 0.4 }) })
      
    • strictWordSimilarity: (
          similarity: string,
          __namedParameters?: { score?: number },
      ) => OpsStatement<"<<%", string, { score: number }>

      Creates an OpsStatement for PostgreSQL strict word similarity (<<% operator). Rows are included when the strict word similarity score meets or exceeds score.

      Requires the pg_trgm extension to be enabled.

      Article.where({ title: ops.strictWordSimilarity('postgres', { score: 0.7 }) })
      
    • wordSimilarity: (
          similarity: string,
          __namedParameters?: { score?: number },
      ) => OpsStatement<"<%", string, { score: number }>

      Creates an OpsStatement for PostgreSQL word similarity (<% operator). Rows are included when the word similarity score meets or exceeds score.

      Requires the pg_trgm extension to be enabled.

      Article.where({ title: ops.wordSimilarity('postgres', { score: 0.6 }) })