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

Better formatting of functions

Open theking2 opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. Functions can be formatted better for better readability

Describe the solution you'd like This code

DROP Function IF EXISTS `last_file_id`;

DELIMITER #
CREATE
/*  DEFINER=`minidwh`@`%` */
FUNCTION `last_file_id`(report_type char(3)) RETURNS int(11)
BEGIN
	return(select max(id) __file_id from file_exist where `type`= report_type);
END#
DELIMITER ;

Is formatted as

DROP Function IF EXISTS `last_file_id`;
DELIMITER #
CREATE
/*  DEFINER=`minidwh`@`%` */
FUNCTION `last_file_id`(report_type char(3)) RETURNS int(11) BEGIN return(
	select max(id) __file_id
	from file_exist
	where `type` = report_type
);
END #
DELIMITER ;

which makes it harder to read.

Describe alternatives you've considered VSCode build SQL formatter does a better job but has other issues

Additional context Add any other context or screenshots about the feature request here.

theking2 avatar Jan 29 '25 08:01 theking2