Skip to content

fix: add @param type annotations to template SQL queries#402

Merged
pkosiec merged 1 commit into
mainfrom
pkosiec/investigate-typegen-warnings
May 22, 2026
Merged

fix: add @param type annotations to template SQL queries#402
pkosiec merged 1 commit into
mainfrom
pkosiec/investigate-typegen-warnings

Conversation

@pkosiec
Copy link
Copy Markdown
Member

@pkosiec pkosiec commented May 22, 2026

Summary

  • Template query files (hello_world.sql, mocked_sales.sql) lacked -- @param type annotations, causing warnings during appkit generate-types on freshly scaffolded apps
  • Added -- @param message STRING to hello_world.sql and -- @param max_month_num INT to mocked_sales.sql

Why

Prior to #251 (April 2026), the type generator replaced all :param placeholders with a default string value ('') regardless of type — no annotation or inference system existed. That PR introduced -- @param annotations, positional type inference (for LIMIT, OFFSET, arithmetic), and warnings for unresolved parameters. The template SQL files were created before this feature and never got annotations, so every freshly scaffolded app now shows these warnings on first npm run dev.

Screenshots

Before

image

After

image

Test plan

  • Scaffolded a fresh app with databricks apps init --template ./template (analytics plugin selected)
  • Ran appkit generate-types — confirmed warnings appeared (before fix)
  • Applied fix, re-scaffolded, re-ran typegen — no warnings
  • pnpm test passes (pre-existing unrelated failure in config.test.ts)

Template query files (hello_world.sql, mocked_sales.sql) lacked
`-- @param` annotations, causing warnings during `appkit generate-types`
on freshly scaffolded apps. Adding STRING and INT annotations silences
the warnings and produces properly typed query parameters.

Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
@pkosiec pkosiec force-pushed the pkosiec/investigate-typegen-warnings branch from 2309622 to 4a614c4 Compare May 22, 2026 13:44
@pkosiec pkosiec marked this pull request as ready for review May 22, 2026 13:45
@pkosiec pkosiec requested a review from a team as a code owner May 22, 2026 13:45
@pkosiec pkosiec requested a review from MarioCadenas May 22, 2026 13:45
@pkosiec pkosiec enabled auto-merge (squash) May 22, 2026 13:45
@pkosiec pkosiec merged commit f7db727 into main May 22, 2026
10 of 11 checks passed
@pkosiec pkosiec deleted the pkosiec/investigate-typegen-warnings branch May 22, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants