Article Eduard Lebedyuk · Mar 4, 2021 1m read Get a list of cached queries and their texts Recently I wanted to get a list of all cached queries and their texts. Here's how to do that. First create an SQL Procedure returning Cache Query text from a Cached Query routine name: Class test.CQ { /// SELECT test.CQ_GetText() ClassMethod GetText(routine As %String) As %String [ CodeMode = expression, SqlProc ] { ##class(%SQLCatalog).GetCachedQueryInfo(routine) } } And after that you can execute this query: #Code Snippet #SQL #InterSystems IRIS 5 4 0 754
Article Eduard Lebedyuk · Jan 12, 2021 1m read How to work with InterSystems IRIS from DataGrip DataGrip is a multi-engine database environment targeting the specific needs of professional SQL developers, DataGrip makes working with databases an enjoyable and productive experience. To work with InterSystems IRIS from DataGrip you'll need to add InterSystems JDBC driver first (once per DataGrip) and after that add all your InterSystems IRIS connections. Part 1: Add InterSystems IRIS JDBC Driver 1. Go To File → DataSources #JDBC #SQL #InterSystems IRIS 1 0 0 883
Discussion Eduard Lebedyuk · Jan 10, 2021 Code Golf: Diamonds To start the year let's have a round of CodeGolf! You know the drill. Shortest solution wins. Print a size ascending range of Diamonds using the numbers 1 to 9, ranging from size 1 to size N, each diamond separated by a blank line. A size 1 diamond should look like this, a single centered 1: 1 With the size N=9 diamond looking like this: #Code Snippet #InterSystems IRIS 2 19 0 611
Question Eduard Lebedyuk · Jan 2, 2021 SQL Search/iFind to find out how many matches are there I have an SQL text index defined like this Index TextIndex On (Text) As %iFind.Index.Basic(IGNOREPUNCTUATION = 1, INDEXOPTION = 0, LANGUAGE = "en", LOWER = 1); If I run a query like this: SELECT Text FROM Post WHERE %ID %FIND search_index("TextIndex",'ABC') I get 20 results with posts containing the term ABC. But each post can contain the term ABC several times. #iFind #SQL #InterSystems IRIS 0 13 0 550
Article Eduard Lebedyuk · Dec 2, 2020 2m read Calculating detailed class/table size In the good old days (tm) determining the size of the data, streams, and indices for a class/table was easy - you just ran %GSIZE and check D, S, and I globals respectively. However, nowadays sharding, optimized global names, and indices in separate globals produce %GSIZE output looking like this: #Sharding #SQL #InterSystems IRIS Open Exchange app 12 6 5 1.4K
Article Eduard Lebedyuk · Nov 19, 2020 3m read Deploying a sharded cluster with Docker and MergeCPF In this article, we will run an InterSystems IRIS cluster using docker and Merge CPF files - a new feature allowing you to configure servers with ease. On UNIX® and Linux, you can modify the default iris.cpf using a declarative CPF merge file. A merge file is a partial CPF that sets the desired values for any number of parameters upon instance startup. The CPF merge operation works only once for each instance. Our cluster architecture is very simple, it would consist of one Node1 (master node) and two Data Nodes (check all available roles). Unfortunately, docker-compose cannot deploy to several servers (although it can deploy to remote hosts), so this is useful for local development of sharding-aware data models, tests, and such. For a productive InterSystems IRIS Cluster deployment, you should use either ICM or IKO. #Beginner #Best Practices #Docker #Sharding #InterSystems IRIS Open Exchange app 6 3 1 817
Question Eduard Lebedyuk · Aug 26, 2020 XML Serialization - output ID I have a class: Class test.Person Extends (%Persistent, %XML.Adaptor) { Property Name; } I want to serialize it into this XML: <Person> <Id>1</Id> <Name>Ed</Name> </Person> Is it possible? It's for the Visual Trace so I can't use %XML.Writer. #XML #InterSystems IRIS 0 2 0 385
Discussion Eduard Lebedyuk · Aug 13, 2020 Do you pass Ids or Objects in Interoperability Productions Messages between Business Hosts in Interoperability Production often contain object properties. Do you define and pass them as object properties or do you define and pass them as Integers with objects conversion where required? Why? #Business Operation #Business Process (BPL) #Business Service #Interoperability #InterSystems IRIS 0 1 0 233
Article Eduard Lebedyuk · Aug 12, 2020 3m read Calling production from a REST Broker Productions often need to receive REST requests. Here's how to do that. 1. Create proxy Service: /// Empty BS we would use to send Produciton requests Class production.ProxyService Extends Ens.BusinessService { } 2. Add it to production as RESTService (or any other name). #Business Operation #Business Process (BPL) #Business Service #Interoperability #REST API #InterSystems IRIS 5 8 1 1.1K
Article Eduard Lebedyuk · Aug 7, 2020 5m read Containerising .Net/Java Gateways (or Kafka Integration Demo) In this article, I will show how you can easily containerize .Net/Java Gateways. For our example, we will develop an Integration with Apache Kafka. And to interoperate with Java/.Net code we will use PEX . Architecture Our solution will run completely in docker and look like this: #.NET #Best Practices #Business Operation #Business Service #Docker #Interoperability #Java #InterSystems IRIS Open Exchange app 7 7 1 1.5K
Article Eduard Lebedyuk · Aug 3, 2020 3m read Creating classes/tables with more than 999 properties in InterSystems IRIS InterSystems IRIS currently limits classes to 999 properties. But what to do if you need to store more data per object? This article would answer this question (with the additional cameo of Community Python Gateway and how you can transfer wide datasets into Python). The answer is very simple actually - InterSystems IRIS currently limits classes to 999 properties, but not to 999 primitives. The property in InterSystems IRIS can be an object with 999 properties and so on - the limit can be easily disregarded. #Globals #Object Data Model #Python #Relational Tables #SQL #Tips & Tricks #InterSystems IRIS 5 13 1 869
Question Eduard Lebedyuk · Jul 9, 2020 Is there a way to defermine that column is a JSON_OBJECT I got a resultset, and some columns might be a JSON_OBJECT. Is there a way (based on metadata) to determine that the column was formed from JSON_OBJECT function? set rs = ##class(%SQL.Statement).%ExecDirect(,"SELECT 1 colA, JSON_OBJECT('id':1) col2") do rs.%Display() I do not want to try parsing json. #SQL #InterSystems IRIS 0 5 0 312
Question Eduard Lebedyuk · Jul 6, 2020 How to generate runtimeconfig.json\deps.json for dependency with dotnet publish? I'm building a .Net Core Gateway container. Here's the issue. As a final step I'm building a .Net Core 2.1 library. It has a runnable dependency - .Net Gateway, which I need to start first. However dotnet publish generates .runtimeconfig.json and .deps.json only for my library and not for my dependency (.Net Gateway). Is there a way to force dotnet to generate .runtimeconfig.json and .deps.json for a dependency? I have tried: #.NET #Interoperability #InterSystems IRIS 0 2 0 8.8K
Question Eduard Lebedyuk · Jun 30, 2020 Running .Net/Java Gateways in Docker Does anyone have a Dockerfile for .Net/Java Gateways to share? I'm trying out PEX and I think being able to run it as a docker container would be great. To clarify I'm interested in container without IRIS, gateway only. #.NET #Containerization #Java #InterSystems IRIS 0 1 0 594
Article Eduard Lebedyuk · Jun 19, 2020 2m read Generate Swagger spec from persistent and serial classes Recently I needed to generate a Swagger spec from persistent and serial classes, so I'm publishing my code (it's not complete - you still need to hash out the application specifics, but it's a start). It's available here. Let's say you have these classes: #API #Best Practices #Code Snippet #REST API #InterSystems IRIS 9 14 3 2K
Article Eduard Lebedyuk · Jun 18, 2020 1m read Debugging Business Operations Often we need to debug a Business Operation. Tracing and logging work but sometimes you want to work with a BO as with your local terminal session. Here's how you can do that on any operating system. Windows has a great tool for debugging Business Operations - Foreground mode. In that mode Windows launches a local terminal with operation job. #Business Operation #Debugging #Interoperability #InterSystems IRIS 2 0 2 628
Article Eduard Lebedyuk · Apr 22, 2020 1m read Get VSCode to look like Studio One of the things I want from VSCode is to have a familiar Studio look. Thankfully VSCode is easily customizable so you can choose any color for any element. Here's what I got so far: To get the same look add to your settings.json: #VSCode #InterSystems IRIS Open Exchange app 6 0 1 491
Announcement Eduard Lebedyuk · Apr 10, 2020 JuliaGateway 0.5 released I'm happy to announce the release of the interface to Julia programming language for InterSystems IRIS. Execute Julia code and more from InterSystems IRIS. This project brings you the power of Julia right into your InterSystems IRIS environment: #Artificial Intelligence (AI) #Analytics #Machine Learning (ML) #InterSystems IRIS Open Exchange app 1 0 0 321
Question Eduard Lebedyuk · Apr 1, 2020 Use table-object as a part of SQL Query During runtime I build an object which is essentially a wrapper over in-memory table: col1 ... colN val11 ... valN1 val12 ... valN2 I want to use this object as a part of INSERT or UPDATE queries, based on a value of some column (the main use case one of the columns is an ID value) What's the best way to expose the object to SQL? #SQL #InterSystems IRIS 1 13 0 787
Discussion Eduard Lebedyuk · Mar 24, 2020 USER namespace in Docker For standalone installations I always recommended to use custom namespaces and not the USER namespace. However, what about Docker? In many Dockerfiles I see the creation of additional namespace, but why, if only one namespace is required? What do you think? #Containerization #Docker #InterSystems IRIS 0 2 0 336