[Solved] All SQL code being deleted when I try to format

10 Posts
6 Users
0 Reactions
1,144 Views
(@kylestow)
Member
Joined: 3 years ago
Posts: 1
Topic starter  

I copied the SQLinForm as External SQL Formatter in DBeaver command from the UI and pasted it into the Command Line Box of the external formatter command line setting, but now when I try to format my SQL code, it removes all the code in the current window.

Any idea what I did wrong?



   
Quote
Guido
(@admin)
Member Admin
Joined: 4 years ago
Posts: 259
 

Hi Kyle@stow,

could you please post this screen from your DBeaver installation

grafik

Thanks

Guido



   
ReplyQuote
(@sirthisman)
Member
Joined: 3 years ago
Posts: 1
 

@admin hello,I got the same question.here are setting and log.

What can I do to fix this?

Thanks

image
image


   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 4 years ago
Posts: 259
 

@SirThisMan, thanks for your feedback. Looking to the log it seems that the formatter is not allowed to read in the DBeaver directory

grafik

Regards

Guido



   
ReplyQuote
(@na5772)
Member
Joined: 2 years ago
Posts: 2
 

Not to necro an old thread but the original poster never seemed to respond.

 

I am having the same issue. When run the formatter, everything in the dBeaver editor disappears.

 

image

 

Originally the dbeaver log was reporting the external formatter process was hanging, so I increased the timeout to 5000.  Interestingly, no .log file seems to be generated in the SQLinForm directory. 

*edit: I also tried running dbeaver in administrator mode.


This post was modified 2 years ago by na5772

   
ReplyQuote
(@na5772)
Member
Joined: 2 years ago
Posts: 2
 

Of course as soon as I post I find the issue.

It looks like the issue is with the temp file path being passed to the cli.  From the profileX_work.json logfile, I can see that the path is missing a \ between C:\Users and the username. 

I.e. C:\usersusername\local\temp\dbeaver-blahblahblah is being passed instead of C:\users\username\local\temp\dbeaver-blahblahblah

I'm guessing this is a dbeaver issue with its ${file} variable generation.  As a workaround I created a symbolic link between c:\usersusername and c:\users\username.  Not ideal but effective.

 

 



   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 4 years ago
Posts: 259
 

@na5772, many thanks for your feedback. This is of great help.

Will also do some investigations

Regards

Guido



   
ReplyQuote
(@na4711)
Member
Joined: 3 days ago
Posts: 2
 

I have the same issue.

 first it was a problem on reading writing in the directory, nothing happened, now with write permission, the SQL disappears.

i put everythin in c:\tmp to avoid problems with directory acces and reading /writing rights

cli.exe is in c:\tmp\

and there is a directory C:\tmp\SQLinForm where profile1_work.json.log is written to.

 

so command line is

"C:\tmp\cli.exe" -dbeaver ${file}

 

log is

08.10.2025 12:40:06
------------------------------
Number of args passed: 2
Args : -dbeaver
Read file failed : C:\tmp\SQLinForm\dbeaver.json${file}
Input FileName: ${file}
Output FileName: ${file}
Profile FileName: C:\tmp\SQLinForm\profile1_work.json
Read file failed : ${file}
Read input file failed
*

i have a symbolic link in the directory 

C:\tmp\SQLinForm\

but whatever i do, making a link called  dbeaver.json${file} which points to 

C:\tmp\SQLinForm

or to 

C:\tmp\SQLinForm\dbeaver.json

or to 

C:\tmp\SQLinForm\dbeaver.json${file}

and no matter where i put a file ${file}

in 

C:\tmp\SQLinForm\

or

C:\tmp\SQLinForm\dbeaver.jsondatei${file}

and pointing the link to this file

or pointing the link to the directory

 

I get the above error. So how has the link to be configured. Name of the link Source / Target of the link

 

by the way: Notepad++ formatter works , so i get the sql formatted.... 

 



   
ReplyQuote
(@guidomarcel)
Member
Joined: 4 years ago
Posts: 11
 

Hi @na4711,

thanks for your feedback.

Is the formatting working when you do not work with links?

Could you please post a screenshot from c:\tmp directory and from s:\tmp\SQLinForm directory

Regards

Guido



   
ReplyQuote
(@na4711)
Member
Joined: 3 days ago
Posts: 2
 

funny. we can close (for me ) the ticket. 

i restarted the computer inbetween and i restarted dbeaver .

then, to make screenshots for you, i changed 2-3 times the checkbox "create temp file "

and added the ${file} again

first it didnt work  now it works !

without all the links ! 

 

Ghost in the machine. ...

thanks.  

but it is strange behaviour from debeaver. Version 25.0.4.202505041731 

Screenshot 2025 10 08 141058
Screenshot 2025 10 08 141353


   
ReplyQuote
Share: