{"id":19337922,"url":"https://github.com/seipan/csql","last_synced_at":"2025-07-17T21:34:49.272Z","repository":{"id":177674508,"uuid":"658929824","full_name":"seipan/csql","owner":"seipan","description":"CLI tool to insert CSV data into a specified database.","archived":false,"fork":false,"pushed_at":"2025-04-16T16:25:50.000Z","size":162,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-18T20:44:28.212Z","etag":null,"topics":["csv","csv-parser","mysql","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seipan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-26T19:42:30.000Z","updated_at":"2025-04-16T09:29:50.000Z","dependencies_parsed_at":"2023-10-26T21:28:11.151Z","dependency_job_id":"f6d44c7d-b4b0-4fd9-868a-31facbc06215","html_url":"https://github.com/seipan/csql","commit_stats":null,"previous_names":["seipan/csql"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seipan%2Fcsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seipan%2Fcsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seipan%2Fcsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seipan%2Fcsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seipan","download_url":"https://codeload.github.com/seipan/csql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250352228,"owners_count":21416459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["csv","csv-parser","mysql","postgresql","sql"],"created_at":"2024-11-10T03:15:48.409Z","updated_at":"2025-04-23T01:31:09.621Z","avatar_url":"https://github.com/seipan.png","language":"Go","readme":"\u003cdiv align=\"center\"\u003e\n\n![Last commit](https://img.shields.io/github/last-commit/seipan/csql?style=flat-square)\n![Repository Stars](https://img.shields.io/github/stars/seipan/csql?style=flat-square)\n![Issues](https://img.shields.io/github/issues/seipan/csql?style=flat-square)\n![Open Issues](https://img.shields.io/github/issues-raw/seipan/csql?style=flat-square)\n[![go](https://github.com/seipan/csql/actions/workflows/go.yml/badge.svg)](https://github.com/seipan/csql/actions/workflows/go.yml)\n![codecov](https://codecov.io/gh/seipan/csql/graph/badge.svg?token=6TCAKD8LY7)\n\n\u003cimg src=\"./logo/csqllogo.png\" alt=\"eyecatch\" height=\"200\"\u003e\n\n# csql\n\n⭐ CLI tool to insert CSV data into a specified database.  ⭐\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n\u003c/div\u003e\n\n## Install\n```\ngo install github.com/seipan/csql@latest\n```\n\n## Usage\ncommand option\n```\nUsage:\n  csql [flags]\n\nFlags:\n  -c, --check         check csv format\n  -d, --dsn string    DSN for Connecting Database\n  -h, --help          help for csql\n  -p, --path string   FilePath for Parsing CSVFile\n  -q, --query         output query\n  -t, --type string   Database Type\n```\nType, DSN, and path can be specified not only from command-line arguments but also from the .csql.yaml file. Below is an example.\n```\ntype: mysql\ndsn: hogehoge\nfilepath: ./test.csv\n```\n### ```--dsn``` \ndsn represents the Data Source Name of the database into which you want to insert CSV data.\n### ```--path``` option\npath represents the file path of the CSV you want to analyze this time.\n### ```--type``` option\ntype represents the type of the database. Currently, it supports mariaDB, mysql, postgres, and sqlite3.\n### ```--check``` option\nif success patern\n```\ncsql --check --path=./testdata/csv/test01.csv --type=mysql --dsn=hogehoge\n\n             ___________ ____    __ \n            / ____/ ___// __ \\  / / \n           / /    \\__ \\/ / / / / /  \n          / /___ ___/ / /_/ / / /___\n          \\____//____/\\___\\_\\/_____/\n                                                                          \n                                                                   \n\ncsv format is correct\n```\nfailed pattern\n```\ncsql --check --path=./testdata/csv/test02.csv --type=mysql --dsn=hogehoge\n\n             ___________ ____    __ \n            / ____/ ___// __ \\  / / \n           / /    \\__ \\/ / / / / /  \n          / /___ ___/ / /_/ / / /___\n          \\____//____/\\___\\_\\/_____/\n                                                                          \n                                                                   \n\ncsv format is incorrect : table name is empty\nexit status 1\n```\n\n### ```--query``` option\n```\n csql --query --path=./testdata/csv/test01.csv --type=mysql --dsn=\"hoge:hoge@tcp(hoge:3306)/hoge?charset=utf8\u0026parseTime=true\"\n\n\n             ___________ ____    __ \n            / ____/ ___// __ \\  / / \n           / /    \\__ \\/ / / / / /  \n          / /___ ___/ / /_/ / / /___\n          \\____//____/\\___\\_\\/_____/\n                                                                          \n                                                                   \n\nINSERT INTO user (name, id, email) VALUES (?, ?, ?)\n```\n### ```insert``` option\n```\ncsql --path=./testdata/csv/test01.csv --type=mysql --dsn=\"hoge:hoge@tcp(localhost:3308)/hoge?parseTime=true\u0026collation=utf8mb4_bin\"\n\n\n             ___________ ____    __ \n            / ____/ ___// __ \\  / / \n           / /    \\__ \\/ / / / / /  \n          / /___ ___/ / /_/ / / /___\n          \\____//____/\\___\\_\\/_____/\n                                                                          \n                                                                   \n\ninsert 2 rows\nInserting: | 100%% \n```\n ## License\nCode licensed under \n[the MIT License](https://github.com/seipan/csql/blob/main/LICENSE).\n\n\n## Author\n[seipan](https://github.com/seipan).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseipan%2Fcsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseipan%2Fcsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseipan%2Fcsql/lists"}