Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to auto-indent a query in mysql-worckbench

I mean, something equivalent to simple formatting plugin that automatically indents code. Is there something in this sense?

like image 208
Liu Piu Avatar asked Oct 19 '17 06:10

Liu Piu


People also ask

How do other values affect the MySQL Workbench SQL parser?

Other values do not affect the MySQL Workbench SQL parser and are ignored. If the value of SqlMode is not set, the default value of the SQL_MODE session variable defined by the server stays unchanged during operations with the server. However, the MySQL Workbench SQL parser behaves as if SQL_MODE is also not set.

What is sqlmode in MySQL Workbench?

The SqlMode property is defined in two locations: globally and at document scope. MySQL Workbench uses the global property to initialize the document property for each new document created.

Does the default value of sqlmode affect the workbench SQL parser?

Other values do not affect the MySQL Workbench SQL parser and are ignored. If the value of SqlMode is not set, the default value of the SQL_MODE session variable defined by the server stays unchanged during operations with the server.


Video Answer


2 Answers

Refer this link you will have Beautify Query option

select the query you want to format in editor and then do

Edit -> format -> Beautify Query
like image 164
RohitS Avatar answered Sep 19 '22 16:09

RohitS


This Works:

Edit -> format -> Beautify Query

NOTE: You have to click it always, it does not happen on saving the Query.

Shortcut: Ctrl + B

like image 38
majidshakeelshawl Avatar answered Sep 19 '22 16:09

majidshakeelshawl