Hey everyone,

I have a Postgres database with a table that has several columns. Whenever I alter the table—like adding a new column or constraint—sqlx::query! doesn’t pick up the change.

For example, if I run SELECT * FROM table;, the returned records only include the old columns. Trying to access a new column added via ALTER TABLE (e.g., carlid1) gives this error:

No field `carlid1` in type `Record` [E0609]

This happens every time and sometimes seems to fix itself after a few days, but it’s really frustrating. I suspect it has to do with updating what sqlx knows about the DB schema, but I haven’t found a solution that works.

I’ve already tried:

cargo sqlx prepare (and all its variations)

cargo check

cargo build

Restarting RustRover

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help