{"action":"opened","issue":{"url":"https://api.github.com/repos/tgriesser/knex/issues/891","labels_url":"https://api.github.com/repos/tgriesser/knex/issues/891/labels{/name}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/891/comments","events_url":"https://api.github.com/repos/tgriesser/knex/issues/891/events","html_url":"https://github.com/tgriesser/knex/issues/891","id":93498805,"number":891,"title":"SQLite3 select / insert behaving inconsistently","user":{"login":"halfdan","id":176576,"avatar_url":"https://avatars.githubusercontent.com/u/176576?v=3","gravatar_id":"","url":"https://api.github.com/users/halfdan","html_url":"https://github.com/halfdan","followers_url":"https://api.github.com/users/halfdan/followers","following_url":"https://api.github.com/users/halfdan/following{/other_user}","gists_url":"https://api.github.com/users/halfdan/gists{/gist_id}","starred_url":"https://api.github.com/users/halfdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halfdan/subscriptions","organizations_url":"https://api.github.com/users/halfdan/orgs","repos_url":"https://api.github.com/users/halfdan/repos","events_url":"https://api.github.com/users/halfdan/events{/privacy}","received_events_url":"https://api.github.com/users/halfdan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-07T10:27:56Z","updated_at":"2015-07-07T10:27:56Z","closed_at":null,"body":"Not entirely sure whether I'm hitting a race condition here or the SQLite query builder is acting up. \r\n\r\nWhat I'm trying to do:\r\n\r\n- Find an existing event (by start_date)\r\n  - If it exists, update it\r\n  - else insert a new event\r\n\r\nCode to reproduce: https://github.com/halfdan/knex-bug\r\n\r\nThe above code generates a 100 events with the same start_date. What I expect to see is a single INSERT followed by 99 UPDATES. \r\n\r\nOn that note: Is knex going to support upserts (atomic or not) at some point?"}}