Skip to content

Commit 92bdd1e

Browse files
fix(editor): generate SQL when clicking the table name
Keep expand/collapse on the chevron only so a normal click inserts schema-qualified SELECT … FROM schema.table. Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
1 parent 42fc87d commit 92bdd1e

1 file changed

Lines changed: 27 additions & 12 deletions

File tree

src/components/tabs/Core/SqlRunnerTab.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,18 +1964,33 @@ export default function SqlRunnerTab({ connectionId }) {
19641964
handleTableContextMenu(e, table)
19651965
}
19661966
>
1967-
<div
1968-
className={styles.objectName}
1969-
onClick={(e) => {
1970-
e.stopPropagation();
1971-
toggleNode(`table-${objectKey(table)}`);
1972-
}}
1973-
>
1974-
{expandedNodes[`table-${objectKey(table)}`] ? (
1975-
<ChevronDown size={14} />
1976-
) : (
1977-
<ChevronRight size={14} />
1978-
)}
1967+
<div className={styles.objectName}>
1968+
<button
1969+
type="button"
1970+
className={styles.expandToggle || undefined}
1971+
style={{
1972+
background: "transparent",
1973+
border: "none",
1974+
padding: 0,
1975+
display: "inline-flex",
1976+
cursor: "pointer",
1977+
}}
1978+
aria-label={
1979+
expandedNodes[`table-${objectKey(table)}`]
1980+
? "Collapse columns"
1981+
: "Expand columns"
1982+
}
1983+
onClick={(e) => {
1984+
e.stopPropagation();
1985+
toggleNode(`table-${objectKey(table)}`);
1986+
}}
1987+
>
1988+
{expandedNodes[`table-${objectKey(table)}`] ? (
1989+
<ChevronDown size={14} />
1990+
) : (
1991+
<ChevronRight size={14} />
1992+
)}
1993+
</button>
19791994
<span title={canonicalTableReference(table)}>
19801995
{multiSchema && table.schema && table.schema !== 'public'
19811996
? <><span style={{opacity:0.55}}>{table.schema}.</span>{table.name}</>

0 commit comments

Comments
 (0)