|
| 1 | +{ lib, ... }: |
| 2 | +{ |
| 3 | + empty = { |
| 4 | + plugins.dbee.enable = true; |
| 5 | + }; |
| 6 | + |
| 7 | + defaults = { |
| 8 | + plugins.dbee = { |
| 9 | + enable = true; |
| 10 | + settings = { |
| 11 | + default_connection = null; |
| 12 | + sources = [ |
| 13 | + (lib.nixvim.mkRaw "require('dbee.sources').EnvSource:new('DBEE_CONNECTIONS')") |
| 14 | + (lib.nixvim.mkRaw "require('dbee.sources').FileSource:new(vim.fn.stdpath('state') .. '/dbee/persistence.json')") |
| 15 | + ]; |
| 16 | + extra_helpers = { }; |
| 17 | + float_options = { }; |
| 18 | + drawer = { |
| 19 | + window_options = { }; |
| 20 | + buffer_options = { }; |
| 21 | + disable_help = false; |
| 22 | + mappings = [ |
| 23 | + { |
| 24 | + key = "r"; |
| 25 | + mode = "n"; |
| 26 | + action = "refresh"; |
| 27 | + } |
| 28 | + { |
| 29 | + key = "<CR>"; |
| 30 | + mode = "n"; |
| 31 | + action = "action_1"; |
| 32 | + } |
| 33 | + { |
| 34 | + key = "cw"; |
| 35 | + mode = "n"; |
| 36 | + action = "action_2"; |
| 37 | + } |
| 38 | + { |
| 39 | + key = "dd"; |
| 40 | + mode = "n"; |
| 41 | + action = "action_3"; |
| 42 | + } |
| 43 | + { |
| 44 | + key = "o"; |
| 45 | + mode = "n"; |
| 46 | + action = "toggle"; |
| 47 | + } |
| 48 | + { |
| 49 | + key = "<CR>"; |
| 50 | + mode = "n"; |
| 51 | + action = "menu_confirm"; |
| 52 | + } |
| 53 | + { |
| 54 | + key = "y"; |
| 55 | + mode = "n"; |
| 56 | + action = "menu_yank"; |
| 57 | + } |
| 58 | + { |
| 59 | + key = "<Esc>"; |
| 60 | + mode = "n"; |
| 61 | + action = "menu_close"; |
| 62 | + } |
| 63 | + { |
| 64 | + key = "q"; |
| 65 | + mode = "n"; |
| 66 | + action = "menu_close"; |
| 67 | + } |
| 68 | + ]; |
| 69 | + disable_candies = false; |
| 70 | + candies = { |
| 71 | + history = { |
| 72 | + icon = ""; |
| 73 | + icon_highlight = "Constant"; |
| 74 | + text_highlight = ""; |
| 75 | + }; |
| 76 | + note = { |
| 77 | + icon = ""; |
| 78 | + icon_highlight = "Character"; |
| 79 | + text_highlight = ""; |
| 80 | + }; |
| 81 | + connection = { |
| 82 | + icon = ""; |
| 83 | + icon_highlight = "SpecialChar"; |
| 84 | + text_highlight = ""; |
| 85 | + }; |
| 86 | + database_switch = { |
| 87 | + icon = ""; |
| 88 | + icon_highlight = "Character"; |
| 89 | + text_highlight = ""; |
| 90 | + }; |
| 91 | + schema = { |
| 92 | + icon = ""; |
| 93 | + icon_highlight = "Removed"; |
| 94 | + text_highlight = ""; |
| 95 | + }; |
| 96 | + table = { |
| 97 | + icon = ""; |
| 98 | + icon_highlight = "Conditional"; |
| 99 | + text_highlight = ""; |
| 100 | + }; |
| 101 | + streaming_table = { |
| 102 | + icon = ""; |
| 103 | + icon_highlight = "Conditional"; |
| 104 | + text_highlight = ""; |
| 105 | + }; |
| 106 | + managed = { |
| 107 | + icon = ""; |
| 108 | + icon_highlight = "Conditional"; |
| 109 | + text_highlight = ""; |
| 110 | + }; |
| 111 | + view = { |
| 112 | + icon = ""; |
| 113 | + icon_highlight = "Debug"; |
| 114 | + text_highlight = ""; |
| 115 | + }; |
| 116 | + materialized_view = { |
| 117 | + icon = ""; |
| 118 | + icon_highlight = "Type"; |
| 119 | + text_highlight = ""; |
| 120 | + }; |
| 121 | + sink = { |
| 122 | + icon = ""; |
| 123 | + icon_highlight = "String"; |
| 124 | + text_highlight = ""; |
| 125 | + }; |
| 126 | + column = { |
| 127 | + icon = ""; |
| 128 | + icon_highlight = "WarningMsg"; |
| 129 | + text_highlight = ""; |
| 130 | + }; |
| 131 | + add = { |
| 132 | + icon = ""; |
| 133 | + icon_highlight = "String"; |
| 134 | + text_highlight = "String"; |
| 135 | + }; |
| 136 | + edit = { |
| 137 | + icon = ""; |
| 138 | + icon_highlight = "Directory"; |
| 139 | + text_highlight = "Directory"; |
| 140 | + }; |
| 141 | + remove = { |
| 142 | + icon = ""; |
| 143 | + icon_highlight = "SpellBad"; |
| 144 | + text_highlight = "SpellBad"; |
| 145 | + }; |
| 146 | + help = { |
| 147 | + icon = ""; |
| 148 | + icon_highlight = "Title"; |
| 149 | + text_highlight = "Title"; |
| 150 | + }; |
| 151 | + source = { |
| 152 | + icon = ""; |
| 153 | + icon_highlight = "MoreMsg"; |
| 154 | + text_highlight = "MoreMsg"; |
| 155 | + }; |
| 156 | + none = { |
| 157 | + icon = " "; |
| 158 | + icon_highlight = ""; |
| 159 | + text_highlight = ""; |
| 160 | + }; |
| 161 | + none_dir = { |
| 162 | + icon = ""; |
| 163 | + icon_highlight = "NonText"; |
| 164 | + text_highlight = ""; |
| 165 | + }; |
| 166 | + node_expanded = { |
| 167 | + icon = ""; |
| 168 | + icon_highlight = "NonText"; |
| 169 | + text_highlight = ""; |
| 170 | + }; |
| 171 | + node_closed = { |
| 172 | + icon = ""; |
| 173 | + icon_highlight = "NonText"; |
| 174 | + text_highlight = ""; |
| 175 | + }; |
| 176 | + }; |
| 177 | + }; |
| 178 | + result = { |
| 179 | + window_options = { }; |
| 180 | + buffer_options = { }; |
| 181 | + page_size = 100; |
| 182 | + focus_result = true; |
| 183 | + progress = { |
| 184 | + spinner = [ |
| 185 | + "⠋" |
| 186 | + "⠙" |
| 187 | + "⠹" |
| 188 | + "⠸" |
| 189 | + "⠼" |
| 190 | + "⠴" |
| 191 | + "⠦" |
| 192 | + "⠧" |
| 193 | + "⠇" |
| 194 | + "⠏" |
| 195 | + ]; |
| 196 | + text_prefix = "Executing..."; |
| 197 | + }; |
| 198 | + mappings = [ |
| 199 | + { |
| 200 | + key = "L"; |
| 201 | + mode = ""; |
| 202 | + action = "page_next"; |
| 203 | + } |
| 204 | + { |
| 205 | + key = "H"; |
| 206 | + mode = ""; |
| 207 | + action = "page_prev"; |
| 208 | + } |
| 209 | + { |
| 210 | + key = "E"; |
| 211 | + mode = ""; |
| 212 | + action = "page_last"; |
| 213 | + } |
| 214 | + { |
| 215 | + key = "F"; |
| 216 | + mode = ""; |
| 217 | + action = "page_first"; |
| 218 | + } |
| 219 | + { |
| 220 | + key = "yaj"; |
| 221 | + mode = "n"; |
| 222 | + action = "yank_current_json"; |
| 223 | + } |
| 224 | + { |
| 225 | + key = "yaj"; |
| 226 | + mode = "v"; |
| 227 | + action = "yank_selection_json"; |
| 228 | + } |
| 229 | + { |
| 230 | + key = "yaJ"; |
| 231 | + mode = ""; |
| 232 | + action = "yank_all_json"; |
| 233 | + } |
| 234 | + { |
| 235 | + key = "yac"; |
| 236 | + mode = "n"; |
| 237 | + action = "yank_current_csv"; |
| 238 | + } |
| 239 | + { |
| 240 | + key = "yac"; |
| 241 | + mode = "v"; |
| 242 | + action = "yank_selection_csv"; |
| 243 | + } |
| 244 | + { |
| 245 | + key = "yaC"; |
| 246 | + mode = ""; |
| 247 | + action = "yank_all_csv"; |
| 248 | + } |
| 249 | + { |
| 250 | + key = "<C-c>"; |
| 251 | + mode = ""; |
| 252 | + action = "cancel_call"; |
| 253 | + } |
| 254 | + ]; |
| 255 | + }; |
| 256 | + editor = { |
| 257 | + window_options = { }; |
| 258 | + buffer_options = { }; |
| 259 | + mappings = [ |
| 260 | + { |
| 261 | + key = "BB"; |
| 262 | + mode = "v"; |
| 263 | + action = "run_selection"; |
| 264 | + } |
| 265 | + { |
| 266 | + key = "BB"; |
| 267 | + mode = "n"; |
| 268 | + action = "run_file"; |
| 269 | + } |
| 270 | + ]; |
| 271 | + }; |
| 272 | + call_log = { |
| 273 | + window_options = { }; |
| 274 | + buffer_options = { }; |
| 275 | + mappings = [ |
| 276 | + { |
| 277 | + key = "<CR>"; |
| 278 | + mode = ""; |
| 279 | + action = "show_result"; |
| 280 | + } |
| 281 | + { |
| 282 | + key = "<C-c>"; |
| 283 | + mode = ""; |
| 284 | + action = "cancel_call"; |
| 285 | + } |
| 286 | + ]; |
| 287 | + disable_candies = false; |
| 288 | + candies = { |
| 289 | + unknown = { |
| 290 | + icon = ""; |
| 291 | + icon_highlight = "NonText"; |
| 292 | + text_highlight = ""; |
| 293 | + }; |
| 294 | + executing = { |
| 295 | + icon = ""; |
| 296 | + icon_highlight = "Constant"; |
| 297 | + text_highlight = "Constant"; |
| 298 | + }; |
| 299 | + executing_failed = { |
| 300 | + icon = ""; |
| 301 | + icon_highlight = "Error"; |
| 302 | + text_highlight = ""; |
| 303 | + }; |
| 304 | + retrieving = { |
| 305 | + icon = ""; |
| 306 | + icon_highlight = "String"; |
| 307 | + text_highlight = "String"; |
| 308 | + }; |
| 309 | + retrieving_failed = { |
| 310 | + icon = ""; |
| 311 | + icon_highlight = "Error"; |
| 312 | + text_highlight = ""; |
| 313 | + }; |
| 314 | + archived = { |
| 315 | + icon = ""; |
| 316 | + icon_highlight = "Title"; |
| 317 | + text_highlight = ""; |
| 318 | + }; |
| 319 | + archive_failed = { |
| 320 | + icon = ""; |
| 321 | + icon_highlight = "Error"; |
| 322 | + text_highlight = ""; |
| 323 | + }; |
| 324 | + canceled = { |
| 325 | + icon = ""; |
| 326 | + icon_highlight = "Error"; |
| 327 | + text_highlight = ""; |
| 328 | + }; |
| 329 | + }; |
| 330 | + }; |
| 331 | + |
| 332 | + window_layout = lib.nixvim.mkRaw "require('dbee.layouts').Default:new()"; |
| 333 | + }; |
| 334 | + }; |
| 335 | + }; |
| 336 | +} |
0 commit comments