SQL Expressions: Improve placeholder SQL Query (#103092)

This gives the user more hints as to how to succeed with SQL Expressions
This commit is contained in:
Sam Jewell
2025-03-31 13:29:12 +01:00
committed by GitHub
parent bb344fcd83
commit 3366d74411
@@ -28,7 +28,12 @@ interface Props {
export const SqlExpr = ({ onChange, refIds, query }: Props) => {
const vars = useMemo(() => refIds.map((v) => v.value!), [refIds]);
const initialQuery = `select * from ${vars[0]} limit 1`;
const initialQuery = `-- Run MySQL-dialect SQL against the tables returned from your data sources.
-- Data source queries (ie "${vars[0]}") are available as tables and referenced by query-name
-- Fields are available as columns, as returned from the data source.
SELECT *
FROM ${vars[0]}
LIMIT 10`;
const styles = useStyles2(getStyles);
const containerRef = useRef<HTMLDivElement>(null);
const [dimensions, setDimensions] = useState({ height: 0 });