vscode-sqltools icon indicating copy to clipboard operation
vscode-sqltools copied to clipboard

dictGet support for clickhouse code formatter

Open mbtolou opened this issue 2 years ago • 3 comments

hi.

CREATE TABLE ahe.up_daily_data (
	`device_id` String COMMENT 'device_id',
	`clock` DateTime('Asia/Tehran') COMMENT 'clock ',
	`pt_text` Nullable(String) MATERIALIZED dictGet(
		'ahe.tbl_meters_dict',
		'pt_text',
		tuple(device_id)
	)
) ENGINE = AggregatingMergeTree PARTITION BY toYYYYMM(clock)
ORDER BY (clock, device_id) SETTINGS index_granularity = 8192;

above code no format to this :

CREATE TABLE ahe.up_daily_data (
   `device_id` String COMMENT 'device_id',
   `clock` DateTime('Asia/Tehran') COMMENT 'clock ',
   `pt_text` Nullable(String) MATERIALIZED dictGet('ahe.tbl_meters_dict','pt_text',tuple(device_id))
) 
ENGINE = AggregatingMergeTree 
PARTITION BY toYYYYMM(clock)
ORDER BY (clock, device_id) 
SETTINGS index_granularity = 8192;

https://vscode-sqltools.mteixeira.dev/playground/formatter

mbtolou avatar Dec 09 '21 03:12 mbtolou

Is there any movement on this feature?

numfin avatar Feb 05 '24 13:02 numfin

Nothing at the moment, nor any work scheduled on it.

gjsjohnmurray avatar Feb 05 '24 15:02 gjsjohnmurray

@gjsjohnmurray it would be nice to have minimal working formatting. For help there is already cli for it https://clickhouse.com/docs/en/operations/utilities/clickhouse-format But it would be nice to have vscode extension for it

numfin avatar Feb 14 '24 11:02 numfin