Skip to content

Commit

Permalink
MATCH AGAINST
Browse files Browse the repository at this point in the history
  • Loading branch information
drodrigues4 committed Jul 26, 2024
1 parent 89ebe11 commit b7e596f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drizzle-orm/src/singlestore-core/sql/expressions/conditions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { sql, type SQL, type SQLWrapper } from "~/sql/sql.ts";
import { bindIfParam } from "~/sql/expressions/conditions.ts";
import type { BinaryOperator } from "~/sql/expressions";

/**
* Test that two values match.
*
* ## Examples
*
* ```ts
* // Select cars made by Ford
* db.select().from(cars)
* .where(match(cars.make, 'Ford'))
* ```
*
* @see isNull for a way to test equality to NULL.
*/
export const match: BinaryOperator = (left: SQLWrapper, right: unknown): SQL => {
return sql`MATCH ${left} AGAINST ${bindIfParam(right, left)}`;
};

0 comments on commit b7e596f

Please sign in to comment.