• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Giorgi / DuckDB.NET / 22734550158

05 Mar 2026 08:06PM UTC coverage: 89.491%. Remained the same
22734550158

push

github

Giorgi
Add NULL handling support for scalar functions

Replace `isPureFunction` bool with `ScalarFunctionOptions`
record that supports `IsPureFunction` and `HandlesNulls`.

- Add `ScalarFunctionOptions` with `IsPureFunction` and
  `HandlesNulls` properties
- Bind `duckdb_scalar_function_set_special_handling` native
  method to enable NULL passthrough
- Update simplified scalar function extensions to validate
  nullable parameter types when `HandlesNulls` is true
- Propagate NULL correctly: nullable types get default,
  non-nullable types throw with a clear error message
- Update existing tests to use new options API

1287 of 1499 branches covered (85.86%)

Branch coverage included in aggregate %.

41 of 49 new or added lines in 3 files covered. (83.67%)

2 existing lines in 2 files now uncovered.

2630 of 2878 relevant lines covered (91.38%)

446353.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/DuckDB.NET.Data/ScalarFunctionOptions.cs
1
namespace DuckDB.NET.Data;
2

NEW
3
public record ScalarFunctionOptions
×
4
{
5
    /// <summary>
6
    /// Whether the function is pure (deterministic). When null, defaults to
7
    /// true for functions with parameters and false for parameterless functions.
8
    /// </summary>
9
    public bool? IsPureFunction { get; init; }
36✔
10

11
    /// <summary>
12
    /// When true, the function receives NULL inputs and handles them itself.
13
    /// When false (default), DuckDB auto-propagates NULL without calling the function.
14
    /// </summary>
15
    public bool HandlesNulls { get; init; }
87✔
16
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc