Skip to main content
GET
/
v1
/
instances
/
{instance}
/
databases
/
{database}
/
metadata
cURL
curl --request GET \
  --url https://api.example.com/v1/instances/{instance}/databases/{database}/metadata
{
  "name": "<string>",
  "schemas": [
    {
      "name": "<string>",
      "tables": [
        {
          "name": "<string>",
          "columns": [
            {
              "name": "<string>",
              "position": 123,
              "hasDefault": true,
              "default": "<string>",
              "defaultOnNull": true,
              "onUpdate": "<string>",
              "nullable": true,
              "type": "<string>",
              "characterSet": "<string>",
              "collation": "<string>",
              "comment": "<string>",
              "generation": {
                "type": "TYPE_UNSPECIFIED",
                "expression": "<string>"
              },
              "isIdentity": true,
              "identityGeneration": "IDENTITY_GENERATION_UNSPECIFIED",
              "identitySeed": "<string>",
              "identityIncrement": "<string>",
              "defaultConstraintName": "<string>"
            }
          ],
          "indexes": [
            {
              "name": "<string>",
              "expressions": [
                "<string>"
              ],
              "keyLength": [
                "<string>"
              ],
              "descending": [
                true
              ],
              "type": "<string>",
              "unique": true,
              "primary": true,
              "visible": true,
              "comment": "<string>",
              "definition": "<string>",
              "parentIndexSchema": "<string>",
              "parentIndexName": "<string>",
              "granularity": "<string>",
              "isConstraint": true,
              "spatialConfig": {
                "method": "<string>",
                "tessellation": {
                  "scheme": "<string>",
                  "gridLevels": [
                    {
                      "level": 123,
                      "density": "<string>"
                    }
                  ],
                  "cellsPerObject": 123,
                  "boundingBox": {
                    "xmin": 123,
                    "ymin": 123,
                    "xmax": 123,
                    "ymax": 123
                  }
                },
                "storage": {
                  "fillfactor": 123,
                  "buffering": "<string>",
                  "tablespace": "<string>",
                  "workTablespace": "<string>",
                  "sdoLevel": 123,
                  "commitInterval": 123,
                  "padIndex": true,
                  "sortInTempdb": "<string>",
                  "dropExisting": true,
                  "online": true,
                  "allowRowLocks": true,
                  "allowPageLocks": true,
                  "maxdop": 123,
                  "dataCompression": "<string>"
                },
                "dimensional": {
                  "dimensions": 123,
                  "dataType": "<string>",
                  "srid": 123,
                  "constraints": [
                    {
                      "dimension": "<string>",
                      "minValue": 123,
                      "maxValue": 123,
                      "tolerance": 123
                    }
                  ]
                }
              },
              "opclassNames": [
                "<string>"
              ],
              "opclassDefaults": [
                true
              ]
            }
          ],
          "engine": "<string>",
          "collation": "<string>",
          "charset": "<string>",
          "rowCount": "<string>",
          "dataSize": "<string>",
          "indexSize": "<string>",
          "dataFree": "<string>",
          "createOptions": "<string>",
          "comment": "<string>",
          "foreignKeys": [
            {
              "name": "<string>",
              "columns": [
                "<string>"
              ],
              "referencedSchema": "<string>",
              "referencedTable": "<string>",
              "referencedColumns": [
                "<string>"
              ],
              "onDelete": "<string>",
              "onUpdate": "<string>",
              "matchType": "<string>"
            }
          ],
          "partitions": [
            {
              "name": "<string>",
              "type": "TYPE_UNSPECIFIED",
              "expression": "<string>",
              "value": "<string>",
              "useDefault": "<string>",
              "subpartitions": "<array>",
              "indexes": [
                {
                  "name": "<string>",
                  "expressions": [
                    "<string>"
                  ],
                  "keyLength": [
                    "<string>"
                  ],
                  "descending": [
                    true
                  ],
                  "type": "<string>",
                  "unique": true,
                  "primary": true,
                  "visible": true,
                  "comment": "<string>",
                  "definition": "<string>",
                  "parentIndexSchema": "<string>",
                  "parentIndexName": "<string>",
                  "granularity": "<string>",
                  "isConstraint": true,
                  "spatialConfig": {
                    "method": "<string>",
                    "tessellation": {
                      "scheme": "<string>",
                      "gridLevels": [
                        {
                          "level": 123,
                          "density": "<string>"
                        }
                      ],
                      "cellsPerObject": 123,
                      "boundingBox": {
                        "xmin": 123,
                        "ymin": 123,
                        "xmax": 123,
                        "ymax": 123
                      }
                    },
                    "storage": {
                      "fillfactor": 123,
                      "buffering": "<string>",
                      "tablespace": "<string>",
                      "workTablespace": "<string>",
                      "sdoLevel": 123,
                      "commitInterval": 123,
                      "padIndex": true,
                      "sortInTempdb": "<string>",
                      "dropExisting": true,
                      "online": true,
                      "allowRowLocks": true,
                      "allowPageLocks": true,
                      "maxdop": 123,
                      "dataCompression": "<string>"
                    },
                    "dimensional": {
                      "dimensions": 123,
                      "dataType": "<string>",
                      "srid": 123,
                      "constraints": [
                        {
                          "dimension": "<string>",
                          "minValue": 123,
                          "maxValue": 123,
                          "tolerance": 123
                        }
                      ]
                    }
                  },
                  "opclassNames": [
                    "<string>"
                  ],
                  "opclassDefaults": [
                    true
                  ]
                }
              ],
              "checkConstraints": [
                {
                  "name": "<string>",
                  "expression": "<string>"
                }
              ]
            }
          ],
          "checkConstraints": [
            {
              "name": "<string>",
              "expression": "<string>"
            }
          ],
          "owner": "<string>",
          "sortingKeys": [
            "<string>"
          ],
          "triggers": [
            {
              "name": "<string>",
              "event": "<string>",
              "timing": "<string>",
              "body": "<string>",
              "sqlMode": "<string>",
              "characterSetClient": "<string>",
              "collationConnection": "<string>",
              "comment": "<string>",
              "skipDump": true
            }
          ],
          "skipDump": true,
          "shardingInfo": "<string>",
          "primaryKeyType": "<string>"
        }
      ],
      "externalTables": [
        {
          "name": "<string>",
          "externalServerName": "<string>",
          "externalDatabaseName": "<string>",
          "columns": [
            {
              "name": "<string>",
              "position": 123,
              "hasDefault": true,
              "default": "<string>",
              "defaultOnNull": true,
              "onUpdate": "<string>",
              "nullable": true,
              "type": "<string>",
              "characterSet": "<string>",
              "collation": "<string>",
              "comment": "<string>",
              "generation": {
                "type": "TYPE_UNSPECIFIED",
                "expression": "<string>"
              },
              "isIdentity": true,
              "identityGeneration": "IDENTITY_GENERATION_UNSPECIFIED",
              "identitySeed": "<string>",
              "identityIncrement": "<string>",
              "defaultConstraintName": "<string>"
            }
          ]
        }
      ],
      "views": [
        {
          "name": "<string>",
          "definition": "<string>",
          "comment": "<string>",
          "dependencyColumns": [
            {
              "schema": "<string>",
              "table": "<string>",
              "column": "<string>"
            }
          ],
          "columns": [
            {
              "name": "<string>",
              "position": 123,
              "hasDefault": true,
              "default": "<string>",
              "defaultOnNull": true,
              "onUpdate": "<string>",
              "nullable": true,
              "type": "<string>",
              "characterSet": "<string>",
              "collation": "<string>",
              "comment": "<string>",
              "generation": {
                "type": "TYPE_UNSPECIFIED",
                "expression": "<string>"
              },
              "isIdentity": true,
              "identityGeneration": "IDENTITY_GENERATION_UNSPECIFIED",
              "identitySeed": "<string>",
              "identityIncrement": "<string>",
              "defaultConstraintName": "<string>"
            }
          ],
          "triggers": [
            {
              "name": "<string>",
              "event": "<string>",
              "timing": "<string>",
              "body": "<string>",
              "sqlMode": "<string>",
              "characterSetClient": "<string>",
              "collationConnection": "<string>",
              "comment": "<string>",
              "skipDump": true
            }
          ],
          "skipDump": true
        }
      ],
      "functions": [
        {
          "name": "<string>",
          "definition": "<string>",
          "signature": "<string>",
          "characterSetClient": "<string>",
          "collationConnection": "<string>",
          "databaseCollation": "<string>",
          "sqlMode": "<string>",
          "comment": "<string>",
          "dependencyTables": [
            {
              "schema": "<string>",
              "table": "<string>"
            }
          ],
          "skipDump": true
        }
      ],
      "procedures": [
        {
          "name": "<string>",
          "definition": "<string>",
          "signature": "<string>",
          "characterSetClient": "<string>",
          "collationConnection": "<string>",
          "databaseCollation": "<string>",
          "sqlMode": "<string>",
          "comment": "<string>",
          "skipDump": true
        }
      ],
      "streams": [
        {
          "name": "<string>",
          "tableName": "<string>",
          "owner": "<string>",
          "comment": "<string>",
          "type": "TYPE_UNSPECIFIED",
          "stale": true,
          "mode": "MODE_UNSPECIFIED",
          "definition": "<string>"
        }
      ],
      "tasks": [
        {
          "name": "<string>",
          "id": "<string>",
          "owner": "<string>",
          "comment": "<string>",
          "warehouse": "<string>",
          "schedule": "<string>",
          "predecessors": [
            "<string>"
          ],
          "state": "STATE_UNSPECIFIED",
          "condition": "<string>",
          "definition": "<string>"
        }
      ],
      "materializedViews": [
        {
          "name": "<string>",
          "definition": "<string>",
          "comment": "<string>",
          "dependencyColumns": [
            {
              "schema": "<string>",
              "table": "<string>",
              "column": "<string>"
            }
          ],
          "triggers": [
            {
              "name": "<string>",
              "event": "<string>",
              "timing": "<string>",
              "body": "<string>",
              "sqlMode": "<string>",
              "characterSetClient": "<string>",
              "collationConnection": "<string>",
              "comment": "<string>",
              "skipDump": true
            }
          ],
          "indexes": [
            {
              "name": "<string>",
              "expressions": [
                "<string>"
              ],
              "keyLength": [
                "<string>"
              ],
              "descending": [
                true
              ],
              "type": "<string>",
              "unique": true,
              "primary": true,
              "visible": true,
              "comment": "<string>",
              "definition": "<string>",
              "parentIndexSchema": "<string>",
              "parentIndexName": "<string>",
              "granularity": "<string>",
              "isConstraint": true,
              "spatialConfig": {
                "method": "<string>",
                "tessellation": {
                  "scheme": "<string>",
                  "gridLevels": [
                    {
                      "level": 123,
                      "density": "<string>"
                    }
                  ],
                  "cellsPerObject": 123,
                  "boundingBox": {
                    "xmin": 123,
                    "ymin": 123,
                    "xmax": 123,
                    "ymax": 123
                  }
                },
                "storage": {
                  "fillfactor": 123,
                  "buffering": "<string>",
                  "tablespace": "<string>",
                  "workTablespace": "<string>",
                  "sdoLevel": 123,
                  "commitInterval": 123,
                  "padIndex": true,
                  "sortInTempdb": "<string>",
                  "dropExisting": true,
                  "online": true,
                  "allowRowLocks": true,
                  "allowPageLocks": true,
                  "maxdop": 123,
                  "dataCompression": "<string>"
                },
                "dimensional": {
                  "dimensions": 123,
                  "dataType": "<string>",
                  "srid": 123,
                  "constraints": [
                    {
                      "dimension": "<string>",
                      "minValue": 123,
                      "maxValue": 123,
                      "tolerance": 123
                    }
                  ]
                }
              },
              "opclassNames": [
                "<string>"
              ],
              "opclassDefaults": [
                true
              ]
            }
          ],
          "skipDump": true
        }
      ],
      "packages": [
        {
          "name": "<string>",
          "definition": "<string>"
        }
      ],
      "owner": "<string>",
      "sequences": [
        {
          "name": "<string>",
          "dataType": "<string>",
          "start": "<string>",
          "minValue": "<string>",
          "maxValue": "<string>",
          "increment": "<string>",
          "cycle": true,
          "cacheSize": "<string>",
          "lastValue": "<string>",
          "ownerTable": "<string>",
          "ownerColumn": "<string>",
          "comment": "<string>",
          "skipDump": true
        }
      ],
      "events": [
        {
          "name": "<string>",
          "definition": "<string>",
          "timeZone": "<string>",
          "sqlMode": "<string>",
          "characterSetClient": "<string>",
          "collationConnection": "<string>",
          "comment": "<string>"
        }
      ],
      "enumTypes": [
        {
          "name": "<string>",
          "values": [
            "<string>"
          ],
          "comment": "<string>",
          "skipDump": true
        }
      ],
      "skipDump": true,
      "comment": "<string>"
    }
  ],
  "characterSet": "<string>",
  "collation": "<string>",
  "extensions": [
    {
      "name": "<string>",
      "schema": "<string>",
      "version": "<string>",
      "description": "<string>"
    }
  ],
  "owner": "<string>",
  "searchPath": "<string>"
}

Path Parameters

instance
string
required

The instance id.

database
string
required

The database id.

Query Parameters

filter
string

Filter is used to filter databases returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

Supported filter:

  • schema: the schema name, support "==" operator.
  • table: the table name, support "==" and ".matches()" operator.

For example: schema == "schema-a" table == "table-a" table.matches("table-a") schema == "schema-a" && table.matches("sample") The filter used to search table with wildcard "sample" in the schema "schemas/schema-a". The column masking level will only be returned when a table filter is used.

limit
integer<int32>

Limit the response size of returned table metadata per schema. For example, if the database has 3 schemas, and each schema has 100 tables, if limit is 20, then only 20 tables will be returned for each schema, total 60 tables. Default 0, means no limit.

Response

OK

DatabaseMetadata is the metadata for databases.

name
string

The database metadata name.

Format: instances/{instance}/databases/{database}/metadata

schemas
object[]

The schemas is the list of schemas in a database.

characterSet
string

The character_set is the character set of a database.

collation
string

The collation is the collation of a database.

extensions
object[]

The extensions is the list of extensions in a database.

owner
string

The owner of the database.

searchPath
string

The search_path is the search path of a PostgreSQL database.