{"id":17693525,"url":"https://github.com/amboxer21/insertable","last_synced_at":"2026-05-06T04:32:06.639Z","repository":{"id":49208382,"uuid":"379427686","full_name":"amboxer21/Insertable","owner":"amboxer21","description":"Convert a select query into an insertable mysql command.","archived":false,"fork":false,"pushed_at":"2021-06-23T19:03:36.000Z","size":38,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T01:09:49.368Z","etag":null,"topics":["linux","mysql","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amboxer21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-22T23:45:00.000Z","updated_at":"2021-06-23T19:03:39.000Z","dependencies_parsed_at":"2022-09-15T15:10:54.890Z","dependency_job_id":null,"html_url":"https://github.com/amboxer21/Insertable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amboxer21/Insertable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amboxer21%2FInsertable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amboxer21%2FInsertable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amboxer21%2FInsertable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amboxer21%2FInsertable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amboxer21","download_url":"https://codeload.github.com/amboxer21/Insertable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amboxer21%2FInsertable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32678595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","mysql","ruby"],"created_at":"2024-10-24T13:45:17.052Z","updated_at":"2026-05-06T04:32:06.621Z","avatar_url":"https://github.com/amboxer21.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Insertable\nConvert a MySQL select query into a chain of insertable mysql commands. This is my version of the mysqldump `--where` command line argument.\n\n---\n\nTake the output of the program and put it into a file like so\n\n```javascript\nmysql -f -uusername -p'password' database \u003c\u003c EOF\n  program output goes here\nEOF\n```\n\n**Example query:**\n```javascript\nINSERTABLE_ENV=production ruby Insertable.rb -q\"select * from cars where created_at \u003e '2021-04-06 00:00:00' and created_at \u003c '2021-04-06 23:59:59' and make = 'nissan' order by id desc limit 2\" -tcars --fields id,model --without-id\n```\n\n**Example:**\n\u003e **-f** is for force. Remove this if you're absolutely not sure that this is what you want!\n```javascript\nmysql -f -uusername -p'password' database \u003c\u003c EOF\n  insert into cars (created_at,make, model) values ('nissan', 'rogue', '2021-04-06 11:46:28');\n  insert into cars (created_at,make, model) values ('nissan', 'Murano', '2021-04-06 11:54:12');\nEOF\n```\n\nThen execute that file containing your insertables with:\n```javascript\nchmod +x file\n./file\n```\n\n**Usage:**\n```javascript\n    Usage example: ruby Insertable.rb -q'select * from cdrs limit 10' -tcars --fields make, model --without-id\n\n    [ Option with * is mandatory! ]\n\n      Option:\n        --help,            Display this help messgage.\n    * Option:\n        --table,       -t, The name of the table that you are querying.\n    * Option:\n        --mysql-query, -q, MySQL query for the program to parse without ; or G terminator.\n      Option:\n        --without-id,      Remove the id field name and the id from the printed insertable.\n    * Option:\n        --fields f1,f2     This is the first and last field of the specified table that you are querying.     \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famboxer21%2Finsertable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famboxer21%2Finsertable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famboxer21%2Finsertable/lists"}