{"id":24598551,"url":"https://github.com/mattiasmts/cmp-dbee","last_synced_at":"2025-04-13T08:33:26.428Z","repository":{"id":215988589,"uuid":"739907166","full_name":"MattiasMTS/cmp-dbee","owner":"MattiasMTS","description":"Autocompletion for nvim-dbee","archived":false,"fork":false,"pushed_at":"2025-02-22T14:56:35.000Z","size":77,"stargazers_count":63,"open_issues_count":2,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T00:12:22.280Z","etag":null,"topics":["autocompletion","database","nvim","nvim-cmp"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/MattiasMTS.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":"2024-01-06T22:43:59.000Z","updated_at":"2025-02-13T03:10:40.000Z","dependencies_parsed_at":"2024-02-03T13:32:21.759Z","dependency_job_id":"84c7394b-99aa-44c9-9561-b5d5236f3be0","html_url":"https://github.com/MattiasMTS/cmp-dbee","commit_stats":null,"previous_names":["mattiasmts/cmp-dbee"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiasMTS%2Fcmp-dbee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiasMTS%2Fcmp-dbee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiasMTS%2Fcmp-dbee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattiasMTS%2Fcmp-dbee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattiasMTS","download_url":"https://codeload.github.com/MattiasMTS/cmp-dbee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248684351,"owners_count":21145061,"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":["autocompletion","database","nvim","nvim-cmp"],"created_at":"2025-01-24T12:17:03.635Z","updated_at":"2025-04-13T08:33:26.399Z","avatar_url":"https://github.com/MattiasMTS.png","language":"Lua","readme":"# cmp-dbee\n\n[![ci](https://github.com/MattiasMTS/cmp-dbee/actions/workflows/ci.yml/badge.svg)](https://github.com/MattiasMTS/cmp-dbee/actions/workflows/ci.yml)\n\n\u003c!--toc:start--\u003e\n\n- [cmp-dbee](#cmp-dbee)\n  - [Showcase](#showcase)\n  - [Usage](#usage)\n    - [Suggestions](#suggestions)\n  - [Installation](#installation)\n  \u003c!--toc:end--\u003e\n\nAutocompletion plugin for [nvim-dbee](https://github.com/kndndrj/nvim-dbee/) database client.\n\n\u003e Still very much a WIP plugin =\u003e expect some breaking changes.\n\nFeel free to open any issues or PRs as you seem fit!\n\n## Showcase\n\nhttps://github.com/MattiasMTS/cmp-dbee/assets/86059470/1a0141dd-cb4d-47ce-b510-148d654d9503\n\n## Usage\n\ncmp-dbee is using a little bit of regex but mostly Treesitter to generate\nsuggestions.\n\n### Suggestions\n\nTL;DR\n\n- schemas\n- leaf of schemas (tables, views, functions, etc)\n- aliases\n- CTEs\n- columns: name and dtype (by referencing aliases)\n\nBy default, schema + model suggestion is generated whenever a user hits \"space\".\nAt this point, the syntax for the SQL query isn't complete and the plugin\ntherefore uses a little bit of regex to \"find/match\" the selected schema.\n\nOnes the schemas has been found, the plugin suggests all the \"leafs\"\nfor the schema.\n\nCTEs and aliases are suggested based on the cursor position. I.e. if you've\ntwo _complete_ (complete = ended with ';') queries in the buffer. Then, only\nthe aliases and ctes which the current cursor are nearest will be suggested.\n\nColumn suggestion is provided by being explicit. I.e. you'd have to refer the\nalias of a table if you want column completion. This is to reduce ambiguity\nwhen there are other suggestions that compete. Column completion provide you\nwith the current name and the datatype of the column. As of now, only table\nleafs provides columns. This might change in the future.\n\n## Installation\n\n- Using **lazy**:\n\n```lua\n  {\n    \"hrsh7th/nvim-cmp\",\n    dependencies = {\n      {\n        \"MattiasMTS/cmp-dbee\",\n        dependencies = {\n          {\"kndndrj/nvim-dbee\"}\n        },\n        ft = \"sql\", -- optional but good to have\n        opts = {}, -- needed\n      },\n    },\n    opts = {\n      sources = {\n        { \"cmp-dbee\" },\n      },\n    },\n  }\n```\n\n- Using **packer**:\n\n```lua\n   use({\"hrsh7th/nvim-cmp\", requires = {\"MattiasMTS/cmp-dbee\"}})\n   use{\n     \"kndndrj/nvim-dbee\",\n      run = function()\n        require(\"dbee\").install()\n      end,\n   }\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiasmts%2Fcmp-dbee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattiasmts%2Fcmp-dbee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiasmts%2Fcmp-dbee/lists"}