@opengeni/db 4.5.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78017,13 +78017,13 @@ async function getSessionLineage(db, workspaceId, sessionId) {
|
|
|
78017
78017
|
}
|
|
78018
78018
|
const ancestorRows = ancestorLineageRows.filter((row) => row.depth > 0);
|
|
78019
78019
|
const childRows = await scopedDb.execute(sql150`
|
|
78020
|
-
with recursive descendants(id, parent_session_id, depth, path) as (
|
|
78021
|
-
select child.id, child.parent_session_id, 1, array[${sessionId}, child.id]
|
|
78020
|
+
with recursive descendants(id, parent_session_id, created_at, depth, path) as (
|
|
78021
|
+
select child.id, child.parent_session_id, child.created_at, 1, array[${sessionId}, child.id]
|
|
78022
78022
|
from ${sessions} child
|
|
78023
78023
|
where child.workspace_id = ${workspaceId}
|
|
78024
78024
|
and child.parent_session_id = ${sessionId}
|
|
78025
78025
|
union all
|
|
78026
|
-
select child.id, child.parent_session_id, descendants.depth + 1, descendants.path || child.id
|
|
78026
|
+
select child.id, child.parent_session_id, child.created_at, descendants.depth + 1, descendants.path || child.id
|
|
78027
78027
|
from ${sessions} child
|
|
78028
78028
|
join descendants on child.parent_session_id = descendants.id
|
|
78029
78029
|
where child.workspace_id = ${workspaceId}
|
|
@@ -78032,7 +78032,7 @@ async function getSessionLineage(db, workspaceId, sessionId) {
|
|
|
78032
78032
|
)
|
|
78033
78033
|
select id, parent_session_id as "parentSessionId", depth, path, false as cycle
|
|
78034
78034
|
from descendants
|
|
78035
|
-
order by
|
|
78035
|
+
order by depth, created_at desc, id desc
|
|
78036
78036
|
limit ${descendantLimit + 1}
|
|
78037
78037
|
`);
|
|
78038
78038
|
const truncated = childRows.length > descendantLimit;
|
|
@@ -114727,4 +114727,4 @@ export {
|
|
|
114727
114727
|
isCodexBilledModel2 as isCodexBilledModel,
|
|
114728
114728
|
sql151 as sql
|
|
114729
114729
|
};
|
|
114730
|
-
//# sourceMappingURL=chunk-
|
|
114730
|
+
//# sourceMappingURL=chunk-ZWXHVIPE.js.map
|