fix: address SQL feature code review findings

- Normalize student SQL to end with exactly one semicolon before
  appending the trailing SELECT, so a missing trailing ; no longer
  produces a confusing parse error (sqlTable.ts)
- Remove unused description field from SqlTablePreset and all presets
  (dead data, nothing in the UI reads it)
- Clear output when the candidate table selection changes, so stale
  results from the previous table don't linger (SqlSection.vue)
- Remove stray console.log(props.language) debug statement
  (CodeEditor.vue)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 00:16:26 -06:00
parent 62ef50fb76
commit f8e59e9850
4 changed files with 8 additions and 7 deletions

View File

@@ -11,5 +11,6 @@ export function buildSqlScript(studentSql: string) {
const table =
sqlTables.find((item) => item.id === selectedTableId.value) ??
sqlTables[0]
return `${table.setupSql}\n\n${studentSql}\n\nSELECT * FROM ${table.tableName};`
const normalizedSql = studentSql.trim().replace(/;?\s*$/, ";")
return `${table.setupSql}\n\n${normalizedSql}\n\nSELECT * FROM ${table.tableName};`
}