Great stuff, @Rizmaan Marikar!
Do you want to share the code on GitHub and Open Exchange?
- Log in to post comments
Great stuff, @Rizmaan Marikar!
Do you want to share the code on GitHub and Open Exchange?
So I guess it is preview version and that'll be fixed
Thanks, Vitaliy! A new LOAD DATA command doesn't generate class, right?
Very cool!
It's indeed convenient if you need to fix the typo in your ObjectScript and can do that just typing "." symbol and can make changes even from iPad :)
ObjectScript plugin installation worked perfectly!
Thanks, @Dmitry Maslennikov for sharing!
Thanks, Ben! Just curious is it safe and the best practice to edit the storage definition manually?
Or is it safer to let the compiler do the thing?
Agree on having the storage definition in the source control along with the class definition.
Thanks @Dmitry Maslennikov, @Robert C. Cemper and @Herman Slagman !
Turn out it's not that hard with your help!
The result can be observed here - adding a parameter and the implementation to a method in csvgen.
And yes, here is the code itself:
ClassMethod AddAppendtoImport(pClassName As %String) As %Status
{
set method = ##class(%Dictionary.MethodDefinition).%OpenId(pClassName_"||Import")
if method.FormalSpec["pAppend" quit $$$OK
set method.FormalSpec=method.FormalSpec_",pAppend:%Boolean=0"
set imp=method.Implementation
set newImp=##class(%Stream.TmpCharacter).%New()
while 'imp.AtEnd {
set line=imp.ReadLine()
if line'["%DeleteExtent" {do newImp.WriteLine(line)}
else {
do newImp.WriteLine($p(line,"do")_"if 'pAppend do ..%DeleteExtent(,.tDeleted,.tInstances,1)")
}
}
set method.Implementation=newImp
set sc=method.%Save()
if $$$ISERR(sc) return sc
set sc=$System.OBJ.Compile(pClassName,"cuk")
return sc
}
With the csvgen 1.2.1 release added the Append support as @Yuri Marx requested.
Thanks @Vivian Lee!
This is a known issue. And this is why it is THE MUST to store the storage strategy with the class definition in the source code repository.
Also, maybe it's not a bad idea to never delete properties and just mark it as archived/deprecated.
Fantastic, @Eduard Lebedyuk!
Do you want to create a ZPM module from it?
Available on Docker Hub too.
And images with ZPM package manager 0.3.2 are available accordingly:
intersystemsdc/iris-community:2021.2.0.617.0-zpm intersystemsdc/iris-ml-community:2021.2.0.617.0-zpm intersystemsdc/iris-community:2021.1.0.215.3-zpm intersystemsdc/irishealth-community:2021.1.0.215.3-zpm intersystemsdc/irishealth-ml-community:2021.1.0.215.3-zpm intersystemsdc/irishealth-community:2021.1.0.215.3-zpm
And to launch IRIS do:
docker run --rm --name my-iris -d --publish 9091:1972 --publish 9092:52773 intersystemsdc/iris-community:2021.2.0.617.0-zpm docker run --rm --name my-iris -d --publish 9091:1972 --publish 9092:52773 intersystemsdc/iris-ml-community:2021.2.0.617.0-zpm docker run --rm --name my-iris -d --publish 9091:1972 --publish 9092:52773 intersystemsdc/iris-community:2021.2.0.617.0-zpm docker run --rm --name my-iris -d --publish 9091:1972 --publish 9092:52773 intersystemsdc/irishealth-community:2021.2.0.617.0-zpm docker run --rm --name my-iris -d --publish 9091:1972 --publish 9092:52773 intersystemsdc/irishealth-ml-community:2021.2.0.617.0-zpm docker run --rm --name my-iris -d --publish 9091:1972 --publish 9092:52773 intersystemsdc/irishealth-community:2021.2.0.617.0-zpm
And for terminal do:
docker exec -it my-iris iris session IRIS
and to start the control panel:
http://localhost:9092/csp/sys/UtilHome.cspTo stop and destroy container do:
docker stop my-irisAnd the FROM clause in dockerfile can look like:
FROM intersystemsdc/iris-community:2021.2.0.617.0-zpm
Or to take the latest image:
FROM intersystemsdc/iris-community
Thanks, Robert!
And what is the easiest way to change the particular line of code?
E.g. I need to add a parameter to a method definition.
Hi Ben!
There appears to be an issue on Windows as it doesn't strip out the ":" from the filename when auto-generating the class( https://github.com/evshvarov/csvgen/issues/13).
This is fixed with the new release.
As for the Library.DateTime, there is no support for this type yet.
You can add the support and PR - it's an open-source library and PRs are very welcome.
Also, you can consider csvgen-ui library by @Guillaume Rongier - it has a very nice UI to guess types and choose your own if guessing fails or doesn't apply.
Nice app, @henry !
If I have the property Name that contains full names, and I need to Fake it, I should:
0. Install ZPM module iris-disquise
1. Change the datatype to dc.Disguise.DataTypes.FakeString("FULLNAME")
2. Run the ##class(dc.Disguise.Strategy).Fake("myclass", "Name", "fullname")
Right?
I'm curious, why should I repeat fullname 2 times? Maybe I could omit the strategy at least in the Fake method assuming that strategy can be taken from the property?
:)
Yes. The Github Actions script reacts on a push to the repository because of this line.
Thanks for the support, Tim!
Thanks Yuri!
Hi Robert!
top-level dc came from this discussion. Community people decided on dc. for "community" organisation.
That means they either donate the code to the community or decide to stay anonymous or don't take the responsibility?
But nevertheless dc. is a very popular package...
I think dc. should belong to code samples, templates originated by community moderators? We can discuss again
Hi @Rahim Mammadli !
Just include this file into your GitHub repo when you'll publish it after the advent - and it will send your repo for testing automatically.
Or you can do it even in the beginning - some participants publish code even during the event.
Thanks, Dmitry! Also calling @Daniel Tamajon for more details.
@Adel Elsayed, you can see how ObjectScript Quality works here - it can analyze any open-source ObjectScript repository for free if you add this file to a project.
We expanded the topic for Auditing and Encryption too. So, @henry, your idea meets the contest requirements - please apply for the contest!
@Yuri Marx, thanks for your attention and useful comments as always!
Added an example of REST API with basic authentication and users deployed and an example of roles authorization implemented.
Thanks, everyone! It's an honor to be with you, InterSystems Developer Community these 5 years together with our perfect Developer Ecosystem team!
The community is growing and we hope it brings value to its members - to more than 10,000 people worldwide already!
Thanks for being with us, thanks for your contributions and I wish you all the best, the success in your career and startups, to achieve your development goals and releases! And to stay healthy of course!
Here is a very helpful post on the topic by @Eduard Lebedyuk
Also, Nicola, it's not a Studio Tips and Tricks, but... have you tried VSCode ObjectScript?
Same reply as @Dmitry Maslennikov but with links on Open Exchange. there are at least four:
Thanks, Dmitry! This is what I was looking for
Thanks, Rob! Don't see though the example of how to make a Bearer token authorisation with InterSystems IRIS