Skip to content

Instantly share code, notes, and snippets.

View SylvainGuilbaud's full-sized avatar

Sylvain Guilbaud SylvainGuilbaud

  • InterSystems
  • France
View GitHub Profile
Class large.utils
{
ClassMethod init(nb As %Integer = 10, max As %Integer = 100) As %Status
{
set sc = $$$OK
set serialclass = "large.serial" _ max
if ##class(%Dictionary.ClassDefinition).%ExistsId(serialclass) {
info:
title: ''
description: ''
version: ''
x-ISC_Namespace: IRISAPP
host: "localhost"
basePath: /common
paths:
/:
get:
@SylvainGuilbaud
SylvainGuilbaud / admin.utils.cls
Last active April 20, 2022 16:27
post upgrade tasks to run after upgrading InterSystems IRIS (or Caché, Ensemble)
Class admin.utils
{
ClassMethod upgrade(verbose As %Boolean = 0) As %Status
{
set ns=$Namespace
// Stopping all productions
do ..stopAllProductions(verbose)
zn "%sys"
@SylvainGuilbaud
SylvainGuilbaud / data.archive.person.cls
Last active February 21, 2022 14:33
How to efficiently store historical data, similar to current data, without mixing physical storage ?
Class data.archive.person Extends (%Persistent, data.current.person)
{
Parameter DEFAULTGLOBAL = "^off.person";
/// Description
ClassMethod archive(purgeArchive As %Integer = 0, purgeSource As %Integer = 0) As %Status
{
set sc = $$$OK , tableName = ""
set (archived,archivedErrors, severity) = 0