From 8b60aea57aad83d75be329cfdfc440a6b97d52f7 Mon Sep 17 00:00:00 2001 From: arthur Date: Sun, 23 Jun 2024 23:37:46 +0800 Subject: [PATCH] update --- lua/lazyvim/plugins/extras/lang/sql.lua | 37 +++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/sql.lua b/lua/lazyvim/plugins/extras/lang/sql.lua index f0afa2c5..54f641bd 100644 --- a/lua/lazyvim/plugins/extras/lang/sql.lua +++ b/lua/lazyvim/plugins/extras/lang/sql.lua @@ -1,29 +1,32 @@ if lazyvim_docs then -- Automatically configure connections without needing to manually input them each time. - vim.g.dbs = { - dev = "Replace with your database connection URL.", - staging = "Replace with your database connection URL.", - } + -- vim.g.dbs = { + -- dev = "Replace with your database connection URL.", + -- staging = "Replace with your database connection URL.", + -- } -- or - vim.g.dbs = { - { name = "dev", url = "Replace with your database connection URL." }, - { name = "staging", url = "Replace with your database connection URL." }, - } + -- vim.g.dbs = { + -- { name = "dev", url = "Replace with your database connection URL." }, + -- { name = "staging", url = "Replace with your database connection URL." }, + -- } - -- You can set your secrets directly through a Lua table. For example: - -- Create a secrets/db-env.lua file and return the connection table. - -- Or - -- Replace `secrets/db-env` with your own module path. - local ok, dbs = pcall(require, "secrests/db-env") - if ok then - vim.g.dbs = dbs - else + -- You can set your those configuration through a Lua table. For example: + -- Create a `.lazy.lua` file in your project and set your connections in it like this: + -- ```lua + -- vim.g.dbs = {...} + -- + -- return {} + -- ``` + + local ok = pcall(dofile, vim.fn.getcwd() .. "/.lazy.lua") + + if not ok then vim.g.dbs = {} end -- Alternatively, you can also use other ways to inject your environment variables. - -- After all, please make sure to protect your secrets and add them to your `.gitignore` file. + -- After all, please make sure to add `.lazy` to your global `.gitignore` file. end local sql_ft = { "sql", "mysql", "plsql" }