{"action":"opened","issue":{"url":"https://api.github.com/repos/splay-project/splay/issues/47","labels_url":"https://api.github.com/repos/splay-project/splay/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/splay-project/splay/issues/47/comments","events_url":"https://api.github.com/repos/splay-project/splay/issues/47/events","html_url":"https://github.com/splay-project/splay/issues/47","id":87005890,"number":47,"title":"support SQLITE3 init_db uses AUTO_INCREMENT","user":{"login":"vschiavoni","id":119208,"avatar_url":"https://avatars.githubusercontent.com/u/119208?v=3","gravatar_id":"","url":"https://api.github.com/users/vschiavoni","html_url":"https://github.com/vschiavoni","followers_url":"https://api.github.com/users/vschiavoni/followers","following_url":"https://api.github.com/users/vschiavoni/following{/other_user}","gists_url":"https://api.github.com/users/vschiavoni/gists{/gist_id}","starred_url":"https://api.github.com/users/vschiavoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vschiavoni/subscriptions","organizations_url":"https://api.github.com/users/vschiavoni/orgs","repos_url":"https://api.github.com/users/vschiavoni/repos","events_url":"https://api.github.com/users/vschiavoni/events{/privacy}","received_events_url":"https://api.github.com/users/vschiavoni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/splay-project/splay/labels/controller","name":"controller","color":"009800"},{"url":"https://api.github.com/repos/splay-project/splay/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-10T15:22:04Z","updated_at":"2015-06-10T15:22:04Z","closed_at":null,"body":"Currently the schema definitions of the splay controller tables use AUTO_INCREMENT, which is not supported by SQLITE3[https://www.sqlite.org/autoinc.html].\r\n\r\nThe port to Sequel planned in #46 allow easy switching from one dbms to another, as well as to get away from such SQL-related issues.\r\n\r\nCurrently, using SQLITE3 produces:\r\n\r\n```ruby\r\nruby -rubygems test_init_db.rb\r\nRun options: --seed 52356\r\n\r\n# Running:\r\n\r\nE\r\n\r\nFinished in 0.015659s, 63.8610 runs/s, 63.8610 assertions/s.\r\n\r\n  1) Error:\r\nTestInitDb#test_drop:\r\nSequel::DatabaseError: SQLite3::SQLException: near \"AUTO_INCREMENT\": syntax error\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `new'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `prepare'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:223:in `execute_batch'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/adapters/sqlite.rb:190:in `block (2 levels) in _execute'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/database/logging.rb:33:in `log_yield'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/adapters/sqlite.rb:190:in `block in _execute'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/database/connecting.rb:250:in `block in synchronize'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/connection_pool/threaded.rb:99:in `hold'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/database/connecting.rb:250:in `synchronize'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/adapters/sqlite.rb:178:in `_execute'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/adapters/sqlite.rb:133:in `execute_dui'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/database/query.rb:43:in `execute_ddl'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/adapters/sqlite.rb:143:in `block in execute_ddl'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/database/connecting.rb:250:in `block in synchronize'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/connection_pool/threaded.rb:103:in `hold'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/database/connecting.rb:250:in `synchronize'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/adapters/sqlite.rb:140:in `execute_ddl'\r\n    /Users/veleno/.rvm/gems/ruby-2.0.0-p645/gems/sequel-4.23.0/lib/sequel/database/query.rb:76:in `run'\r\n    /Users/veleno/workspace-git/splay/src/controller/init_db.rb:47:in `init_db'\r\n    test_init_db.rb:18:in `test_drop'\r\n\r\n1 runs, 1 assertions, 0 failures, 1 errors, 0 skips\r\n```\r\n\r\nCheck if we really need AUTO_INCREMENT."}}