Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to setup for sqlite3 #161

Open
raffaem opened this issue Jun 13, 2024 · 1 comment
Open

How to setup for sqlite3 #161

raffaem opened this issue Jun 13, 2024 · 1 comment

Comments

@raffaem
Copy link

raffaem commented Jun 13, 2024

I'm not sure how to setup for neovim and sqlite3.

I have initialized it like:

lspconfig.sqls.setup {
    on_attach = function(client, bufnr)
    require('sqls').on_attach(client, bufnr) -- require sqls.nvim
  end,
  settings = {
    sqls = {
      connections = {
        {
          driver = 'sqlite3',
          dataSourceName = '/path/to/my/db.sqlite3',
        },
      },
    },
  },
  capabilities = capabilities }

which seems not optimal as I have to change that option everytime I change db I work on.

In any case it doesn't work.

It shows a notification "no database connection".

How to set it up properly for neovim and sqlite3?

Can we add a Discussion section to this repo?

@jamietanna
Copy link

I believe that you need to have a ~/.config/sqls/config.yml set, i.e.:

lowercaseKeywords: false
connections:
  - alias: DMD
    driver: sqlite3
    dataSourceName: file:/home/jamie/dmd.db

You can specify multiple connections, then use :SqlsSwitchConnection to swap between the defined databases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants