Repository: drizzle-team/drizzle-orm
File: drizzle-orm/src/sql/expressions/conditions.ts (TypeScript)

Code before:
export function bindIfParam(value: unknown, column: AnyColumn | SQL.Aliased): SQLChunk {
	if (
		isDriverValueEncoder(column) && !isSQLWrapper(value) && !(value instanceof Param) && !(value instanceof Placeholder)
		&& !(value instanceof Column) && !(value instanceof Table) && !(value instanceof View)
	) {
		return new Param(value, column);
	}
	return value as SQLChunk;
}


/**
 * Test that two values are equal.
 *
 * Remember that the SQL standard dictates that
 * two NULL values are not equal, so if you want to test
 * whether a value is null, you may want to use
 * `isNull` instead.
 * 
 * ## Examples
 *
 * ```ts
 * // Select cars made by Ford
 * db.select(cars)
 *   .where(
 *     eq(cars.make, 'Ford'))
 * ```
 *
 * @see isNull for a way to test equality to NULL.
 */
export function eq<T>(
	left: SQL.Aliased<T>,
	right: T | Placeholder | SQLWrapper | AnyColumn,
): SQL;
export function eq<TColumn extends AnyColumn>(
	left: TColumn,
	right: GetColumnData<TColumn, 'raw'> | Placeholder | SQLWrapper | AnyColumn,
): SQL;
export function eq(
	left: AnyColumn | SQL.Aliased,
	right: unknown | Placeholder | SQLWrapper | AnyColumn,
): SQL {
	return sql`${left} = ${bindIfParam(right, left)}`;
}

/**
 * Test that two values are not equal.
 *
 * Remember that the SQL standard dictates that
 * two NULL values are not equal, so if you want to test
 * whether a value is not null, you may want to use

Review comment (suggestion):
Please change the formatting through the code chunks to be either like this:
```suggestion
 *   .where(
 *     eq(cars.make, 'Ford'),
 *   )
```
or like this:
```suggestion
 *   .where(eq(cars.make, 'Ford'))
```

Code after:
export function bindIfParam(value: unknown, column: AnyColumn | SQL.Aliased): SQLChunk {
	if (
		isDriverValueEncoder(column) && !isSQLWrapper(value) && !(value instanceof Param) && !(value instanceof Placeholder)
		&& !(value instanceof Column) && !(value instanceof Table) && !(value instanceof View)
	) {
		return new Param(value, column);
	}
	return value as SQLChunk;
}


/**
 * Test that two values are equal.
 *
 * Remember that the SQL standard dictates that
 * two NULL values are not equal, so if you want to test
 * whether a value is null, you may want to use
 * `isNull` instead.
 * 
 * ## Examples
 *
 * ```ts
 * // Select cars made by Ford
 * db.select(cars)
 *   .where(eq(cars.make, 'Ford'))
 * ```
 *
 * @see isNull for a way to test equality to NULL.
 */
export function eq<T>(
	left: SQL.Aliased<T>,
	right: T | Placeholder | SQLWrapper | AnyColumn,
): SQL;
export function eq<TColumn extends AnyColumn>(
	left: TColumn,
	right: GetColumnData<TColumn, 'raw'> | Placeholder | SQLWrapper | AnyColumn,
): SQL;
export function eq(
	left: AnyColumn | SQL.Aliased,
	right: unknown | Placeholder | SQLWrapper | AnyColumn,
): SQL {
	return sql`${left} = ${bindIfParam(right, left)}`;
}

/**
 * Test that two values are not equal.
 *
 * Remember that the SQL standard dictates that
 * two NULL values are not equal, so if you want to test
 * whether a value is not null, you may want to use
 * `isNotNull` instead.