Closed MarcoGaribaldi closed 6 years ago
Hi @MarcoGaribaldi ,
Copy Generate POCO.groovy file to IDE -> Files -> Scratches and Consoles -> Extensions -> Database Tools and SQL -> schema.
There is Files panel in DataGrip IDE, you can open it with alt + 2
or with the menu at the bottom left of DataGrip (see the screenshot attached)
Here is how the Files panel looks like
where the Generate POJOs.cli
Well, you don't need Generate POJOs.cli
, you should use Generate POCO.groovy
.
Which version of DataGrip are you using?
Thank you for your help, Oleg.
I see why I was confused. I use ver. 1.0.1 and the folder structure is different. This is how it looks:
With ver. 1.0.1 I get the error reported before.
P.S.: ignore the typo in the file name. I have fixed that after taking the screenshot.
So, you manage to generate C# classes? If the groovy script still fails, you can try the old clj script https://github.com/olsh/datagrip-poco-generator/blob/master/deprecated/Generate%20POCO.clj
The deprecated script works. The new one doesn't.
Probably there is an incompatibility between versions of DataGrip, that's why the new groovy script doesn't work with 1.0.1 I've tested the groovy script only with DataGrip 2017.3
Yes, that's what I figured. Well, I am happy with the old script. :)
Thank you for your help.
Glad to help. Can we close the issue or you have questions?
Oops! Closed. :)
Hi.
I am new to DataGrip, so forgive me if I am missing something obvious.
I am not sure to understand your instruction on how to install the script. You say:
Copy Generate POCO.groovy file to IDE -> Files -> Scratches and Consoles -> Extensions -> Database Tools and SQL -> schema.
Is that the file path on disk? I can't find folders with those names. I have tried copying the script to C:\Users\username.DataGrip10\config\extensions\com.intellij\schema
where the Generate POJOs.cli is. After I do this I can see the script in the Scripted Extensions menu of DataGrip. However, when I execute the script I get this exception:
Script execution error groovy.lang.MissingMethodException: No signature of method: com.intellij.util.containers.JBIterable$13.reduce() is applicable for argument types: (java.util.ArrayList, Script4$_calcFields_closure4) values: [[] ... etc.
I suppose I am doing something wrong. Any hint?