Skip to content

Commit b9ddb6b

Browse files
committed
Original SQL should have string, not string_view return type.
1 parent 3b181fe commit b9ddb6b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

hdr/sqlite_modern_cpp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace sqlite {
4242

4343
void execute();
4444

45-
STR_REF sql() {
45+
std::string sql() {
4646
#if SQLITE_VERSION_NUMBER >= 3014000
4747
auto sqlite_deleter = [](void *ptr) {sqlite3_free(ptr);};
4848
std::unique_ptr<char, decltype(sqlite_deleter)> str(sqlite3_expanded_sql(_stmt.get()), sqlite_deleter);
@@ -52,7 +52,7 @@ namespace sqlite {
5252
#endif
5353
}
5454

55-
STR_REF original_sql() {
55+
std::string original_sql() {
5656
return sqlite3_sql(_stmt.get());
5757
}
5858

hdr/sqlite_modern_cpp/errors.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ namespace sqlite {
99

1010
class sqlite_exception: public std::runtime_error {
1111
public:
12-
sqlite_exception(const char* msg, STR_REF sql, int code = -1): runtime_error(msg), code(code), sql(sql) {}
13-
sqlite_exception(int code, STR_REF sql): runtime_error(sqlite3_errstr(code)), code(code), sql(sql) {}
12+
sqlite_exception(const char* msg, STR_REF sql, int code = -1): runtime_error(msg), code(code), sql(std::move(sql)) {}
13+
sqlite_exception(int code, STR_REF sql): runtime_error(sqlite3_errstr(code)), code(code), sql(std::move(sql)) {}
1414
int get_code() const {return code & 0xFF;}
1515
int get_extended_code() const {return code;}
16-
STR_REF get_sql() const {return sql;}
16+
std::string get_sql() const {return sql;}
1717
private:
1818
int code;
1919
std::string sql;

0 commit comments

Comments
 (0)