diff options
| author | Teddy Wing | 2022-03-21 01:57:09 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2022-03-21 01:57:09 +0100 | 
| commit | 4ee0b82e55935c3a52e3ae0a11cd8959204e9b09 (patch) | |
| tree | e33ad4cf90bef3d7da49e57c74aa1272df89f6a9 | |
| parent | 52a85daa1f7e0c00abc95f5380613b5296b50b30 (diff) | |
| download | yaqlite-4ee0b82e55935c3a52e3ae0a11cd8959204e9b09.tar.bz2 | |
sqlite: Remove unused `affinity()` function
Turns out I didn't need this. The `ToSql` and `FromSql` type conversion
traits were what I needed instead to convert between YAML and SQLite
types.
| -rw-r--r-- | src/sqlite.rs | 34 | 
1 files changed, 0 insertions, 34 deletions
| diff --git a/src/sqlite.rs b/src/sqlite.rs index c3d6268..c274b63 100644 --- a/src/sqlite.rs +++ b/src/sqlite.rs @@ -3,40 +3,6 @@ use rusqlite;  use std::collections::HashMap; -// TODO: Delete -/// Get the fundamental SQLite datatype for a given type name. -/// -/// Use the SQLite rules for type affinity described in: -/// https://sqlite.org/datatype3.html#determination_of_column_affinity -pub fn affinity(type_name: &str) -> rusqlite::types::Type { -    use rusqlite::types::Type; - -    let type_name = type_name.to_uppercase(); - -    if type_name.contains("INT") { -        return Type::Integer; -    } else if type_name.contains("CHAR") -        || type_name.contains("CLOB") -        || type_name.contains("TEXT") -    { -        return Type::Text; -    } else if type_name.contains("BLOB") -        || type_name.is_empty() -    { -        return Type::Blob; -    } else if type_name.contains("REAL") -        || type_name.contains("FLOA") -        || type_name.contains("DOUB") -    { -        return Type::Real; -    } - -    // TODO: Numeric affinity - -    Type::Text -} - -  #[derive(Debug)]  pub struct Zero; | 
