-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get all rows from table using sql_orm ? #11
Comments
You have a forall method for this:
see this example:
https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/C%2B%2B/lithium/lithium.cc#L189
Matthieu Garrigues
…On Thu, May 14, 2020 at 7:46 AM aditya ***@***.***> wrote:
How to get all rows from table using sql_orm ? Please guide me here
Thanks,
adibro500
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGOV6AA4VDYXT6LEMTE2HTRROAR7ANCNFSM4NAL27MQ>
.
|
Not working with sql commands.
This example not working. |
Are you using mysql, postgres or sqlite ?
Matthieu Garrigues
…On Thu, May 14, 2020 at 9:34 AM aditya ***@***.***> wrote:
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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGOV6BWKIAVXM3VDUE27A3RRONJXANCNFSM4NAL27MQ>
.
|
using mysql |
Also I am getting CORS error |
the |
Use the prepared statement api for the map method:
I'll add an issue to have the map method on the non prepared mysql queries. |
CORS error mean you use different hostname or port to serve the API.
You should use the same otherwise the browser will block the request.
Matthieu Garrigues
…On Thu, May 14, 2020 at 11:24 AM aditya ***@***.***> wrote:
the Access-Control-Allow-Origin working only in get apis
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Getting this error: |
Sorry I forgot to call the prepared statement, use this instead: |
getting this error :
Can you post the complete expression ? Like what to be passed in map function ? |
can you share the code that generated this error ? |
This code caused the error:
what i am doing wrong ? Please look at my most recent edit |
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...): |
which compiler and compiler version you are using ? |
I am using gcc version 9.3.0 |
I also have gcc 9.3.0, can you share a simple c++ pease of code that would allow me to reproduce the error ? |
|
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. |
Also note that on master the non prepared query API is finished.
|
Did you succeed ? can we close this issue ? |
Yes working |
How to get all rows from table using sql_orm ? Please guide me here
error: 'struct li::mysql_result<li::mysql_functions_blocking>' has no member named 'map' 29 | connection("Select id,time from items_table;").map([&] (std::string id, std::string time) {
Getting the above error
Thanks,
adibro500
The text was updated successfully, but these errors were encountered: