<commit_before>import SQLite

/**
    SQLite-specific overrides for the GeneralSQLSerializer
  */
public class SQLiteSerializer: GeneralSQLSerializer {
    /**
        Serializes a SQLite data type.
      */
    public override func sql(_ type: Schema.Field.DataType, primaryKey: Bool) -> String {
        // SQLite has a design where any data type that does not contain `TEXT`,
        // `CLOB`, or `CHAR` will be treated with `NUMERIC` affinity.
        // All SQLite `STRING` fields should instead be declared with `TEXT`.
        // More information: https://www.sqlite.org/datatype3.html
        if case .string(_)  = type {
            return "TEXT"
        }

        return super.sql(type, primaryKey: primaryKey)
    }
}<commit_msg>full sqlite type conversion<commit_after>import SQLite

/// SQLite-specific overrides for the GeneralSQLSerializer
public class SQLiteSerializer: GeneralSQLSerializer {
    /// Serializes a SQLite data type.
    public override func sql(_ type: Schema.Field.DataType, primaryKey: Bool) -> String {
        // SQLite has a design where any data type that does not contain `TEXT`,
        // `CLOB`, or `CHAR` will be treated with `NUMERIC` affinity.
        // All SQLite `STRING` fields should instead be declared with `TEXT`.
        // More information: https://www.sqlite.org/datatype3.html
        switch type {
        case .bool:
            return "INTEGER"
        case .bytes:
            return "BLOB"
        case .date:
            return "TEXT"
        case .double:
            return "REAL"
        case .id(let idType):
            let string: String
            switch idType {
            case .int:
                string = "INTEGER"
            case .uuid:
                string = "TEXT"
            case .custom(let custom):
                string = custom
            }
            if primaryKey {
                return "\(string) PRIMARY KEY"
            } else {
                return string
            }
        case .int:
            return "INTEGER"
        case .string:
            return "TEXT"
        case .custom(let type):
            return type
        }
    }
}
{'fraction_non_alphanumeric': 0.08955223880597014, 'fraction_numerical': 0.0009328358208955224, 'mean_word_length': 1.6913425345043915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4616528', 'n_tokens_mistral': 562, 'n_tokens_neox': 550, 'n_words': 194}