Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/trstringer/psql.nvim

Plugin to work with PostgreSQL directly from Neovim
https://github.com/trstringer/psql.nvim

Last synced: 3 days ago
JSON representation

Plugin to work with PostgreSQL directly from Neovim

Awesome Lists containing this project

README

        

# psql.nvim

PostgreSQL plugin for Neovim.

## Installation

To install this with lazy nvim, just add the following to your config:

```lua
require('lazy').setup({
{
"trstringer/psql"
}
})
```

## Usage

Use [psqlcm](github.com/trstringer/psqlcm) to connect to your postgres database. Then run the following commands:

* `:PgRun` (`x`)
* `:PgCancel`
* `:PgTemp` to get a temporary SQL workspace
* `:PgGetTable`
* `:PgGetFunction`
* `:PgGetDatabase`

## Recommended keymaps

```lua
vim.keymap.set(
'n',
'x',
psql.psql_run_curr_buf,
{ desc = 'Execute the current buffer with psql' }
)

vim.keymap.set(
'x',
'x',
'lua require("psql").psql_run_visual()',
{ desc = 'Execute selection with psql' }
)
```