Skip to content

mavantgarderc/sqlserverXnvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqlserverXnvim

Neovim‑centric workflow for SQL Server on Linux, built on:

  • sqlserverXlinux – SQL Server engine + tools on Linux
  • vim-dadbod + vim-dadbod-ui – interactive querying and browsing
  • vim-dadbod-completion – SQL IntelliSense for connections
  • Optional SQL LSPs (sqlls, sqls, postgres_lsp) for linting/formatting

This repo provides:

  • Example Neovim config modules under config/
  • Docs under docs/ explaining the architecture and setup
  • Cheatsheets under cheats/ for day‑to‑day usage

Prerequisites

Optional for LSP:

  • sqlls, sqls, postgres_lsp installed via Mason (:Mason)

Quick start

1. Install SQL Server on Linux

Follow:
https://github.com/mavantgarderc/sqlserverXlinux

Make sure:

  • mssql-server service is running
  • sqlcmd works: sqlcmd -S localhost -U SA -C -Q "SELECT @@VERSION;"

2. Add a SQL Server URL to .env

Example .env in your project or Neovim config dir:

DB_MSSQL_LOCAL=sqlserver://sa:YourStrong!Passw0rd@localhost:1433?database=master&encrypt=true&trustServerCertificate=true

The Dadbod config will load .env and can map DB_MSSQL_LOCAL into vim.g.dbs["mssql-local"].

3. Wire Neovim config

Copy config/init.example.lua into your Neovim config (or merge it):

cp config/init.example.lua ~/.config/nvim/init.lua

Ensure lazy.nvim bootstrap is present (see the file).

In your lazy setup, it will import config/lua/plugins/*.lua:

  • sql-dadbod.lua – Dadbod + UI + completion
  • sql-lsp.lua – SQL LSPs (optional)

4. Launch Neovim and use Dadbod

From a project with .env:

nvim

Inside Neovim:

  • Toggle DB UI:

    :DBUI
  • Quick connect:

    <leader>dc
    
  • Run a query in a .sql buffer:

    • Execute current line: <leader>ss or <localleader>r
    • Execute visual selection: <leader>ss (visual) / <localleader>r (visual)
    • Execute whole buffer: <leader>sf or <localleader>R

More details in:

  • docs/01-intro.md
  • docs/03-setup-dadbod-and-env.md
  • cheats/01-dadbod-basics.md

Repo layout

sqlserverXnvim/
├── cheats/        # Quick reference docs
├── config/        # Example Neovim Lua config modules
├── docs/          # Architecture + setup + workflow
├── LICENSE
└── README.md

Related projects

How this fits with other X repos

This repo is designed to be used together with:

  • sqlserverXlinux – install & manage SQL Server on Linux
  • nvimXdotnet – Neovim as a .NET IDE (C# / F# / VB.NET)

Typical flow:

  1. Use sqlserverXlinux to:

    • Install SQL Server on Linux
    • Create the Ecommerce sample database
  2. Use sqlserverXnvim to:

    • Connect to that SQL Server from Neovim (Dadbod)
    • Explore and query the Ecommerce database
  3. Use nvimXdotnet to:

    • Develop application code (C#) against the same database
    • Debug and test .NET services that talk to SQL Server

Tested with

  • Neovim: 0.10.x

  • OS: Arch Linux / Ubuntu 22.04

  • .NET SDK: 8.0.x (see linuxXdotnet)

  • SQL Server: 2022 (see sqlserverXlinux)

  • SQL Server: 2022 (container / native on Linux)

  • Dadbod stack:

    • vim-dadbod
    • vim-dadbod-ui
    • vim-dadbod-completion
    • vim-dotenv

About

A General Guide to Setup & Integrate SqlServer & Nvim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages