Skip to content
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

Support for long and long long missing? #104

Closed
firesurfer opened this issue Apr 5, 2017 · 1 comment
Closed

Support for long and long long missing? #104

firesurfer opened this issue Apr 5, 2017 · 1 comment

Comments

@firesurfer
Copy link

Hi,
according to the documentation in your examples this library should support long and long long as types:

// inserts a new user record.
		// binds the fields to '?' .
		// note that only types allowed for bindings are :
		//      int ,long, long long, float, double
		//      string , u16string
		// sqlite3 only supports utf8 and utf16 strings, you should use std::string for utf8 and std::u16string for utf16.
		// note that u"my text" is a utf16 string literal of type char16_t * .
		db << "insert into user (age,name,weight) values (?,?,?);"
			<< 20
			<< u"bob"
			<< 83.25;

But when I'm trying use it with a long value I get this error:

 error: undefined reference to 'sqlite::database_binder& sqlite::operator<< <long>(sqlite::database_binder&, long const&)'

Casting the value to an int before using it in the statement makes it work.
When I took a look at the sqlite_modern_cpp.h file I can't find a fitting function for long values.

So is the documentation wrong or am I just to stupid to use it with a long?

@aminroosta
Copy link
Collaborator

@firesurfer We are supporting int and sqlite3_int64 which is defined by sqlite.

On my machine long long works but long gives an error.
Thanks for opening an issue, i will look into it.

zauguin added a commit to zauguin/sqlite_modern_cpp that referenced this issue Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants