matt-42 / lithium

Easy to use C++17 HTTP Server with no compromise on performances. https://matt-42.github.io/lithium
https://matt-42.github.io/lithium
MIT License
1.26k stars 91 forks source link

Pgsql doesn't seem to compile with ToT anymore #114

Open oxcug opened 2 years ago

oxcug commented 2 years ago

Hey @matt-42 ! I just pulled from ToT and looks like there are some pgsql specific compiler errors when I import #include <lithium_pgsql.hh>. Any chance we could get a fix for this?

Screen Shot 2022-06-09 at 08 11 06
matt-42 commented 2 years ago

Hi @oxcug Could you post the line that is triggering this error ? Seems like you are passing a type to lithium pgsql that is not supported but I'm not sure about it.

oxcug commented 2 years ago

Sorry about the delay, the error came from a lack of support for uint64_t from the read_optional template function in the sql headers. e.g:

    auto stmt = conn.prepare("SELECT some, foo FROM things WHERE foo=?");
    const auto an_optional = stmt(thing).read_optional<uint64_t /* <- looks like this is unsupported */, std::string>();
    if (an_optional.has_value()) {

Looks like it's just a "you're holding it wrong" kind of problem but would be nice to have more type support. Changing the type to int fixed my issue.