Description
There are a few different clauses to control the behavior of NULL in indexes. From the docs:
NULLS FIRST
Specifies that nulls sort before non-nulls. This is the default when DESC is specified.
NULLS LAST
Specifies that nulls sort after non-nulls. This is the default when DESC is not specified.
NULLS DISTINCT
NULLS NOT DISTINCT
Specifies whether for a unique index, null values should be considered distinct (not equal). The default is that they are distinct, so that a unique index could contain multiple null values in a column.
It would be great if createIndex supported specifying one of these options. I'm particularly interested in NULLS NOT DISTINCT for my use case, but I think they are likely all useful to someone!
I'd be happy to contribute a pull request to implement this if you'd like!
Suggested solution
A proposal for the API: Add a new field nulls to the options parameter of createIndex. The field would have type: 'first' | 'last' | 'distinct' | 'not distinct'.
Alternative
No response
Additional context
No response
Description
There are a few different clauses to control the behavior of
NULLin indexes. From the docs:It would be great if
createIndexsupported specifying one of these options. I'm particularly interested inNULLS NOT DISTINCTfor my use case, but I think they are likely all useful to someone!I'd be happy to contribute a pull request to implement this if you'd like!
Suggested solution
A proposal for the API: Add a new field
nullsto theoptionsparameter ofcreateIndex. The field would have type:'first' | 'last' | 'distinct' | 'not distinct'.Alternative
No response
Additional context
No response