{"action":"created","issue":{"url":"https://api.github.com/repos/diesel-rs/diesel/issues/420","repository_url":"https://api.github.com/repos/diesel-rs/diesel","labels_url":"https://api.github.com/repos/diesel-rs/diesel/issues/420/labels{/name}","comments_url":"https://api.github.com/repos/diesel-rs/diesel/issues/420/comments","events_url":"https://api.github.com/repos/diesel-rs/diesel/issues/420/events","html_url":"https://github.com/diesel-rs/diesel/issues/420","id":173603429,"number":420,"title":"command to populate db with test data in diesel-cli","user":{"login":"azerupi","id":7647338,"avatar_url":"https://avatars.githubusercontent.com/u/7647338?v=3","gravatar_id":"","url":"https://api.github.com/users/azerupi","html_url":"https://github.com/azerupi","followers_url":"https://api.github.com/users/azerupi/followers","following_url":"https://api.github.com/users/azerupi/following{/other_user}","gists_url":"https://api.github.com/users/azerupi/gists{/gist_id}","starred_url":"https://api.github.com/users/azerupi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azerupi/subscriptions","organizations_url":"https://api.github.com/users/azerupi/orgs","repos_url":"https://api.github.com/users/azerupi/repos","events_url":"https://api.github.com/users/azerupi/events{/privacy}","received_events_url":"https://api.github.com/users/azerupi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-27T16:21:53Z","updated_at":"2016-12-22T21:14:29Z","closed_at":null,"body":"It's often useful to fill the database with some test data while you are developing. Could the cli make this easier? I don't work often with databases, so I don't know how it is done normally. But if the cli could make this an easy process that would be great!\n\nIt could be as easy as `diesel fill test-data.sql`. Or more elaborate by for example have a folder with csv files for each table.\n"},"comment":{"url":"https://api.github.com/repos/diesel-rs/diesel/issues/comments/268891882","html_url":"https://github.com/diesel-rs/diesel/issues/420#issuecomment-268891882","issue_url":"https://api.github.com/repos/diesel-rs/diesel/issues/420","id":268891882,"user":{"login":"theduke","id":241621,"avatar_url":"https://avatars.githubusercontent.com/u/241621?v=3","gravatar_id":"","url":"https://api.github.com/users/theduke","html_url":"https://github.com/theduke","followers_url":"https://api.github.com/users/theduke/followers","following_url":"https://api.github.com/users/theduke/following{/other_user}","gists_url":"https://api.github.com/users/theduke/gists{/gist_id}","starred_url":"https://api.github.com/users/theduke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theduke/subscriptions","organizations_url":"https://api.github.com/users/theduke/orgs","repos_url":"https://api.github.com/users/theduke/repos","events_url":"https://api.github.com/users/theduke/events{/privacy}","received_events_url":"https://api.github.com/users/theduke/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T21:14:29Z","updated_at":"2016-12-22T21:14:29Z","body":"A lot of other ORM CLIs have  `dump` and `load` commands to export and import data.\r\n\r\nUsually supporting CSV and JSON as formats.\r\n\r\nIt's a *very* nice feature to have during development.\r\nIt's significantly more convenient to create test data via your web interface and then dump it, allowing other developers to just load it up on their own setup.\r\n\r\n```bash\r\ndiesel dump -f json --all --out-dir=./data\r\ndiesel database reset\r\ndiesel load data\r\n```\r\nWhen dumping all tables, a file for each table would be created.\r\n\r\nThe load command must figure out a foreign key dependency graph to load the tables in a correct order."}}
{"actor":{"display_login":"theduke"}}