alfateam/orange-orm

[BUG]: Incorrect column alias on deeply nested many relation filter

Closed this issue · 0 comments

lroal commented

rdb Version

3.6.0

Database

SAP ASE

Database Version

16

Operating System

mcr.microsoft.com/vscode/devcontainers/javascript-node:0-20-bullseye

Description

Yields incorrect sql alias on column when relation filter on many relation is deep.
It only works when first level of relation is many relation.

 const dokument = await db.dokument.getById(file_id, {
        dokument_mappe: { //one relation
            mappe: {
                deling: {
                    where: x => x.dfs_dok_tilgang_type_id.in([1,2]) //would only work if dokument_mappe is many relation as well
                }
            }
        }
    });

Expected Behavior

Produce correct column alias.