SRombauts / SQLiteCpp

SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.
http://srombauts.github.io/SQLiteCpp
MIT License
2.22k stars 510 forks source link

Is math function possible? #467

Closed kim-com closed 5 months ago

kim-com commented 5 months ago

When I execute query that SELECT sin(30), i got the error.

this is my code

SQLite::Database db("monitor.db", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);

    std::string res = db.execAndGet("SELECT sin(30);");
    std::cout << "res : " << res << std::endl;

This is the response.

terminate called after throwing an instance of 'SQLite::Exception'
  what():  no such function: sin
Aborted

sqlite3 version is 3.41.2 on my local pc. and If i use internal sqlite3, sqlite3 version is 3.43.0.

kim-com commented 5 months ago

I got solved.

after removing installed internal-sqlite3 library and header file, CMake can find system sqlite3 on local pc.

I think internal-sqlite3 not include 'sqlite_enable_math_functions'