{"id":17760515,"url":"https://github.com/fuco1/sql-workbench","last_synced_at":"2025-09-27T17:30:28.320Z","repository":{"id":136710259,"uuid":"39452109","full_name":"Fuco1/sql-workbench","owner":"Fuco1","description":"SQL client for Emacs","archived":false,"fork":false,"pushed_at":"2022-02-03T15:33:58.000Z","size":519,"stargazers_count":14,"open_issues_count":14,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-11T08:05:21.853Z","etag":null,"topics":["database","emacs","mysql","sql"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fuco1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":["Fuco1"],"patreon":"matusgoljer","ko_fi":"matusgoljer","custom":"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=A5PMGVKCQBT88"}},"created_at":"2015-07-21T14:59:42.000Z","updated_at":"2024-12-03T16:43:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"10aa5eb5-d549-455c-b37f-d43d5b19cb76","html_url":"https://github.com/Fuco1/sql-workbench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fsql-workbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fsql-workbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fsql-workbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fuco1%2Fsql-workbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fuco1","download_url":"https://codeload.github.com/Fuco1/sql-workbench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234448332,"owners_count":18834213,"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":["database","emacs","mysql","sql"],"created_at":"2024-10-26T19:02:23.794Z","updated_at":"2025-09-27T17:30:27.994Z","avatar_url":"https://github.com/Fuco1.png","language":"Emacs Lisp","funding_links":["https://github.com/sponsors/Fuco1","https://patreon.com/matusgoljer","https://ko-fi.com/matusgoljer","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=A5PMGVKCQBT88"],"categories":[],"sub_categories":[],"readme":"# sql-workbench\n\nWorking with SQL the convenient way!\n\n# Using sql-workbench\n\nCurrently supported engines are MySQL and MSSQL (work in progress).\nThe available features (non-exhaustive list):\n\n| Feature                        | MySQL | MSSQL |\n|--------------------------------|-------|-------|\n| Send queries                   | ✓     | ✓     |\n| Get column types and metadata  | ✓     | ✓     |\n| Company-based autocompletion   | ✓     | ✓     |\n| Quick data preview             | ✓     | ❌    |\n| Describe table                 | ✓     | ✓    |\n| Show number of rows in a table | ✓     | ❌    |\n| Query for list of all tables   | ✓     | ✓     |\n| Copy data from result buffer   | ✓     | ✓     |\n\n## Connecting to a server\n\nRun `M-x swb-new-workbench`. It will prompt for `engine` `host`,\n`port`, `user`, `password`, and the database name to use.\n\nThe workbench buffer will open.\n\n## Using the workbench buffer\n\nThe workbench (source) buffer is the sql-workbench's main interface to\nthe database. Here are some things you can do with it.\n\n* `swb-send-current-query` (`C-c C-c`) takes the sql statement at\n  point and runs it on the database. The results will be displayed in\n  the `*swb-results*` buffer.  With `C-u` the result will be shown in\n  a new permanent buffer, meaning it will not replace its content\n  after a new query is run.  With `C-0` the results will be inserted\n  in-line into the source buffer.  With `C-1` (experimental) a\n  time-series graph will be inserted into the source buffer.  This\n  feature requires a working R installation with several packages, see\n  the `swb-send-current-query` function help for info.\n\n* `swb-describe-table` (`C-c C-t`) prompts for a table name, and\n  displays the table schema in the `*swb-results*` buffer.\n\n* `swb-show-data-in-table` (`C-c C-d`) prompts for a table name, and\n  displays the first 500 entries in that table.\n\nBecause the workbench buffer is just a regular buffer you can do all\nthe usual things with it including saving it to a file and then\nreopening it later.  It is also autosaved and backed up (if this is\nenabled) so you don't have to worry about losing your work.\n\nYou can store the current connection information (except password)\nusing `swb-store-connection-to-file` (`C-c C-s`). The information will\nbe appended as [file-local\nvariables](https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html).\nNext time you open the file these will automatically become\nbuffer-local.  If you then execute a statement sql-workbench will\nautomatically reconnect using the stored connection information.  This\nmakes resuming work between sessions super easy.\n\nIf you customize the variable `swb-crypt-key` to be an email\nassociated with a gpg key, the password will be also stored as\nencrypted base64-encoded string with this key set as recipient.\n\n## Using the results buffer\n\nThe results buffer uses `swb-result-mode` which is derived from\n`org-mode` and contains an Org Mode table.  All the features of Org\nMode (tables) therefore work automatically in the results buffer as\nwell.  However, the button is made read-only to prevent accidental\nchange of the data.  Consequently, some commands work without the `C-`\nor `C-c` prefixes for increased convenience.\n\nUse `f`, `b`, `n`, `p` (or arrow keys) for navigation, `j` to jump to\na specific column.\n\nUse `s` to sort rows.  The sorting happens \"offline\" in the result\nbuffer only, not by querying the database server.\n\n`+` and `%` produce the sum or the average of the column or a region.\n\n`c` and `r` allow you to copy the column or row(s) in various formats,\nsuch as csv, php array, R tibble or SQL values.\n\n`g` will revert the buffer by running the same query again.\n\nFor more information run `C-h m` in the result buffer and see the list\nof key bindings.\n\n# Integration with other packages\n\n## company\n\nThere is an experimental [company](http://company-mode.github.io/) backend `company-swb`.  To enable it run\n\n    (push 'company-swb company-backends)\n\nand then enable `M-x company-mode` in the swb buffer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuco1%2Fsql-workbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuco1%2Fsql-workbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuco1%2Fsql-workbench/lists"}