<commit_before>#ifndef SQLITEWRAPPER_BINDER_H
#define SQLITEWRAPPER_BINDER_H

#include <vector>

#include "sqlite3.h"
#include "statement.h"

namespace SqliteWrapper {

// BEGIN SQLite native types

template <>
class Binder<std::int32_t>
{
public:
    static int bind(const Statement &stmt, int pos, const int &value)
    {
        return sqlite3_bind_int(stmt.statementHandle(), pos, value);
    }
};

template <>
class Binder<std::int64_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::int64_t &value)
    {
        return sqlite3_bind_int64(stmt.statementHandle(), pos, value);
    }
};

template <>
class Binder<double>
{
public:
    static int bind(const Statement &stmt, int pos, const double &value)
    {
        return sqlite3_bind_double(stmt.statementHandle(), pos, value);
    }
};

template <>
class Binder<std::string>
{
public:
    static int bind(const Statement &stmt, int pos, const std::string &value)
    {
        return sqlite3_bind_text(stmt.statementHandle(), pos, value.c_str(), value.size(), SQLITE_TRANSIENT);
    }
};

template <>
class Binder<std::vector<unsigned char>>
{
public:
    static int bind(const Statement &stmt, int pos, const std::vector<unsigned char> &value)
    {
        return sqlite3_bind_blob(stmt.statementHandle(), pos, value.data(), value.size(), SQLITE_TRANSIENT);
    }
};

template <>
class Binder<void*, std::size_t>
{
public:
    static int bind(const Statement &stmt, int pos, void* const &value, const std::size_t &size)
    {
        return sqlite3_bind_blob(stmt.statementHandle(), pos, value, size, SQLITE_TRANSIENT);
    }
};

// END SQLite native types

template <>
class Binder<bool>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value ? 1 : 0);
    }
};

template <>
class Binder<std::int8_t>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint8_t>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::int16_t>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint16_t>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint32_t>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint64_t>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int64_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<float>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<double>::bind(stmt, pos, value);
    }
};

}
#endif // SQLITEWRAPPER_BINDER_H<commit_msg>Binder: Fix wrong argument type for non-native ints<commit_after>#ifndef SQLITEWRAPPER_BINDER_H
#define SQLITEWRAPPER_BINDER_H

#include <vector>

#include "sqlite3.h"
#include "statement.h"

namespace SqliteWrapper {

// BEGIN SQLite native types

template <>
class Binder<std::int32_t>
{
public:
    static int bind(const Statement &stmt, int pos, const int &value)
    {
        return sqlite3_bind_int(stmt.statementHandle(), pos, value);
    }
};

template <>
class Binder<std::int64_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::int64_t &value)
    {
        return sqlite3_bind_int64(stmt.statementHandle(), pos, value);
    }
};

template <>
class Binder<double>
{
public:
    static int bind(const Statement &stmt, int pos, const double &value)
    {
        return sqlite3_bind_double(stmt.statementHandle(), pos, value);
    }
};

template <>
class Binder<std::string>
{
public:
    static int bind(const Statement &stmt, int pos, const std::string &value)
    {
        return sqlite3_bind_text(stmt.statementHandle(), pos, value.c_str(), value.size(), SQLITE_TRANSIENT);
    }
};

template <>
class Binder<std::vector<unsigned char>>
{
public:
    static int bind(const Statement &stmt, int pos, const std::vector<unsigned char> &value)
    {
        return sqlite3_bind_blob(stmt.statementHandle(), pos, value.data(), value.size(), SQLITE_TRANSIENT);
    }
};

template <>
class Binder<void*, std::size_t>
{
public:
    static int bind(const Statement &stmt, int pos, void* const &value, const std::size_t &size)
    {
        return sqlite3_bind_blob(stmt.statementHandle(), pos, value, size, SQLITE_TRANSIENT);
    }
};

// END SQLite native types

template <>
class Binder<bool>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value ? 1 : 0);
    }
};

template <>
class Binder<std::int8_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::int8_t &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint8_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::uint8_t &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::int16_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::int16_t &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint16_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::uint16_t &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint32_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::uint32_t &value)
    {
        return Binder<std::int32_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<std::uint64_t>
{
public:
    static int bind(const Statement &stmt, int pos, const std::uint64_t &value)
    {
        return Binder<std::int64_t>::bind(stmt, pos, value);
    }
};

template <>
class Binder<float>
{
public:
    static int bind(const Statement &stmt, int pos, const bool &value)
    {
        return Binder<double>::bind(stmt, pos, value);
    }
};

}
#endif // SQLITEWRAPPER_BINDER_H
{'fraction_non_alphanumeric': 0.13606060606060605, 'fraction_numerical': 0.013939393939393939, 'mean_word_length': 3.8077203204661325, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6588186', 'n_tokens_mistral': 2321, 'n_tokens_neox': 2242, 'n_words': 582}