Comments (22)
from lithium.
Not working with sql commands.
con("select name, age from users;").map([] (std::string name, int age) { std::cout << name << ":" << age << std::endl; });
This example not working.
from lithium.
from lithium.
using mysql
from lithium.
Also I am getting CORS error
from lithium.
the Access-Control-Allow-Origin
working only in get apis
from lithium.
Use the prepared statement api for the map method:
connection.prepare("Select id,time from items_table;").map([...])
I'll add an issue to have the map method on the non prepared mysql queries.
from lithium.
from lithium.
Getting this error:
error: 'struct li::mysql_statement<li::mysql_functions_blocking>' has no member named 'map'
from lithium.
Sorry I forgot to call the prepared statement, use this instead:
connection.prepare("Select id,time from items_table;")().map([...])
from lithium.
getting this error :
/usr/local/include/c++/9.3.0/tuple:1277:29: error: incomplete type 'std::tuple_size<main()::<lambda(li::http_request&, li::http_response&)>::<lambda(std::string&, std::string&, std::string, std::string&, std::string&)> >' used in nested name specifier 1277 | inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value; | ^~~~~~~~~~~~
Can you post the complete expression ? Like what to be passed in map function ?
from lithium.
can you share the code that generated this error ?
from lithium.
This code caused the error:
db.connect().prepare("Select id,post from post_items;")().map([&](std::string id, std::string post) {
});
what i am doing wrong ?
Please look at my most recent edit
from lithium.
Do you still have this compilation error ? I've added a test and it seems to compile and work fine on my computer. (But it fails on travis, still have to find why...):
https://github.com/matt-42/lithium/blob/master/libraries/sql/tests/mysql.cc#L53
from lithium.
which compiler and compiler version you are using ?
from lithium.
I am using gcc version 9.3.0
from lithium.
I also have gcc 9.3.0, can you share a simple c++ pease of code that would allow me to reproduce the error ?
from lithium.
db.connect().prepare("Select id,post from post_items;")().map([&](std::string id, std::string post) {
});
from lithium.
this code is right, the error must come from somewhere else. If you want me to help more please share a c++ file that I can compile myself.
from lithium.
Also note that on master the non prepared query API is finished.
You can now use:
db.connect()("Select id,post from post_items;").map([&](std::string id, std::string post) {
});
from lithium.
Did you succeed ? can we close this issue ?
from lithium.
Yes working
from lithium.
Related Issues (20)
- Bad link in docs HOT 1
- Is it possible to compile on Windows 10 x64 with Ming64 GCC 11.2?
- Non-portable `sendfile` used breaking compilation on macOS HOT 1
- Event loop not ending for thread HOT 2
- Can't run Lithium locally HOT 2
- Pgsql doesn't seem to compile with ToT anymore HOT 2
- MariaDB issue - Unable to build locally (in Docker) HOT 2
- HTTP/2 Support for Lithium? HOT 1
- Can this project support TLS? HOT 1
- Performance issues
- Hitting the hardcoded out buffer size
- There is a high-severity CVE lurking HOT 7
- Building problems HOT 2
- POST and GET on the same route
- CMake + git submodule
- Memory leak in json_parser/make_json_error
- drt_node not delete HOT 2
- Cannot connect to the postgresql server X.X.X.X: could not send SSL negotiation packet HOT 1
- Try to compile with li command, do not work. HOT 3
- Adding subapi deletes home page route. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lithium.