{"id":15187240,"url":"https://github.com/georgiotunson/ssql","last_synced_at":"2025-10-27T05:30:51.176Z","repository":{"id":48998779,"uuid":"308340171","full_name":"georgiotunson/ssql","owner":"georgiotunson","description":"MySQL CLI that provides a command-line interface for managing your mysql databases","archived":false,"fork":false,"pushed_at":"2021-05-14T07:53:46.000Z","size":16006,"stargazers_count":16,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T02:04:20.556Z","etag":null,"topics":["cli","command-line","command-line-app","command-line-tool","go","golang","mysql","mysql-database","mysql-server","postgres","postgresql","postgresql-database","psql","psql-database"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georgiotunson.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":"2020-10-29T13:40:07.000Z","updated_at":"2024-09-18T14:50:22.000Z","dependencies_parsed_at":"2022-09-07T08:02:28.979Z","dependency_job_id":null,"html_url":"https://github.com/georgiotunson/ssql","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgiotunson%2Fssql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgiotunson%2Fssql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgiotunson%2Fssql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgiotunson%2Fssql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgiotunson","download_url":"https://codeload.github.com/georgiotunson/ssql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238437597,"owners_count":19472441,"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":["cli","command-line","command-line-app","command-line-tool","go","golang","mysql","mysql-database","mysql-server","postgres","postgresql","postgresql-database","psql","psql-database"],"created_at":"2024-09-27T18:05:30.487Z","updated_at":"2025-10-27T05:30:50.577Z","avatar_url":"https://github.com/georgiotunson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simplesql (ssql)\n\n## Demo\n![ssql.gif](https://github.com/georgiotunson/ssql/blob/master/ssql.gif)\n\n----\nSimplesql (ssql) is an open source MySQL CLI that provides a command-line interface for managing\nyour mysql databases. It manages host credentials and option files for your database servers allowing\nyou to execute database statements/queries from the command-line without wrapping your queries in \na connection request to your databases host.\n\nIt is a lightweight and secure way to configure for multiple databases and allows\nyou to manage/access db data from those databases seemlessly using the command-line.  \n\n----\n\n## To start using ssql\n\nFollow the instructions in the below installation and usage sections.\n\n## To start developing ssql\n\nFeel free to submit a pull request or contact me. I would love your help :)\n\n## Installation\n\nAccess the compiled binaries for all supported architectures via this link https://github.com/georgiotunson/ssql/releases/tag/v1.0.0\n\n## Installation Examples: \n### Linux \n#### get the binary\n```\nwget https://github.com/georgiotunson/ssql/releases/download/v1.1.0/ssql_v1.1.0_linux_amd64.zip\n```\n#### install the binary \n```\nunzip ssql_v1.1.0_linux_amd64.zip \u0026\u0026\\\nmv ./linux_amd64/ssql /usr/local/bin \u0026\u0026 rm -rf linux_amd64 ssql_v1.1.0_linux_amd64.zip\n```\n----\n### Mac\n#### get the binary\n```\ncurl -LJO https://github.com/georgiotunson/ssql/releases/download/v1.1.0/ssql_v1.1.0_darwin_amd64.zip\n```\n#### install the binary \n```\nunzip ssql_v1.1.0_darwin_amd64.zip \u0026\u0026\\\nmv ./darwin_amd64/ssql /usr/local/bin \u0026\u0026 rm -rf darwin_amd64 ssql_v1.1.0_darwin_amd64.zip\n```\n\n## Usage\n\n#### Step 1\n\nIn order to use ssql, you must add the database credentials for all\ndb hosts that you plan to use to a file named \".ssql\". This file can either\nbe passed to individual commands by using the --config flag, or you can\nconfigure a default config file by creating a file named .ssql and storing it\nin your $HOME directory($HOME/.ssql). Within the file named .ssql, each\nhost should be configured as follows.\n```\nhost-name:\n  platform: mysql\n  host: localhost\n  port: 3300\n  user: user\n  password: password\n  defaults_file: \"\"\n```\nPlease note that 'host-name' can be whatever you like and it is the name \nthat you will use when using the 'ssql host set' command. \n\nConfiguring multiple hosts would look something like this:\n``` \nmy-mysql-host:\n  platform: mysql\n  host: localhost\n  port: 3300\n  user: user\n  password: password\n  defaults_file: \"\"\n\nhost-name2:\n  platform: mysql\n  host: localhost\n  port: 3300\n  user: user\n  password: password\n  defaults_file: \"\"\n\nhost-name3:\n  platform: mysql\n  host: localhost\n  port: 3300\n  user: user\n  password: password\n  defaults_file: \"\"\n```\n#### IMPORTANT: \nAs you have undoubtedly noticed, the above example stores a plaintext password in a config\nfile and in this case, the application will also use this password on the command line. This\nis insecure for a variety of reasons and is not recommended. This next section will describe \nhow to configure your .ssql file to use option files to access your database servers. \n\n#### Step 1.5 (RECOMMENDED)\nCreate or use an existing option file to store your password/s.\n```\necho \"[client]\npassword=password\" \u003e ~/my.cnf\n```\nTo keep the password safe, the file should not be accessible to anyone but yourself. To ensure this,\nset the file access mode to 400 or 600.\n```\nchmod 600 ~/my.cnf\n```\nNow simply add the full path to the above created file to your .ssql config file for any host that\nyou desire a more secure use of database server credentials for. The .ssql file would look something like\nthis:\n```\nmy-db-host:\n  platform: mysql\n  host: localhost\n  port: 3300\n  user: user\n  password: \"\"\n  defaults_file: \"/home/james/my.cnf\"\n```\nPlease note that the password section is left as an empty string. Even if a password is set in this\nfile for this host, if the path to an option file exists, the password will not be used, even if the\npath to the option file produces an error. \n\nAdditional information about configuring option files can be found here:\nhttps://dev.mysql.com/doc/refman/8.0/en/password-security-user.html\n\n----\n\n#### Quickstart for .ssql config file\n```\necho 'your-host-name1: # \u003c- This should be your desired host name\n  platform: mysql\n  host: # replace this comment with your host\n  port: # replace this comment with your port\n  user: # replace this comment with your user\n  password: # replace this comment with your password\n  defaults_file: \"\" # \u003c- If you use this defaults_file, your password will not be used.\n                    #    Please see README.\n\nyour-host-name2: # \u003c- This should be your desired host name\n  platform: mysql\n  host: # replace this comment with your host\n  port: # replace this comment with your port\n  user: # replace this comment with your user\n  password: # replace this comment with your password\n  defaults_file: \"\" # \u003c- If you use this defaults_file, your password will not be used.\n                    #    Please see README.' \u003e ~/.ssql\n```\n\n----\n\n#### Step 2\nOnce you have installed ssql and configured your desired hosts, using ssql is as simple\nas running the following commands.\n```\nssql host set my-mysql-host\nssql show databases\n```\nIn the above commands you set the current host to one of the hosts from your .ssql file\nand listed the available databases.\n\nYou can now select a database and execute queries.\n``` \nssql use my-database-name\nssql show tables\nssql -h\n```\nPassing the -h flag to ssql will show the following information to help get you started:\n```\nA lightweight command line tool that manages configuration for multiple databases and allows\nyou to manage/access db data from the command line without maintaining a connection to the db\nserver.\n\nUsage:\n  ssql [command]\n\nAvailable Commands:\n  alter       Add, delete, or modify columns in an existing table\n  create      Create new database or table.\n  delete      Delete existing records in a table.\n  describe    Describe is a shortcut for show columns\n  drop        Drop a database or drop a table.\n  help        Help about any command\n  host        Manage host configuration\n  insert      Insert rows into an existing table.\n  select      Select data from tables.\n  show        Show databases or show tables.\n  update      Show databases or show tables.\n  use         Select a db to use for your currently set host\n  version     Print the version number of ssql\n\nFlags:\n      --config string   config file (default is $HOME/.ssql)\n  -h, --help            help for ssql\n\nUse \"ssql [command] --help\" for more information about a command.\n```\n\nYou can pass the -h flag to the individual available commands like below to get \nadditional usage information:\n```\nssql select -h\n```\n```\nThe select command has most of the usual functionality\nprovided by the sql select statement.\n\nUsage:\n  ssql select\n\nExamples:\n# IMPORTANT: Expressions must be wrapped in quotes.\n\nssql select id, name from some_table where \"id \u003e 90000\" and \"id \u003c 95000\"\nssql select \"*\" from some_table where \"id \u003c 10\"\n\n# IMPORTANT: If you need to include a specific name within an expression,\nit should be wrapped in single quotes within the double quotes of the expression\nor vice versa.\n\nssql select \"*\" from some_table where \"some_column = 'some_value'\"\n\nssql select id FROM some_table ORDER BY id DESC\nssql select id, name from some_table left join age using \"(id)\"\n\nFlags:\n  -h, --help   help for select\n\nGlobal Flags:\n      --config string   config file (default is $HOME/.ssql)\n```\n\n## Expressions\nImportant: Expressions must be wrapped in quotes appropriately e.g.\n```\nssql select id, name from some_table where \"id \u003e 90000\" and \"id \u003c 95000\"\nssql select \"*\" from some_table where \"id \u003c 10\"\nssql select \"*\" from some_table where \"some_column = 'some_value'\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiotunson%2Fssql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgiotunson%2Fssql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgiotunson%2Fssql/lists"}