rename function to more clear name and adding associated test as todo

This commit is contained in:
Frédéric CAMPO 2025-02-18 22:05:01 +01:00
parent 433054dd7e
commit 84564a9199
Signed by: llowin
GPG Key ID: 19EACF0560706F99
1 changed files with 7 additions and 1 deletions

View File

@ -43,7 +43,7 @@ fn generate_select_query<T: more_fields::FieldsAsMap>(
/// Generate create table_name with fields as columns
/// This function expects a hash map containing (column name, sqlite type)
pub fn generate_database_query(table_name: &str, fields: HashMap<String, String>) -> String {
pub fn generate_create_table_query(table_name: &str, fields: HashMap<String, String>) -> String {
format!(
"CREATE TABLE IF NOT EXISTS {} ({}, PRIMARY KEY('id' AUTOINCREMENT));",
table_name,
@ -123,4 +123,10 @@ mod test {
]
)
}
#[ignore = "todo"]
#[test]
fn test_generate_create_table_query() {
todo!()
}
}