docs: Table CHECK_CONSTRAINTS() {
  
          Table t = sysTables[CHECK_CONSTRAINTS];
  
          if (t == null) {
              t = createBlankTable(sysTableHsqlNames[CHECK_CONSTRAINTS]);
  
              addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
              addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
              addColumn(t, "CONSTRAINT_NAME", SQL_IDENTIFIER);    // not null
              addColumn(t, "CHECK_CLAUSE", CHARACTER_DATA);       // not null
  
              HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
                  sysTableHsqlNames[CHECK_CONSTRAINTS].name, false,
                  SchemaObject.INDEX);
  
              t.createPrimaryKey(name, new int[] {
                  2, 1, 0
              }, false);
  
              return t;
          }
  
          // column number mappings
          final int constraint_catalog = 0;
          final int constraint_schema  = 1;
          final int constraint_name    = 2;
          final int check_clause       = 3;
  
          //
          PersistentStore store = database.persistentStoreCollection.getStore(t);
  
          // calculated column values
          // Intermediate holders
          Iterator     tables;
          Table        table;
          Constraint[] tableConstraints;
          int          constraintCount;
          Constraint   constraint;
          Object[]     row;
  
          //
          tables =
              database.schemaManager.databaseObjectIterator(SchemaObject.TABLE);
  
          while (tables.hasNext()) {
              table = (Table) tables.next();
  
              if (table.isView()
                      || !session.getGrantee().isFullyAccessibleByRole(table)) {
                  continue;
              }
  
              tableConstraints = table.getConstraints();
              constraintCount  = tableConstraints.length;
  
              for (int i = 0; i < constraintCount; i++) {
                  constraint = tableConstraints[i];
  
                  if (constraint.getConstraintType() != Constraint.CHECK) {
                      continue;
                  }
  
                  row                     = t.getEmptyRowData();
                  row[constraint_catalog] = database.getCatalogName().name;
                  row[constraint_schema]  = table.getSchemaName().name;
                  row[constraint_name]    = constraint.getName().name;
  
                  try {
                      row[check_clause] = constraint.getCheckSQL();
                  } catch (Exception e) {}
  
                  t.insertSys(store, row);
              }
          }
  
          Iterator it =
              database.schemaManager.databaseObjectIterator(SchemaObject.DOMAIN);
  
          while (it.hasNext()) {
              Type domain = (Type) it.next();
  
              if (!domain.isDomainType()) {
                  continue;
              }
  
              if (!session.getGrantee().isFullyAccessibleByRole(domain)) {
                  continue;
              }
  
              tableConstraints = domain.userTypeModifier.getConstraints();
              constraintCount  = tableConstraints.length;
  
              for (int i = 0; i < constraintCount; i++) {
                  constraint              = tableConstraints[i];
                  row                     = t.getEmptyRowData();
                  row[constraint_catalog] = database.getCatalogName().name;
                  row[constraint_schema]  = domain.getSchemaName().name;
                  row[constraint_name]    = constraint.getName().name;
  
                  try {
                      row[check_clause] = constraint.getCheckSQL();
                  } catch (Exception e) {}
  
                  t.insertSys(store, row);
              }
          }
  
          return t;
      }