Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better formatting of functions #1432

Open
theking2 opened this issue Jan 29, 2025 · 0 comments
Open

Better formatting of functions #1432

theking2 opened this issue Jan 29, 2025 · 0 comments
Labels
feature request New issue opened using "Feature request" template

Comments

@theking2
Copy link

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 theking2 added the feature request New issue opened using "Feature request" template label Jan 29, 2025
@theking2 theking2 changed the title Better formtting of functions Better formatting of functions Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New issue opened using "Feature request" template
Projects
None yet
Development

No branches or pull requests

1 participant