{"action":"created","issue":{"url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7","labels_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7/comments","events_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7/events","html_url":"https://github.com/aminroosta/sqlite_modern_cpp/issues/7","id":66843594,"number":7,"title":"Exceptions","user":{"login":"Killili","id":451325,"avatar_url":"https://avatars.githubusercontent.com/u/451325?v=3","gravatar_id":"","url":"https://api.github.com/users/Killili","html_url":"https://github.com/Killili","followers_url":"https://api.github.com/users/Killili/followers","following_url":"https://api.github.com/users/Killili/following{/other_user}","gists_url":"https://api.github.com/users/Killili/gists{/gist_id}","starred_url":"https://api.github.com/users/Killili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Killili/subscriptions","organizations_url":"https://api.github.com/users/Killili/orgs","repos_url":"https://api.github.com/users/Killili/repos","events_url":"https://api.github.com/users/Killili/events{/privacy}","received_events_url":"https://api.github.com/users/Killili/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-04-07T10:00:53Z","updated_at":"2015-05-19T17:14:46Z","closed_at":null,"body":"Hi,\r\n\r\nnow that we have the stuff from @KnairdA  (thx) i would like to purpose some changes ;) \r\n\r\nFirst i would like to introduce a new exception and then i would like to make it easier to decide if it is a error or a suggestion.\r\n\r\nI have a exception that is thrown in _extract if the query did not return a row but a function was given to handle one. The purpose of this is to make sure that the function was called or that vales are realy assigned to the \"output\" variables.\r\n\r\nBut in other cases it might not be a error that nothing is returned, so i made it a 'sqlite::data_exception' and if its handled properly it can be ignored. I did the same to the \"not all rows handled\" exception.\r\n\r\nDo you think it fits the spirit of this lib?\r\nAnd if so should we convert the std::runtime_error for sql errors to a special exception, too?\r\n"},"comment":{"url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/comments/103598342","html_url":"https://github.com/aminroosta/sqlite_modern_cpp/issues/7#issuecomment-103598342","issue_url":"https://api.github.com/repos/aminroosta/sqlite_modern_cpp/issues/7","id":103598342,"user":{"login":"Killili","id":451325,"avatar_url":"https://avatars.githubusercontent.com/u/451325?v=3","gravatar_id":"","url":"https://api.github.com/users/Killili","html_url":"https://github.com/Killili","followers_url":"https://api.github.com/users/Killili/followers","following_url":"https://api.github.com/users/Killili/following{/other_user}","gists_url":"https://api.github.com/users/Killili/gists{/gist_id}","starred_url":"https://api.github.com/users/Killili/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Killili/subscriptions","organizations_url":"https://api.github.com/users/Killili/orgs","repos_url":"https://api.github.com/users/Killili/repos","events_url":"https://api.github.com/users/Killili/events{/privacy}","received_events_url":"https://api.github.com/users/Killili/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T17:14:46Z","updated_at":"2015-05-19T17:14:46Z","body":"looks like a solution for a different problem, as of now the destructor never throws an exception and we should keep it that way. It sure looks ugly thou. Anyway this would not solve the exception problem if the exception is thrown on the way to the lambda (e.g. operator<< or get_col_from_db) so not a real solution either.\r\n\r\nOn the other hand i made a quick test of the \"options in the stream\" thing you mentioned, it will not solve the exception stuff (does it need fixing?). But its a nice to have for the type expansion i added.\r\nI think i like it even more then the new operator stuff. Its not nice to write now because of all the namespace stuff but i will figure out a better way.\r\n\r\nexample:\r\n```c++\r\nint a,b;\r\ndb << \"insert into test(val,val2) values (?,?)\" << a << sqlite::flag(sqlite::options::throw_on_error) << b;\r\n```\r\nWith an extension:\r\n```c++\r\njson_spirit::mArray a;\r\njson_spirit::mArray b;\r\ndb << \"insert into test(val,val2) values (?,?)\" << a << sqlite::SpiritOption(sqlite::SpiritOptions::do_something_different) << b;\r\n```\r\na will be standard serialized and b will have something different done to it.\r\n\r\n"}}