{"action":"created","issue":{"url":"https://api.github.com/repos/square/sqldelight/issues/247","repository_url":"https://api.github.com/repos/square/sqldelight","labels_url":"https://api.github.com/repos/square/sqldelight/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/square/sqldelight/issues/247/comments","events_url":"https://api.github.com/repos/square/sqldelight/issues/247/events","html_url":"https://github.com/square/sqldelight/issues/247","id":150025984,"number":247,"title":"ColumnAdapter duplicates","user":{"login":"PaulWoitaschek","id":743462,"avatar_url":"https://avatars.githubusercontent.com/u/743462?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulWoitaschek","html_url":"https://github.com/PaulWoitaschek","followers_url":"https://api.github.com/users/PaulWoitaschek/followers","following_url":"https://api.github.com/users/PaulWoitaschek/following{/other_user}","gists_url":"https://api.github.com/users/PaulWoitaschek/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulWoitaschek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulWoitaschek/subscriptions","organizations_url":"https://api.github.com/users/PaulWoitaschek/orgs","repos_url":"https://api.github.com/users/PaulWoitaschek/repos","events_url":"https://api.github.com/users/PaulWoitaschek/events{/privacy}","received_events_url":"https://api.github.com/users/PaulWoitaschek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-21T09:58:22Z","updated_at":"2016-04-21T13:45:20Z","closed_at":null,"body":"When defining a table that needs multiple column adapters like\r\n\r\n```sqlite\r\nCREATE TABLE show_details (\r\n  _id LONG NOT NULL PRIMARY KEY AUTOINCREMENT,\r\n  downloadedAt CLASS('org.threeten.bp.LocalDateTime') NOT NULL,\r\n  startTime CLASS('org.threeten.bp.LocalDateTime') NOT NULL\r\n);\r\n```\r\n\r\nThe Mapper requires adding the same column adapter mulitple times:\r\n\r\n```java\r\nprotected Mapper(Creator<T> creator, ColumnAdapter<LocalDateTime> downloadedAtAdapter, ColumnAdapter<LocalDateTime> startTimeAdapter) {\r\n```\r\n\r\nI expected it to detect the class and require the column adapter only once."},"comment":{"url":"https://api.github.com/repos/square/sqldelight/issues/comments/212925777","html_url":"https://github.com/square/sqldelight/issues/247#issuecomment-212925777","issue_url":"https://api.github.com/repos/square/sqldelight/issues/247","id":212925777,"user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T13:45:20Z","updated_at":"2016-04-21T13:45:20Z","body":"We currently do this because while the class is the same the mapping may\nnot be. For example, one may store a Date in two ways (yyyy-mm-dd and ISO\n8601) in two columns of the same table.\n\nSince these don't change much, I personally don't think the repeated nature\nwhen columns are the same is a big deal. Do you agree? Do you have tables\nthat have large numbers of the same classes using the same adapter or is it\njust cases of two?\n\nOn Thu, Apr 21, 2016, 5:58 AM Paul Woitaschek <notifications@github.com>\nwrote:\n\n> When defining a table that needs column adapters like\n>\n> CREATE TABLE show_details (\n>   _id LONG NOT NULL PRIMARY KEY AUTOINCREMENT,\n>   downloadedAt CLASS('org.threeten.bp.LocalDateTime') NOT NULL,\n>   startTime CLASS('org.threeten.bp.LocalDateTime') NOT NULL\n> );\n>\n> The Mapper requires adding the same column adapter mulitple times:\n>\n> protected Mapper(Creator<T> creator, ColumnAdapter<LocalDateTime> downloadedAtAdapter, ColumnAdapter<LocalDateTime> startTimeAdapter) {\n>\n> I expected it to detect the class and require the column adapter only once.\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly or view it on GitHub\n> <https://github.com/square/sqldelight/issues/247>\n>\n"}}