dbeaver / dbeaver

Free universal database tool and SQL client
https://dbeaver.io
Apache License 2.0
40.4k stars 3.48k forks source link

Fix bug and enhance feature to expand symbol * using Ctrl + Space #34417

Open ask9 opened 4 months ago

ask9 commented 4 months ago

Description

This issue consists of three parts linked together:

  1. Not all available columns are added when expanding symbol * using Ctrl + Space for queries with joins.
  2. there are no aliases for expanded columns in resulted query text
  3. formatting of the resulting query should take into account some option in settings (if it is true then each new column should be presented on a new line, otherwise - in one line)

DBeaver Version

Community Edition 24.1.0

Operating System

Windows 10

Database and driver

PostgreSQL 16 PostgreSQL JDBC Driver 42.7.2

Steps to reproduce

  1. Use this code: SELECT * FROM pg_class as c JOIN pg_attribute as a ON a.attrelid = c.oid JOIN pg_type as t ON t.oid = a.atttypid;

  2. set input pointer after symbol * and press Ctrl + Space

Expected:

  1. all columns from three tables are added
  2. aliases should be presented for each column to distinguish in code which table the column related to (for example: c.relname, ... a.attname, ...)
  3. if some setting in options is set to true, then all columns are placed on the same line, otherwise - each column - on a new line
  4. See below the desired behaviour released in DbForge

Actual:

  1. only columns from first table are added
  2. there is no alias before each column name (relname, ... attname ...)
  3. all columns are always placed on the same line

Additional context

Desired behaviour:

0000002682

E1izabeth commented 4 months ago

Thank you for bug report.