@@ -12,7 +12,6 @@ export type SupportedSQLValue =
1212 | Date
1313 | Buffer
1414 | bigint
15- | undefined // Will be treated as NULL
1615 | readonly SupportedSQLValue [ ] // For IN clauses and array types
1716 | Readonly < { [ key : string ] : unknown } > ; // For JSON/JSONB columns
1817
@@ -303,7 +302,7 @@ export function sql<TFields extends Record<string, any>>(
303302 strings . forEach ( ( string , i ) => {
304303 sqlString += string ;
305304 if ( i < values . length ) {
306- const value = values [ i ] ;
305+ const value = values [ i ] ! ;
307306
308307 if ( value instanceof SQLFragment ) {
309308 // Handle nested SQL fragments
@@ -368,7 +367,7 @@ export class SQLChainableFragment<
368367> extends SQLFragment < TFields > {
369368 /**
370369 * Generates an equality condition (`= value`).
371- * Automatically converts `null`/`undefined` to `IS NULL`.
370+ * Automatically converts `null` to `IS NULL`.
372371 *
373372 * @param value - The value to compare against
374373 * @returns A {@link SQLFragment} representing the equality condition
@@ -382,7 +381,7 @@ export class SQLChainableFragment<
382381
383382 /**
384383 * Generates an inequality condition (`!= value`).
385- * Automatically converts `null`/`undefined` to `IS NOT NULL`.
384+ * Automatically converts `null` to `IS NOT NULL`.
386385 *
387386 * @param value - The value to compare against
388387 * @returns A {@link SQLFragment} representing the inequality condition
@@ -635,9 +634,7 @@ type ExtractFragmentFields<T> = T extends SQLFragment<infer F> ? F : never;
635634// Conditional value types for expression overloads.
636635// Uses SQLChainableFragment<any, ...> so that TExpr alone drives inference (single type param).
637636type FragmentValueNullable < TFragment > =
638- TFragment extends SQLChainableFragment < any , infer TValue >
639- ? TValue | null | undefined
640- : SupportedSQLValue ;
637+ TFragment extends SQLChainableFragment < any , infer TValue > ? TValue | null : SupportedSQLValue ;
641638
642639type FragmentValue < TFragment > =
643640 TFragment extends SQLChainableFragment < any , infer TValue > ? TValue : SupportedSQLValue ;
@@ -950,7 +947,7 @@ function isNotNullHelper<TFields extends Record<string, any>>(
950947
951948/**
952949 * Generates an equality condition (`= value`) from a fragment.
953- * Automatically converts `null`/`undefined` to `IS NULL`.
950+ * Automatically converts `null` to `IS NULL`.
954951 *
955952 * @param fragment - A SQLFragment or SQLChainableFragment to compare
956953 * @param value - The value to compare against
@@ -961,7 +958,7 @@ function eqHelper<TFragment extends SQLFragment<any>>(
961958) : SQLFragment < ExtractFragmentFields < TFragment > > ;
962959/**
963960 * Generates an equality condition (`= value`) from a field name.
964- * Automatically converts `null`/`undefined` to `IS NULL`.
961+ * Automatically converts `null` to `IS NULL`.
965962 *
966963 * @param fieldName - The entity field name to compare
967964 * @param value - The value to compare against
@@ -979,7 +976,7 @@ function eqHelper<TFields extends Record<string, any>>(
979976
980977/**
981978 * Generates an inequality condition (`!= value`) from a fragment.
982- * Automatically converts `null`/`undefined` to `IS NOT NULL`.
979+ * Automatically converts `null` to `IS NOT NULL`.
983980 *
984981 * @param fragment - A SQLFragment or SQLChainableFragment to compare
985982 * @param value - The value to compare against
@@ -990,7 +987,7 @@ function neqHelper<TFragment extends SQLFragment<any>>(
990987) : SQLFragment < ExtractFragmentFields < TFragment > > ;
991988/**
992989 * Generates an inequality condition (`!= value`) from a field name.
993- * Automatically converts `null`/`undefined` to `IS NOT NULL`.
990+ * Automatically converts `null` to `IS NOT NULL`.
994991 *
995992 * @param fieldName - The entity field name to compare
996993 * @param value - The value to compare against
0 commit comments