Skip to main content

table_count

Function table_count 

Source
pub(super) fn table_count(conn: &Connection, table: &str) -> Result<i64, String>
Expand description

SELECT COUNT(*) FROM <table> on a (read-only) connection, treating a missing table as 0 rows — a store from before the table existed has nothing in it, which is exactly the answer a post-condition wants. Any other SQLite error is surfaced. table must be a literal identifier from the calling migration, never user input (it is interpolated, not bound).