pg-mem icon indicating copy to clipboard operation
pg-mem copied to clipboard

NULLS FIRST not implemented

Open prescience-data opened this issue 4 years ago • 1 comments

Just noticed that ORDER BY col NULLS FIRST is not yet implemented.

Understandable if not on the agenda, but thought I'd flag it just in case.

Thanks!

prescience-data avatar Jun 30 '21 00:06 prescience-data

Thanks :)

I'll add that to my todolist, but I dont have time to work on it these days :(

oguimbal avatar Jul 12 '21 12:07 oguimbal

Looks like you ended up having time :) — this was implemented in 71d3471c87312d7e5d03e3025aaa24c55c06afbd.

gthb avatar Jan 31 '23 15:01 gthb

Oh, but NULLS FIRST with ASC is broken. This test should pass:

    it('can order by asc with nulls first', () => {
        expect(many(`create table test(val text);
            insert into test values ('b'), ('a'), (null);
            select t.val as value from test t order by t.val asc nulls first`))
            .to.deep.equal([
                { value: null }
                , { value: 'a' }
                , { value: 'b' }
            ]);
    });

but it fails.

gthb avatar Jan 31 '23 15:01 gthb

Posted a fix in https://github.com/oguimbal/pg-mem/pull/296/

gthb avatar Jan 31 '23 15:01 gthb

should be fixed with [email protected] thanks

oguimbal avatar Mar 14 '23 14:03 oguimbal