Written by

System Analyst at First Line Software
Question Flávio Lúcio Naves Júnior · Nov 7, 2023

Creation of namespace and database using CLI

Hello everyone,

I am attempting to implement continuous integration using Docker with Caché 2018.1, and I am in the process of creating an image for our client. I have already installed Caché 2018.1 on the RedHat server, but I am working on a script to create the database and namespace. For the database, I used the following code:

do ##class(SYS.Database).CreateDatabase("/usr/cachepoc/cache2018/mgr/poc/")

However, I have encountered some issues with this code. For instance, I am unable to view this local database in the portal's list:

In the end, I have tried various approaches to create the namespace programmatically, but I haven't been able to resolve this issue.
Could someone please assist me in finding the correct command to create a namespace and explain why we are unable to see the database that was created in the portal's list?

I am aware that we already have some images with InterSystems IRIS, but the client is not ready to update the database at this time.

Product version: Caché 2018.1

Comments

Dmitry Maslennikov · Nov 7, 2023

This command will only create file CACHE.DAT on Caché, or IRIS.DAT for IRIS, and to be able to see it in portal, you have to create Config.Database as well

But, I would recommend using %Installer Manifest, it's available for many years, and in Caché as well

The simplest installer would look like this

XData setup
{
<Manifest>
  <Default Name="Namespace" Value="IRISAPP"/>
  <Default Name="database" Value="irisapp"/>
  
  <Namespace Name="${Namespace}" Code="${Namespace}" Data="${Namespace}" Create="yes" Ensemble="no">

    <Configuration>
      <Database Name="${Namespace}" Dir="${mgrdir}${database}/data" Create="yes" Resource="%DB_${Namespace}"/>
    </Configuration>
  </Namespace>
</Manifest>
}

You can find more examples on GitHub

0
Flávio Lúcio Naves Júnior  Nov 7, 2023 to Dmitry Maslennikov

Thank you. Do you know if it's possible to disable the journal using the manifest?

0
Dmitry Maslennikov  Nov 8, 2023 to Flávio Lúcio Naves Júnior

Yes, you can do it, with tag <Invoke>, which can call any classmethod, which will do what you want

0
Rasmus Hogslätt · May 13

2 years later, but I found this example the closest to what I am trying to do. Can I use a manifest installer file to create a database and namespace from an IRIS.dat file I have in my docker volume and make it automatically configured to the namespace?

0