Closed swex closed 5 years ago
Hi there, I just discovered that custom types broken in dev. It looks like problem in
template<class T> typename std::enable_if<!is_base_of_template<T, compound_operator>::value, std::string>::type string_from_expression(const T &t, bool /*noTableName*/, bool escape, bool ignoreBindable = false) {
it gives strange condition for strings like:
SELECT 'superheros'.\"id\", 'superheros'.\"name\", 'superheros'.\"gender\" FROM 'superheros' WHERE ( 'superheros'.\"gender\" = '? ')
not those quotes around ? and space after ?
?
template <> struct statement_binder<Gender> { int bind(sqlite3_stmt* stmt, int index, const Gender& value) { return statement_binder<std::string>().bind(stmt, index, GenderToString(value)); // or return sqlite3_bind_text(stmt, index++, GenderToString(value).c_str(), -1, SQLITE_TRANSIENT); } };
Also above bind is called, but sqlite3_bind error silently ignored by sqlite_orm.
Fix is almost ready https://github.com/fnc12/sqlite_orm/pull/316
Merged fix in dev branch. Please check it
dev
Yep it fixed now, thanks
Hi there, I just discovered that custom types broken in dev. It looks like problem in
it gives strange condition for strings like:
not those quotes around
?
and space after?
Also above bind is called, but sqlite3_bind error silently ignored by sqlite_orm.