{"action":"opened","issue":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/2458","repository_url":"https://api.github.com/repos/typeorm/typeorm","labels_url":"https://api.github.com/repos/typeorm/typeorm/issues/2458/labels{/name}","comments_url":"https://api.github.com/repos/typeorm/typeorm/issues/2458/comments","events_url":"https://api.github.com/repos/typeorm/typeorm/issues/2458/events","html_url":"https://github.com/typeorm/typeorm/issues/2458","id":338135027,"node_id":"MDU6SXNzdWUzMzgxMzUwMjc=","number":2458,"title":"Dynamically create tables and queries at runtime?","user":{"login":"SamuelMarks","id":807580,"node_id":"MDQ6VXNlcjgwNzU4MA==","avatar_url":"https://avatars0.githubusercontent.com/u/807580?v=4","gravatar_id":"","url":"https://api.github.com/users/SamuelMarks","html_url":"https://github.com/SamuelMarks","followers_url":"https://api.github.com/users/SamuelMarks/followers","following_url":"https://api.github.com/users/SamuelMarks/following{/other_user}","gists_url":"https://api.github.com/users/SamuelMarks/gists{/gist_id}","starred_url":"https://api.github.com/users/SamuelMarks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamuelMarks/subscriptions","organizations_url":"https://api.github.com/users/SamuelMarks/orgs","repos_url":"https://api.github.com/users/SamuelMarks/repos","events_url":"https://api.github.com/users/SamuelMarks/events{/privacy}","received_events_url":"https://api.github.com/users/SamuelMarks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-04T05:31:05Z","updated_at":"2018-07-04T05:31:05Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Issue type:**\r\n\r\n[x] question\r\n[ ] bug report\r\n[x] feature request\r\n[ ] documentation issue\r\n\r\n**Database system/driver:**\r\n\r\n[ ] `cordova`\r\n[ ] `mongodb`\r\n[ ] `mssql`\r\n[ ] `mysql` / `mariadb`\r\n[ ] `oracle`\r\n[ ] `postgres`\r\n[ ] `sqlite`\r\n[ ] `sqljs`\r\n[ ] `react-native`\r\n\r\n**TypeORM version:**\r\n\r\n[x] `latest`\r\n[x] `@next`\r\n[ ] `0.x.x` (or put your version here)\r\n\r\n**Steps to reproduce or a small repository showing the problem:**\r\nNot sure if this is easily doable, seeing as TypeScript compiles down to JavaScript, but is there a way to create tables at runtime? - And to modify the table name at runtime, without dropping to `.query`?\r\n\r\n**Use case**\r\n_Survey application_.: one Survey will be answered by many users, but created by one. Rather than take [the traditional approach](https://stackoverflow.com/q/1764435); I'm expecting an interface for users to create new tables—inheriting from a base (where PK and FK are set)—would dramatically improve efficiency of: insertion, update, read and aggregate analysis.\r\n\r\n**Implementation**\r\nFrontend(s) will allow user to create surveys. The questions [columns] are specified, and the transmitted to the API in JSON-schema. This JSON-schema is traversed, and used to create the table.\r\n\r\nHopefully this can be done with some TypeORM primitives; otherwise will revert to manually using `.query`.\r\n\r\n---\r\n\r\nWhat do you think?"}}
{"actor":{"display_login":"SamuelMarks"}}