dromara / dromara/easy-query

[Feature] asTreeCte支持额外列

Open
#479 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
777
Forks
78
PR merge metrics
No merged PRs in 30d

Description

```sql
WITH RECURSIVE tree AS (
SELECT
id,
parent_id,
id AS root_id -- 额外列
FROM table
WHERE parent_id IS NULL

UNION ALL

SELECT
t.id,
t.parentId,
p.root_id
FROM table t
INNER JOIN tree p ON t.parent_id = p.id
)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the asTreeCte entry point and the code that builds its recursive CTE query. Compare the generated anchor and recursive parts with the SQL example, then identify the relevant tests or add coverage showing that an extra root_id-style column is retained in the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.