diff --git a/pipekit/web/app.py b/pipekit/web/app.py index 3174ab0..e8f227c 100644 --- a/pipekit/web/app.py +++ b/pipekit/web/app.py @@ -724,9 +724,13 @@ async def wizard_create(request: Request): raise HTTPException(400, "no columns selected") qualified_source = src_drv.qualified_table_name(table, **qvals) + # Alias quoting must use the SOURCE dialect — this query runs on the + # source. (The load maps columns by position, so the alias is cosmetic; + # using dest quoting here leaked e.g. SQL Server [brackets] into a + # Postgres source query.) select_list = ",\n ".join( f"{src_drv.default_expression(c['source_type'], c['source_name'])} AS " - f"{dest_drv.quote_identifier(c['dest_name'])}" + f"{src_drv.quote_identifier(c['dest_name'])}" for c in chosen ) source_query_override = (form.get("source_query") or "").strip()