From d13b4cb5ac87fecb5e59cd935a1666137742c771 Mon Sep 17 00:00:00 2001 From: Anton Bilous Date: Sun, 8 Mar 2026 13:48:28 +0200 Subject: [PATCH] updoot --- .config/fish/conf.d/abbr.fish | 1 + .config/helix/languages.toml | 7 +- .config/pgcli/config | 281 ++++++++++++++++++++++++++++++++++ .gitignore | 4 + 4 files changed, 290 insertions(+), 3 deletions(-) create mode 100644 .config/pgcli/config diff --git a/.config/fish/conf.d/abbr.fish b/.config/fish/conf.d/abbr.fish index eea5fc9..e237008 100644 --- a/.config/fish/conf.d/abbr.fish +++ b/.config/fish/conf.d/abbr.fish @@ -12,6 +12,7 @@ abbr mm -- mpv --profile=music --shuffle \$XDG_MUSIC_DIR abbr soc sea-orm-cli abbr lg lazygit +abbr gd gh dash # abbr dots -- git --git-dir \~/.dotfiles/ --work-tree \~ abbr gl git log abbr ga git add diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml index 117c8db..3b14be8 100644 --- a/.config/helix/languages.toml +++ b/.config/helix/languages.toml @@ -161,14 +161,15 @@ command = "bacon-ls" [language-server.rust-analyzer.config] checkOnSave = true procMacro.enable = true -cargo.features = "all" # for bacon # checkOnSave = { enable = false } # diagnostics = { enable = false } -# [language-server.rust-analyzer.config.cargo] -# loadOutDirsFromCheck = true +[language-server.rust-analyzer.config.cargo] +features = "all" +targetDir = true # runBuildScripts = true +# loadOutDirsFromCheck = true [language-server.rust-analyzer.config.check] features = "all" diff --git a/.config/pgcli/config b/.config/pgcli/config new file mode 100644 index 0000000..a8b25ec --- /dev/null +++ b/.config/pgcli/config @@ -0,0 +1,281 @@ +# vi: ft=dosini +[main] + +# Enables context sensitive auto-completion. If this is disabled, all +# possible completions will be listed. +smart_completion = True + +# Display the completions in several columns. (More completions will be +# visible.) +wider_completion_menu = True + +# Do not create new connections for refreshing completions; Equivalent to +# always running with the --single-connection flag. +always_use_single_connection = False + +# Multi-line mode allows breaking up the sql statements into multiple lines. If +# this is set to True, then the end of the statements must have a semi-colon. +# If this is set to False then sql statements can't be split into multiple +# lines. End of line (return) is considered as the end of the statement. +multi_line = True + +# If multi_line_mode is set to "psql", in multi-line mode, [Enter] will execute +# the current input if the input ends in a semicolon. +# If multi_line_mode is set to "safe", in multi-line mode, [Enter] will always +# insert a newline, and [Esc] [Enter] or [Alt]-[Enter] must be used to execute +# a command. +multi_line_mode = psql + +# Destructive warning will alert you before executing a sql statement +# that may cause harm to the database such as "drop table", "drop database", +# "shutdown", "delete", or "update". +# You can pass a list of destructive commands or leave it empty if you want to skip all warnings. +# "unconditional_update" will warn you of update statements that don't have a where clause +destructive_warning = drop, shutdown, delete, truncate, alter, update, unconditional_update + +# When `destructive_warning` is on and the user declines to proceed with a +# destructive statement, the current transaction (if any) is left untouched, +# by default. When setting `destructive_warning_restarts_connection` to +# "True", the connection to the server is restarted. In that case, the +# transaction (if any) is rolled back. +destructive_warning_restarts_connection = False + +# When this option is on (and if `destructive_warning` is not empty), +# destructive statements are not executed when outside of a transaction. +destructive_statements_require_transaction = True + +# Enables expand mode, which is similar to `\x` in psql. +expand = False + +# Enables auto expand mode, which is similar to `\x auto` in psql. +auto_expand = True + +# Auto-retry queries on connection failures and other operational errors. If +# False, will prompt to rerun the failed query instead of auto-retrying. +auto_retry_closed_connection = True + +# If set to True, table suggestions will include a table alias +generate_aliases = False + +# Path to a json file that specifies specific table aliases to use when generate_aliases is set to True +# the format for this file should be: +# { +# "some_table_name": "desired_alias", +# "some_other_table_name": "another_alias" +# } +alias_map_file = + +# log_file location. +# In Unix/Linux: ~/.config/pgcli/log +# In Windows: %USERPROFILE%\AppData\Local\dbcli\pgcli\log +# %USERPROFILE% is typically C:\Users\{username} +log_file = /tmp/pgcli.log + +# keyword casing preference. Possible values: "lower", "upper", "auto" +keyword_casing = auto + +# casing_file location. +# In Unix/Linux: ~/.config/pgcli/casing +# In Windows: %USERPROFILE%\AppData\Local\dbcli\pgcli\casing +# %USERPROFILE% is typically C:\Users\{username} +casing_file = default + +# If generate_casing_file is set to True and there is no file in the above +# location, one will be generated based on usage in SQL/PLPGSQL functions. +generate_casing_file = False + +# Casing of column headers based on the casing_file described above +case_column_headers = True + +# history_file location. +# In Unix/Linux: ~/.config/pgcli/history +# In Windows: %USERPROFILE%\AppData\Local\dbcli\pgcli\history +# %USERPROFILE% is typically C:\Users\{username} +history_file = default + +# Default log level. Possible values: "CRITICAL", "ERROR", "WARNING", "INFO" +# and "DEBUG". "NONE" disables logging. +log_level = NONE + +# Order of columns when expanding * to column list +# Possible values: "table_order" and "alphabetic" +asterisk_column_order = table_order + +# Whether to qualify with table alias/name when suggesting columns +# Possible values: "always", "never" and "if_more_than_one_table" +qualify_columns = if_more_than_one_table + +# When no schema is entered, only suggest objects in search_path +search_path_filter = False + +# Default pager. See https://www.pgcli.com/pager for more information on settings. +# By default 'PAGER' environment variable is used. If the pager is less, and the 'LESS' +# environment variable is not set, then LESS='-SRXF' will be automatically set. +# pager = less + +# Timing of sql statements and table rendering. +timing = True + +# Show/hide the informational toolbar with function keymap at the footer. +show_bottom_toolbar = True + +# Table format. Possible values: psql, plain, simple, grid, fancy_grid, pipe, +# ascii, double, github, orgtbl, rst, mediawiki, html, latex, latex_booktabs, +# textile, moinmoin, jira, vertical, tsv, csv, sql-insert, sql-update, +# sql-update-1, sql-update-2 (formatter with sql-* prefix can format query +# output to executable insertion or updating sql). +# Recommended: psql, fancy_grid and grid. +table_format = psql + +# Syntax Style. Possible values: manni, igor, xcode, vim, autumn, vs, rrt, +# native, perldoc, borland, tango, emacs, friendly, monokai, paraiso-dark, +# colorful, murphy, bw, pastie, paraiso-light, trac, default, fruity +syntax_style = monokai + +# Keybindings: +# When Vi mode is enabled you can use modal editing features offered by Vi in the REPL. +# When Vi mode is disabled emacs keybindings such as Ctrl-A for home and Ctrl-E +# for end are available in the REPL. +vi = True + +# Error handling +# When one of multiple SQL statements causes an error, choose to either +# continue executing the remaining statements, or stopping +# Possible values "STOP" or "RESUME" +on_error = STOP + +# Set threshold for row limit. Use 0 to disable limiting. +row_limit = 1000 + +# Truncate long text fields to this value for tabular display (does not apply to csv). +# Leave unset to disable truncation. Example: "max_field_width = " +# Be aware that formatting might get slow with values larger than 500 and tables with +# lots of records. +max_field_width = 500 + +# Skip intro on startup and goodbye on exit +less_chatty = True + +# Show all Postgres error fields (as listed in +# https://www.postgresql.org/docs/current/protocol-error-fields.html). +# Can be toggled with \v. +verbose_errors = False + +# Postgres prompt +# \t - Current date and time +# \u - Username +# \h - Short hostname of the server (up to first '.') +# \H - Hostname of the server +# \d - Database name +# \p - Database port +# \i - Postgres PID +# \# - "@" sign if logged in as superuser, '>' in other case +# \n - Newline +# \dsn_alias - name of dsn connection string alias if -D option is used (empty otherwise) +# \x1b[...m - insert ANSI escape sequence +# eg: prompt = '\x1b[35m\u@\x1b[32m\h:\x1b[36m\d>' +# prompt = '\u@\h:\d> ' +prompt = '\d > ' + +# Number of lines to reserve for the suggestion menu +min_num_menu_lines = 6 + +# Character used to left pad multi-line queries to match the prompt size. +multiline_continuation_char = '' + +# The string used in place of a null value. +null_string = '' + +# manage pager on startup +enable_pager = True + +# Use keyring to automatically save and load password in a secure manner +keyring = True + +# Automatically set the session time zone to the local time zone +# If unset, uses the server's time zone, which is the Postgres default +use_local_timezone = False + +# Custom colors for the completion menu, toolbar, etc. +[colors] +completion-menu.completion.current = 'bg:#ffffff #7a7b7d' +completion-menu.completion = 'bg:#2e2e2e #ffffff' +completion-menu.meta.completion.current = 'bg:#44aaaa #000000' +completion-menu.meta.completion = 'bg:#448888 #ffffff' +completion-menu.multi-column-meta = 'bg:#aaffff #000000' +scrollbar.arrow = 'bg:#003333' +scrollbar = 'bg:#00aaaa' +selected = '#ffffff bg:#6666aa' +search = '#ffffff bg:#4444aa' +search.current = '#ffffff bg:#44aa44' +bottom-toolbar = 'bg:#222222 #aaaaaa' +bottom-toolbar.off = 'bg:#222222 #888888' +bottom-toolbar.on = 'bg:#222222 #ffffff' +search-toolbar = 'noinherit bold' +search-toolbar.text = 'nobold' +system-toolbar = 'noinherit bold' +arg-toolbar = 'noinherit bold' +arg-toolbar.text = 'nobold' +bottom-toolbar.transaction.valid = 'bg:#222222 #00ff5f bold' +bottom-toolbar.transaction.failed = 'bg:#222222 #ff005f bold' +# These three values can be used to further refine the syntax highlighting. +# They are commented out by default, since they have priority over the theme set +# with the `syntax_style` setting and overriding its behavior can be confusing. +# literal.string = '#ba2121' +# literal.number = '#666666' +# keyword = 'bold #008000' + +# style classes for colored table output +output.header = "#00ff5f bold" +output.odd-row = "" +output.even-row = "" +output.null = "#808080" + +# Named queries are queries you can execute by name. +[named queries] +ver = "SELECT version()" + +fk = "SELECT tc.table_name AS table, kcu.column_name AS column, ccu.table_name AS foreign_table, ccu.column_name AS foreign_column, rc.delete_rule AS on_delete, rc.update_rule AS on_update FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage ccu ON ccu.constraint_name = tc.constraint_name JOIN information_schema.referential_constraints rc ON rc.constraint_name = tc.constraint_name WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = ANY(string_to_array('$1', ','))" +fkr = "SELECT tc.table_name AS table, kcu.column_name AS column, ccu.table_name AS foreign_table, ccu.column_name AS foreign_column, rc.delete_rule AS on_delete, rc.update_rule AS on_update FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage ccu ON ccu.constraint_name = tc.constraint_name JOIN information_schema.referential_constraints rc ON rc.constraint_name = tc.constraint_name WHERE tc.constraint_type = 'FOREIGN KEY' AND ccu.table_name = ANY(string_to_array('$1', ','))" + +idx = "SELECT indexname, indexdef FROM pg_indexes WHERE tablename = ANY(string_to_array('$1', ',')) ORDER BY tablename, indexname" +checks = "SELECT tc.table_name, tc.constraint_name, cc.check_clause FROM information_schema.table_constraints tc JOIN information_schema.check_constraints cc ON tc.constraint_name = cc.constraint_name WHERE tc.constraint_type = 'CHECK' AND tc.table_name = ANY(string_to_array('$1', ','))" +uniq = "SELECT tc.table_name, kcu.column_name FROM information_schema.table_constraints tc JOIN information_schema.key_column_usage kcu ON tc.constraint_name = kcu.constraint_name WHERE tc.constraint_type = 'UNIQUE' AND tc.table_name = ANY(string_to_array('$1', ','))" + +sizes = "SELECT relname AS table, pg_size_pretty(pg_total_relation_size(relid)) AS total, pg_size_pretty(pg_relation_size(relid)) AS data, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) AS indexes FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC" +enums = "SELECT t.typname AS enum, e.enumlabel AS value FROM pg_type t JOIN pg_enum e ON t.oid = e.enumtypid JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace ORDER BY t.typname, e.enumsortorder" +active = "SELECT pid, age(clock_timestamp(), query_start) AS duration, usename, query FROM pg_stat_activity WHERE query != '' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start DESC" + +# Here's where you can provide a list of connection string aliases. +# You can use it by passing the -D option. `pgcli -D example_dsn` +[alias_dsn] +# example_dsn = postgresql://[user[:password]@][netloc][:port][/dbname] + +# Initial commands to execute when connecting to any database. +[init-commands] +# example = "SET search_path TO myschema" + +# Initial commands to execute when connecting to a DSN alias. +[alias_dsn.init-commands] +# example_dsn = "SET search_path TO otherschema; SET timezone TO 'UTC'" + +# Format for number representation +# for decimal "d" - 12345678, ",d" - 12,345,678 +# for float "g" - 123456.78, ",g" - 123,456.78 +[data_formats] +decimal = "" +float = "" + +# Per column formats for date/timestamp columns +[column_date_formats] +# use strftime format, e.g. +# created = "%Y-%m-%d" + +# Per host ssh tunnel configuration +[ssh tunnels] +# ^example.*\.host$ = myuser:mypasswd@my.tunnel.com:4000 +# .*\.net = another.tunnel.com + +# Per dsn_alias ssh tunnel configuration +[dsn ssh tunnels] +# ^example_dsn$ = myuser:mypasswd@my.tunnel.com:4000 diff --git a/.gitignore b/.gitignore index 0ab5113..dd4804f 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,10 @@ !.config/vale/ !.config/bacon/ +!.config/pgcli/ +.config/pgcli/* +!.config/pgcli/config + !.config/yazi/ .config/yazi/*/