aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/database.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/alpha/database.lua')
-rw-r--r--lua/alpha/database.lua50
1 files changed, 50 insertions, 0 deletions
diff --git a/lua/alpha/database.lua b/lua/alpha/database.lua
new file mode 100644
index 0000000..df1586b
--- /dev/null
+++ b/lua/alpha/database.lua
@@ -0,0 +1,50 @@
+P("loading this")
+vim.g.db_ui_use_nerd_fonts = 1
+vim.g.db_ui_show_database_icon = 1
+vim.g.db_ui_force_echo_notifications = 1
+vim.g.db_ui_win_position = 'right'
+vim.g.db_ui_winwidth = 80
+
+vim.g.db_ui_table_helpers = {
+ mysql = {
+ Count = "select count(1) from {optional_schema}{table}",
+ Explain = "EXPLAIN {last_query}"
+ },
+ sqlite = {
+ Describe = "PRAGMA table_info({table})"
+ }
+}
+
+vim.g.db_ui_icons = {
+ expanded = {
+ db = '▾ ',
+ buffers = '▾ ',
+ saved_queries = '▾ ',
+ schemas = '▾ ',
+ schema = '▾ פּ',
+ tables = '▾ 藺',
+ table = '▾ ',
+ },
+ collapsed = {
+ db = '▸ ',
+ buffers = '▸ ',
+ saved_queries = '▸ ',
+ schemas = '▸ ',
+ schema = '▸ פּ',
+ tables = '▸ 藺',
+ table = '▸ ',
+ },
+ saved_query = '',
+ new_query = '璘',
+ tables = '離',
+ buffers = '﬘',
+ add_connection = '',
+ connection_ok = '✓',
+ connection_error = '✕',
+}
+
+-- opening it in a new tab
+vim.keymap.set('n', '<leader><leader>db', ':tab DBUI<cr>', {})
+
+-- just close the tab, but context related of the keybinding
+vim.keymap.set('n', '<leader><leader>tq', ':tabclose<cr>')