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 · 2 comments
Open

How to setup for sqlite3 #161

raffaem opened this issue Jun 13, 2024 · 2 comments

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

@jgarte
Copy link

jgarte commented Oct 18, 2024

This doesn't work for me and I have:

lowercaseKeywords: false
connections:
  - alias: toys
    driver: sqlite3
    dataSourceName: file:/home/jgart/.cache/guix/toys/db.sqlite

The server just dies with the following:


Saving file /home/jgart/.config/sqls/config.yml...
Wrote /home/jgart/.config/sqls/config.yml
(No changes need to be saved)
[jsonrpc] Server exited with status 1
eglot--error: [eglot] -1: Server died
Quit
Mark set
next-line: End of buffer [3 times]
next-line: End of buffer

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

3 participants