Bug Description
When the column name is adjusted, it is not possible to get the exact column name, it may be old or new
Minimal Reproduction
use sqlx::{query, Column, Pool, Row, Sqlite};
#[tokio::main]
async fn main() {
let pool = Pool::<Sqlite>::connect("sqlite://./test.db").await.unwrap();
query(
r#"
DROP TABLE user;
CREATE TABLE "user" (age INTEGER NOT NULL);
INSERT INTO user (age) VALUES (18);
"#,
)
.execute(&pool)
.await
.unwrap();
let print_column = || async {
let row = query(r#"SELECT * from user"#)
.fetch_one(&pool)
.await
.unwrap();
dbg!(row.column(0).name());
};
print_column().await;
// [src/main.rs:22] row.column(0).name() = "age"
query(r#"ALTER TABLE user RENAME COLUMN age TO new_age"#)
.execute(&pool)
.await
.unwrap();
for _ in 0..6 {
print_column().await;
// [src/main.rs:22] row.column(0).name() = "age"
// [src/main.rs:22] row.column(0).name() = "new_age"
// [src/main.rs:22] row.column(0).name() = "age"
// [src/main.rs:22] row.column(0).name() = "new_age"
// [src/main.rs:22] row.column(0).name() = "age"
// [src/main.rs:22] row.column(0).name() = "new_age"
}
}
I don't know if I'm missing something?
It seems like it's always going back and forth between the new and old values.
Info
- SQLx version:
0.7.0-alpha.3 or 0.6.3
- SQLx features enabled:
["runtime-tokio", "sqlite"] or ["runtime-tokio-rustls", "sqlite"]
- Database server and version:
SQLite 3.39.1
- Operating system:
macOS 13.3.1
rustc --version: rustc 1.69.0 (84c898d65 2023-04-16)
Bug Description
When the column name is adjusted, it is not possible to get the exact column name, it may be old or new
Minimal Reproduction
I don't know if I'm missing something?
It seems like it's always going back and forth between the new and old values.
Info
0.7.0-alpha.3or0.6.3["runtime-tokio", "sqlite"]or["runtime-tokio-rustls", "sqlite"]SQLite 3.39.1macOS 13.3.1rustc --version:rustc 1.69.0 (84c898d65 2023-04-16)