Description
I am in the early stages of creating my database schema. I am using barrel
, refinery
, postgres
for migrations, and sqlx
for my actual queries. When I need to make a change to my database, as I am in testing, I drop the database and run migrations again. Migrations are part of my startup process: my program connects to my database with a single postgres
crate connection, runs migrations, then opens a sqlx
PgPool
. The migrations are barrel sql definitions, stored in refinery migration files according to their spec. Never mind for now that sqlx
and refinery
do not mix, I am not worried about it.
I can not start my program without selectively commenting out every sqlx::query_unchecked!()
instance because compile-time checking will complain that the relation does not exist, even though I will be running migrations that creates the relation/table/etc.
My question: Why is it that a macro named query_unchecked
still performs checks? Is there any way to convince sqlx that my database will have such fields once the migrations are ran?