Question
· 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
Discussion (3)1
Log in or sign up to continue

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