{"action":"created","issue":{"url":"https://api.github.com/repos/fukamachi/integral/issues/34","labels_url":"https://api.github.com/repos/fukamachi/integral/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/fukamachi/integral/issues/34/comments","events_url":"https://api.github.com/repos/fukamachi/integral/issues/34/events","html_url":"https://github.com/fukamachi/integral/issues/34","id":58641751,"number":34,"title":"Auto generated primary key in sqlite3 not working","user":{"login":"lucashpandolfo","id":591607,"avatar_url":"https://avatars.githubusercontent.com/u/591607?v=3","gravatar_id":"","url":"https://api.github.com/users/lucashpandolfo","html_url":"https://github.com/lucashpandolfo","followers_url":"https://api.github.com/users/lucashpandolfo/followers","following_url":"https://api.github.com/users/lucashpandolfo/following{/other_user}","gists_url":"https://api.github.com/users/lucashpandolfo/gists{/gist_id}","starred_url":"https://api.github.com/users/lucashpandolfo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucashpandolfo/subscriptions","organizations_url":"https://api.github.com/users/lucashpandolfo/orgs","repos_url":"https://api.github.com/users/lucashpandolfo/repos","events_url":"https://api.github.com/users/lucashpandolfo/events{/privacy}","received_events_url":"https://api.github.com/users/lucashpandolfo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-23T20:17:38Z","updated_at":"2015-02-23T20:27:43Z","closed_at":null,"body":"```common-lisp\r\n(defclass tweet ()\r\n  ((status :type text\r\n           :initarg :status\r\n           :accessor tweet-status)\r\n   (user :type (varchar 32)\r\n         :initarg :user\r\n         :accessor tweet-user))\r\n  (:metaclass integral:<dao-table-class>))\r\n\r\n(integral:connect-toplevel :sqlite3\r\n                           :database-name \"/tmp/mydb.db\")\r\n\r\n(integral:ensure-table-exists 'tweet)\r\n\r\nDB Error: near \"UNSIGNED\": syntax error (Code: ERROR)\r\n   [Condition of type DBI.ERROR:<DBI-PROGRAMMING-ERROR>]\r\n```\r\n\r\nThe generated query is \r\n\r\nCREATE TABLE IF NOT EXISTS \"tweet\" (\"%oid\" BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY, \"status\" TEXT, \"user\" VARCHAR(32))\r\n\r\nBoth \"BIGINT(20)\" and \"BIGINT UNSIGNED\" works, but \"BIGINT(20) UNSIGNED\" not.\r\n\r\nIn MySQL the table is created, but object saving is not working due to #33 (field names are not escaped either):\r\n\"SELECT %oid AS last_insert_id FROM tweet ORDER BY %oid DESC LIMIT 1\"\r\n\r\nDB Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%oid AS last_insert_id FROM tweet ORDER BY %oid DESC LIMIT 1' at line 1 (Code: 1064)\r\n   [Condition of type DBI.ERROR:<DBI-PROGRAMMING-ERROR>]"},"comment":{"url":"https://api.github.com/repos/fukamachi/integral/issues/comments/75624792","html_url":"https://github.com/fukamachi/integral/issues/34#issuecomment-75624792","issue_url":"https://api.github.com/repos/fukamachi/integral/issues/34","id":75624792,"user":{"login":"lucashpandolfo","id":591607,"avatar_url":"https://avatars.githubusercontent.com/u/591607?v=3","gravatar_id":"","url":"https://api.github.com/users/lucashpandolfo","html_url":"https://github.com/lucashpandolfo","followers_url":"https://api.github.com/users/lucashpandolfo/followers","following_url":"https://api.github.com/users/lucashpandolfo/following{/other_user}","gists_url":"https://api.github.com/users/lucashpandolfo/gists{/gist_id}","starred_url":"https://api.github.com/users/lucashpandolfo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucashpandolfo/subscriptions","organizations_url":"https://api.github.com/users/lucashpandolfo/orgs","repos_url":"https://api.github.com/users/lucashpandolfo/repos","events_url":"https://api.github.com/users/lucashpandolfo/events{/privacy}","received_events_url":"https://api.github.com/users/lucashpandolfo/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T20:27:43Z","updated_at":"2015-02-23T20:27:43Z","body":"Also, according to https://www.sqlite.org/lang_createtable.html, UNSIGNED BIGINT(20) should work.\r\n![types scheme](https://www.sqlite.org/images/syntax/type-name.gif)"}}