{"action":"created","issue":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/1414","repository_url":"https://api.github.com/repos/typeorm/typeorm","labels_url":"https://api.github.com/repos/typeorm/typeorm/issues/1414/labels{/name}","comments_url":"https://api.github.com/repos/typeorm/typeorm/issues/1414/comments","events_url":"https://api.github.com/repos/typeorm/typeorm/issues/1414/events","html_url":"https://github.com/typeorm/typeorm/issues/1414","id":286477321,"number":1414,"title":"Support enum for DB who don't support it","user":{"login":"antoine-pous","id":7486600,"avatar_url":"https://avatars3.githubusercontent.com/u/7486600?v=4","gravatar_id":"","url":"https://api.github.com/users/antoine-pous","html_url":"https://github.com/antoine-pous","followers_url":"https://api.github.com/users/antoine-pous/followers","following_url":"https://api.github.com/users/antoine-pous/following{/other_user}","gists_url":"https://api.github.com/users/antoine-pous/gists{/gist_id}","starred_url":"https://api.github.com/users/antoine-pous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoine-pous/subscriptions","organizations_url":"https://api.github.com/users/antoine-pous/orgs","repos_url":"https://api.github.com/users/antoine-pous/repos","events_url":"https://api.github.com/users/antoine-pous/events{/privacy}","received_events_url":"https://api.github.com/users/antoine-pous/received_events","type":"User","site_admin":false},"labels":[{"id":628502779,"url":"https://api.github.com/repos/typeorm/typeorm/labels/comp:%20schema%20sync","name":"comp: schema sync","color":"1d76db","default":false},{"id":364554717,"url":"https://api.github.com/repos/typeorm/typeorm/labels/new%20feature","name":"new feature","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-01-06T11:07:43Z","updated_at":"2018-02-15T07:47:59Z","closed_at":null,"author_association":"NONE","body":"Currently SQLite doesn't have `ENUM` type, but TypeORM can use it's own validator before inserting a value into the DB and emit an error when the value is not in the enum.\r\n\r\n```typescript\r\nenum MyEnum { \r\n    zero = 0; \r\n    one = 1;\r\n}\r\n\r\n@Entity()\r\nexport class Test {\r\n    @Column({enum: MyEnum})\r\n    myVar: number; // Must be 0 or 1\r\n}\r\n```\r\n  "},"comment":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/comments/365848757","html_url":"https://github.com/typeorm/typeorm/issues/1414#issuecomment-365848757","issue_url":"https://api.github.com/repos/typeorm/typeorm/issues/1414","id":365848757,"user":{"login":"mhombach","id":34406120,"avatar_url":"https://avatars0.githubusercontent.com/u/34406120?v=4","gravatar_id":"","url":"https://api.github.com/users/mhombach","html_url":"https://github.com/mhombach","followers_url":"https://api.github.com/users/mhombach/followers","following_url":"https://api.github.com/users/mhombach/following{/other_user}","gists_url":"https://api.github.com/users/mhombach/gists{/gist_id}","starred_url":"https://api.github.com/users/mhombach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhombach/subscriptions","organizations_url":"https://api.github.com/users/mhombach/orgs","repos_url":"https://api.github.com/users/mhombach/repos","events_url":"https://api.github.com/users/mhombach/events{/privacy}","received_events_url":"https://api.github.com/users/mhombach/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T07:47:59Z","updated_at":"2018-02-15T07:47:59Z","author_association":"NONE","body":"I'm a big fan of making ORM-Systems really universal or at least as much universal as it can get.\r\nIf i create my business-logic within it and i later need to change the database-engine, then there should not be a bunch of stuff i need to change. Sure, i can then optimize everything for the new engine, but it should \"work\" flawless without changing much stuff...\r\nSo i would vote for implementing this as universal type into the ORM and when a database doenst support that column-type, then internally it should just get converted to a string or an integer, which represents that ENUM values. And sure, then it should be validated exactly to match the declared ENUM-Object."}}
{"actor":{"display_login":"mhombach"}}