Skip to content

Commit 98baaa6

Browse files
committed
(SQLite) Added test for nullability of rowid
Tests the nullability of explicitly referring to the rowid column (not through an alias).
1 parent 70d4157 commit 98baaa6

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

sqlx-sqlite/src/connection/explain.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,16 +1815,28 @@ fn test_explain() {
18151815

18161816
assert!(
18171817
if let Ok((ty, nullable)) = explain(&mut conn, "SELECT * FROM an_alias") {
1818-
ty.as_slice() == &[SqliteTypeInfo(DataType::Integer)]
1819-
&& nullable.as_slice() == &[Some(false)]
1818+
ty == [SqliteTypeInfo(DataType::Integer)] && nullable == [Some(false)]
18201819
} else {
18211820
false
18221821
}
18231822
);
18241823
assert!(
18251824
if let Ok((ty, nullable)) = explain(&mut conn, "SELECT * FROM not_an_alias") {
1826-
ty.as_slice() == &[SqliteTypeInfo(DataType::Integer)]
1827-
&& nullable.as_slice() == &[Some(true)]
1825+
ty == [SqliteTypeInfo(DataType::Integer)] && nullable == [Some(true)]
1826+
} else {
1827+
false
1828+
}
1829+
);
1830+
assert!(
1831+
if let Ok((ty, nullable)) = explain(&mut conn, "SELECT rowid FROM an_alias") {
1832+
ty == [SqliteTypeInfo(DataType::Integer)] && nullable == [Some(false)]
1833+
} else {
1834+
false
1835+
}
1836+
);
1837+
assert!(
1838+
if let Ok((ty, nullable)) = explain(&mut conn, "SELECT rowid FROM not_an_alias") {
1839+
ty == [SqliteTypeInfo(DataType::Integer)] && nullable == [Some(false)]
18281840
} else {
18291841
false
18301842
}

0 commit comments

Comments
 (0)