Comments (7)
Hi,
Why not, but presently I am using it as in the example, with only implicit type cast operator, like that:
std::string value = query.getColumn(1);
Cheers!
from sqlitecpp.
Hi SRombauts,
code in style std::string value = query.getColumn(1);
did works,
and int id = 0; id = query.getColumn(1);
works too,
while code below doesn't:
std::string value = ""; value = query.getColumn(1);
Compiler(clang)'s issue is Use of overloaded operator '=' is ambiguous (with operand types 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') and 'SQLite::Column')
I am trying to solve it, and I found something help in link: http://www.cplusplus.com/forum/general/28152/
from sqlitecpp.
And you add method inline operator const std::string() const
to fix an error required by GCC. I have no idea how to solve it now.
from sqlitecpp.
Also with gcc and libstdc++ the following code fails as ambigous:
int64_t id = query.getColumn(1);
Because libstdc++ uses longs for fixed width types, whereas sqlite uses long longs.
from sqlitecpp.
Thanks for reporting, I'll look into this.
During this time, you could use the explicit forms like this:
std::string value;
value = query.getColumn(1).getText()
and
int64_t id = query.getColumn(0).getInt64();
Let me now if this suits you.
Or perhaps could you propose a new API?
from sqlitecpp.
I have reproduced your issues and will try to work on this in the following days, but I have not much spare times for this.
from sqlitecpp.
PB with 64bits long fixed for upcoming release 1.0.0
from sqlitecpp.
Related Issues (20)
- query.bind ???
- getFilename() -Error HOT 9
- Problem with link SqliteCpp with my lib HOT 2
- First time build fails on Windows with MSVC due to carriage return characters HOT 2
- Private members to Protected to enable inheritance
- loop inert and delete, the Active(file) of memory will Abnormal increase
- MinGW cannot find library HOT 2
- Build Error HOT 2
- MSVC: Unresolved symbol SQLite::assertion_failed for example1
- On ORIN: Example1 run error.
- cannot bind to long long (64 bit signed integer)? HOT 4
- it can be shared library? HOT 2
- Issue regarding the overloading of SQLite::Statement::bind
- If the provided filename contains directories or path segments, the database will not be created. HOT 1
- can we add bindBlob(int, const std::string &)? HOT 1
- Is math function possible? HOT 1
- Adding std::optional to bind
- When will the .db-journal file be generated when I don't have any operational database in my project? HOT 1
- LNK2001: unresolved external symbol "SQLite::OPEN_READONLY" HOT 3
- cmake build warning: `cmake --help-policy CMP0148` HOT 1
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 sqlitecpp.