Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: database catalog API (#14744)

Danny Xu9c0f05578d6e
diff --git a/frontend/src/types/proto/v1/database_catalog_service.ts b/frontend/src/types/proto/v1/database_catalog_service.ts
new file mode 100644
index 0000000000..a8a2f56250
--- /dev/null
+++ b/frontend/src/types/proto/v1/database_catalog_service.ts
@@ -0,0 +1,489 @@
+// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
+// versions:
+// protoc-gen-ts_proto v2.3.0
+// protoc unknown
+// source: v1/database_catalog_service.proto
+
+/* eslint-disable */
+import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
+import Long from "long";
+import { FieldMask } from "../google/protobuf/field_mask";
+
+export const protobufPackage = "bytebase.v1";
+
+export interface GetDatabaseCatalogRequest {
+ /**
+ * The name of the database catalog to retrieve.
+ * Format: instances/{instance}/databases/{database}/catalog
+ */
+ name: string;
+}
+
+export interface UpdateDatabaseCatalogRequest {
+ /**
+ * The database catalog to update.
+ *
+ * The catalog's `name` field is used to identify the database catalog to update.
+ * Format: instances/{instance}/databases/{database}/catalog
+ */
+ catalog:
+ | DatabaseCatalog
+ | undefined;
+ /** The list of fields to update. */
+ updateMask: string[] | undefined;
+}
+
+export interface DatabaseCatalog {
+ /**
+ * The name of the database catalog.
+ * Format: instances/{instance}/databases/{database}/catalog
+ */
+ name: string;
+}
+
+function createBaseGetDatabaseCatalogRequest(): GetDatabaseCatalogRequest {
+ return { name: "" };
+}
+
+export const GetDatabaseCatalogRequest: MessageFns<GetDatabaseCatalogRequest> = {
+ encode(message: GetDatabaseCatalogRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): GetDatabaseCatalogRequest {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseGetDatabaseCatalogRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): GetDatabaseCatalogRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
+ toJSON(message: GetDatabaseCatalogRequest): unknown {
+ const obj: any = {};
+ if (message.name !== "") {
+ obj.name = message.name;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<GetDatabaseCatalogRequest>): GetDatabaseCatalogRequest {
+ return GetDatabaseCatalogRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<GetDatabaseCatalogRequest>): GetDatabaseCatalogRequest {
+ const message = createBaseGetDatabaseCatalogRequest();
+ message.name = object.name ?? "";
+ return message;
+ },
+};
+
+function createBaseUpdateDatabaseCatalogRequest(): UpdateDatabaseCatalogRequest {
+ return { catalog: undefined, updateMask: undefined };
+}
+
+export const UpdateDatabaseCatalogRequest: MessageFns<UpdateDatabaseCatalogRequest> = {
+ encode(message: UpdateDatabaseCatalogRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.catalog !== undefined) {
+ DatabaseCatalog.encode(message.catalog, writer.uint32(10).fork()).join();
+ }
+ if (message.updateMask !== undefined) {
+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): UpdateDatabaseCatalogRequest {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseUpdateDatabaseCatalogRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
+ break;
+ }
+
+ message.catalog = DatabaseCatalog.decode(reader, reader.uint32());
+ continue;
+ }
+ case 2: {
+ if (tag !== 18) {
+ break;
+ }
+
+ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
+ continue;
+ }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): UpdateDatabaseCatalogRequest {
+ return {
+ catalog: isSet(object.catalog) ? DatabaseCatalog.fromJSON(object.catalog) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
+ toJSON(message: UpdateDatabaseCatalogRequest): unknown {
+ const obj: any = {};
+ if (message.catalog !== undefined) {
+ obj.catalog = DatabaseCatalog.toJSON(message.catalog);
+ }
+ if (message.updateMask !== undefined) {
+ obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<UpdateDatabaseCatalogRequest>): UpdateDatabaseCatalogRequest {
+ return UpdateDatabaseCatalogRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<UpdateDatabaseCatalogRequest>): UpdateDatabaseCatalogRequest {
+ const message = createBaseUpdateDatabaseCatalogRequest();
+ message.catalog = (object.catalog !== undefined && object.catalog !== null)
+ ? DatabaseCatalog.fromPartial(object.catalog)
+ : undefined;
+ message.updateMask = object.updateMask ?? undefined;
+ return message;
+ },
+};
+
+function createBaseDatabaseCatalog(): DatabaseCatalog {
+ return { name: "" };
+}
+
+export const DatabaseCatalog: MessageFns<DatabaseCatalog> = {
+ encode(message: DatabaseCatalog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): DatabaseCatalog {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDatabaseCatalog();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): DatabaseCatalog {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
+ toJSON(message: DatabaseCatalog): unknown {
+ const obj: any = {};
+ if (message.name !== "") {
+ obj.name = message.name;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<DatabaseCatalog>): DatabaseCatalog {
+ return DatabaseCatalog.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<DatabaseCatalog>): DatabaseCatalog {
+ const message = createBaseDatabaseCatalog();
+ message.name = object.name ?? "";
+ return message;
+ },
+};
+
+export type DatabaseCatalogServiceDefinition = typeof DatabaseCatalogServiceDefinition;
+export const DatabaseCatalogServiceDefinition = {
+ name: "DatabaseCatalogService",
+ fullName: "bytebase.v1.DatabaseCatalogService",
+ methods: {
+ getDatabaseCatalog: {
+ name: "GetDatabaseCatalog",
+ requestType: GetDatabaseCatalogRequest,
+ requestStream: false,
+ responseType: DatabaseCatalog,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],
+ 800010: [
+ new Uint8Array([
+ 23,
+ 98,
+ 98,
+ 46,
+ 100,
+ 97,
+ 116,
+ 97,
+ 98,
+ 97,
+ 115,
+ 101,
+ 67,
+ 97,
+ 116,
+ 97,
+ 108,
+ 111,
+ 103,
+ 115,
+ 46,
+ 103,
+ 101,
+ 116,
+ ]),
+ ],
+ 800016: [new Uint8Array([1])],
+ 578365826: [
+ new Uint8Array([
+ 44,
+ 18,
+ 42,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 105,
+ 110,
+ 115,
+ 116,
+ 97,
+ 110,
+ 99,
+ 101,
+ 115,
+ 47,
+ 42,
+ 47,
+ 100,
+ 97,
+ 116,
+ 97,
+ 98,
+ 97,
+ 115,
+ 101,
+ 115,
+ 47,
+ 42,
+ 47,
+ 99,
+ 97,
+ 116,
+ 97,
+ 108,
+ 111,
+ 103,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ updateDatabaseCatalog: {
+ name: "UpdateDatabaseCatalog",
+ requestType: UpdateDatabaseCatalogRequest,
+ requestStream: false,
+ responseType: DatabaseCatalog,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [
+ new Uint8Array([
+ 19,
+ 99,
+ 97,
+ 116,
+ 97,
+ 108,
+ 111,
+ 103,
+ 44,
+ 117,
+ 112,
+ 100,
+ 97,
+ 116,
+ 101,
+ 95,
+ 109,
+ 97,
+ 115,
+ 107,
+ ]),
+ ],
+ 800010: [
+ new Uint8Array([
+ 26,
+ 98,
+ 98,
+ 46,
+ 100,
+ 97,
+ 116,
+ 97,
+ 98,
+ 97,
+ 115,
+ 101,
+ 67,
+ 97,
+ 116,
+ 97,
+ 108,
+ 111,
+ 103,
+ 115,
+ 46,
+ 117,
+ 112,
+ 100,
+ 97,
+ 116,
+ 101,
+ ]),
+ ],
+ 800016: [new Uint8Array([1])],
+ 800024: [new Uint8Array([1])],
+ 578365826: [
+ new Uint8Array([
+ 61,
+ 58,
+ 7,
+ 99,
+ 97,
+ 116,
+ 97,
+ 108,
+ 111,
+ 103,
+ 50,
+ 50,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 99,
+ 97,
+ 116,
+ 97,
+ 108,
+ 111,
+ 103,
+ 46,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 105,
+ 110,
+ 115,
+ 116,
+ 97,
+ 110,
+ 99,
+ 101,
+ 115,
+ 47,
+ 42,
+ 47,
+ 100,
+ 97,
+ 116,
+ 97,
+ 98,
+ 97,
+ 115,
+ 101,
+ 115,
+ 47,
+ 42,
+ 47,
+ 99,
+ 97,
+ 116,
+ 97,
+ 108,
+ 111,
+ 103,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ },
+} as const;
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
+
+export interface MessageFns<T> {
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
+ fromJSON(object: any): T;
+ toJSON(message: T): unknown;
+ create(base?: DeepPartial<T>): T;
+ fromPartial(object: DeepPartial<T>): T;
+}
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 35ab07ae65..163f6928d5 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -1394,6 +1394,79 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
+ /v1/instances/{instance}/databases/{database}/catalog:
+ get:
+ tags:
+ - DatabaseCatalogService
+ operationId: DatabaseCatalogService_GetDatabaseCatalog
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DatabaseCatalog'
+ default:
+ description: Default error response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Status'
+ patch:
+ tags:
+ - DatabaseCatalogService
+ operationId: DatabaseCatalogService_UpdateDatabaseCatalog
+ parameters:
+ - name: instance
+ in: path
+ description: The instance id.
+ required: true
+ schema:
+ type: string
+ - name: database
+ in: path
+ description: The database id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask
+ in: query
+ description: The list of fields to update.
+ schema:
+ type: string
+ format: field-mask
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DatabaseCatalog'
+ required: true
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DatabaseCatalog'
+ default:
+ description: Default error response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Status'
/v1/instances/{instance}/databases/{database}/changeHistories:
get:
tags:
@@ -10127,6 +10200,14 @@ components:
readOnly: true
type: boolean
description: The database is available for DML prior backup.
+ DatabaseCatalog:
+ type: object
+ properties:
+ name:
+ type: string
+ description: |-
+ The name of the database catalog.
+ Format: instances/{instance}/databases/{database}/catalog
DatabaseConfig:
type: object
properties:
@@ -15547,6 +15628,7 @@ tags:
- name: BranchService
- name: CelService
- name: ChangelistService
+ - name: DatabaseCatalogService
- name: DatabaseGroupService
- name: DatabaseService
- name: EnvironmentService
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index ed1c3289f0..cbc25de771 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -386,6 +386,13 @@
- [ChangelistService](#bytebase-v1-ChangelistService)
+- [v1/database_catalog_service.proto](#v1_database_catalog_service-proto)
+ - [DatabaseCatalog](#bytebase-v1-DatabaseCatalog)
+ - [GetDatabaseCatalogRequest](#bytebase-v1-GetDatabaseCatalogRequest)
+ - [UpdateDatabaseCatalogRequest](#bytebase-v1-UpdateDatabaseCatalogRequest)
+
+ - [DatabaseCatalogService](#bytebase-v1-DatabaseCatalogService)
+
- [v1/database_group_service.proto](#v1_database_group_service-proto)
- [CreateDatabaseGroupRequest](#bytebase-v1-CreateDatabaseGroupRequest)
- [DatabaseGroup](#bytebase-v1-DatabaseGroup)
@@ -6648,6 +6655,81 @@ The changelist&#39;s `name` field is used to identify the changelist to update.
+<a name="v1_database_catalog_service-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## v1/database_catalog_service.proto
+
+
+
+<a name="bytebase-v1-DatabaseCatalog"></a>
+
+### DatabaseCatalog
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the database catalog. Format: instances/{instance}/databases/{database}/catalog |
+
+
+
+
+
+
+<a name="bytebase-v1-GetDatabaseCatalogRequest"></a>
+
+### GetDatabaseCatalogRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the database catalog to retrieve. Format: instances/{instance}/databases/{database}/catalog |
+
+
+
+
+
+
+<a name="bytebase-v1-UpdateDatabaseCatalogRequest"></a>
+
+### UpdateDatabaseCatalogRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| catalog | [DatabaseCatalog](#bytebase-v1-DatabaseCatalog) | | The database catalog to update.
+
+The catalog&#39;s `name` field is used to identify the database catalog to update. Format: instances/{instance}/databases/{database}/catalog |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to update. |
+
+
+
+
+
+
+
+
+
+
+
+
+<a name="bytebase-v1-DatabaseCatalogService"></a>
+
+### DatabaseCatalogService
+
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| GetDatabaseCatalog | [GetDatabaseCatalogRequest](#bytebase-v1-GetDatabaseCatalogRequest) | [DatabaseCatalog](#bytebase-v1-DatabaseCatalog) | |
+| UpdateDatabaseCatalog | [UpdateDatabaseCatalogRequest](#bytebase-v1-UpdateDatabaseCatalogRequest) | [DatabaseCatalog](#bytebase-v1-DatabaseCatalog) | |
+
+
+
+
+
<a name="v1_database_group_service-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 0e88e170b5..1f11d10ac8 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -1654,6 +1654,33 @@
</li>
+ <li>
+ <a href="#v1%2fdatabase_catalog_service.proto">v1/database_catalog_service.proto</a>
+ <ul>
+
+ <li>
+ <a href="#bytebase.v1.DatabaseCatalog"><span class="badge">M</span>DatabaseCatalog</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.GetDatabaseCatalogRequest"><span class="badge">M</span>GetDatabaseCatalogRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.UpdateDatabaseCatalogRequest"><span class="badge">M</span>UpdateDatabaseCatalogRequest</a>
+ </li>
+
+
+
+
+ <li>
+ <a href="#bytebase.v1.DatabaseCatalogService"><span class="badge">S</span>DatabaseCatalogService</a>
+ </li>
+
+ </ul>
+ </li>
+
+
<li>
<a href="#v1%2fdatabase_group_service.proto">v1/database_group_service.proto</a>
<ul>
@@ -18985,6 +19012,168 @@ Format: projects/{project}/changelists/{changelist} </p></td>
+ <div class="file-heading">
+ <h2 id="v1/database_catalog_service.proto">v1/database_catalog_service.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.v1.DatabaseCatalog">DatabaseCatalog</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The name of the database catalog.
+Format: instances/{instance}/databases/{database}/catalog </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.GetDatabaseCatalogRequest">GetDatabaseCatalogRequest</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The name of the database catalog to retrieve.
+Format: instances/{instance}/databases/{database}/catalog </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.UpdateDatabaseCatalogRequest">UpdateDatabaseCatalogRequest</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>catalog</td>
+ <td><a href="#bytebase.v1.DatabaseCatalog">DatabaseCatalog</a></td>
+ <td></td>
+ <td><p>The database catalog to update.
+
+The catalog&#39;s `name` field is used to identify the database catalog to update.
+Format: instances/{instance}/databases/{database}/catalog </p></td>
+ </tr>
+
+ <tr>
+ <td>update_mask</td>
+ <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>
+ <td></td>
+ <td><p>The list of fields to update. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+
+
+
+
+ <h3 id="bytebase.v1.DatabaseCatalogService">DatabaseCatalogService</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>GetDatabaseCatalog</td>
+ <td><a href="#bytebase.v1.GetDatabaseCatalogRequest">GetDatabaseCatalogRequest</a></td>
+ <td><a href="#bytebase.v1.DatabaseCatalog">DatabaseCatalog</a></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>UpdateDatabaseCatalog</td>
+ <td><a href="#bytebase.v1.UpdateDatabaseCatalogRequest">UpdateDatabaseCatalogRequest</a></td>
+ <td><a href="#bytebase.v1.DatabaseCatalog">DatabaseCatalog</a></td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+ <h4>Methods with HTTP bindings</h4>
+ <table>
+ <thead>
+ <tr>
+ <td>Method Name</td>
+ <td>Method</td>
+ <td>Pattern</td>
+ <td>Body</td>
+ </tr>
+ </thead>
+ <tbody>
+
+
+
+ <tr>
+ <td>GetDatabaseCatalog</td>
+ <td>GET</td>
+ <td>/v1/{name=instances/*/databases/*/catalog}</td>
+ <td></td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>UpdateDatabaseCatalog</td>
+ <td>PATCH</td>
+ <td>/v1/{catalog.name=instances/*/databases/*/catalog}</td>
+ <td>catalog</td>
+ </tr>
+
+
+ </tbody>
+ </table>
+
+
+
+
<div class="file-heading">
<h2 id="v1/database_group_service.proto">v1/database_group_service.proto</h2><a href="#title">Top</a>
</div>
diff --git a/proto/generated-go/v1/database_catalog_service.pb.go b/proto/generated-go/v1/database_catalog_service.pb.go
new file mode 100644
index 0000000000..7546ed4da3
--- /dev/null
+++ b/proto/generated-go/v1/database_catalog_service.pb.go
@@ -0,0 +1,302 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.0
+// protoc (unknown)
+// source: v1/database_catalog_service.proto
+
+package v1
+
+import (
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type GetDatabaseCatalogRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The name of the database catalog to retrieve.
+ // Format: instances/{instance}/databases/{database}/catalog
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *GetDatabaseCatalogRequest) Reset() {
+ *x = GetDatabaseCatalogRequest{}
+ mi := &file_v1_database_catalog_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *GetDatabaseCatalogRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetDatabaseCatalogRequest) ProtoMessage() {}
+
+func (x *GetDatabaseCatalogRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_database_catalog_service_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use GetDatabaseCatalogRequest.ProtoReflect.Descriptor instead.
+func (*GetDatabaseCatalogRequest) Descriptor() ([]byte, []int) {
+ return file_v1_database_catalog_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GetDatabaseCatalogRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+type UpdateDatabaseCatalogRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The database catalog to update.
+ //
+ // The catalog's `name` field is used to identify the database catalog to update.
+ // Format: instances/{instance}/databases/{database}/catalog
+ Catalog *DatabaseCatalog `protobuf:"bytes,1,opt,name=catalog,proto3" json:"catalog,omitempty"`
+ // The list of fields to update.
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *UpdateDatabaseCatalogRequest) Reset() {
+ *x = UpdateDatabaseCatalogRequest{}
+ mi := &file_v1_database_catalog_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *UpdateDatabaseCatalogRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateDatabaseCatalogRequest) ProtoMessage() {}
+
+func (x *UpdateDatabaseCatalogRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_database_catalog_service_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use UpdateDatabaseCatalogRequest.ProtoReflect.Descriptor instead.
+func (*UpdateDatabaseCatalogRequest) Descriptor() ([]byte, []int) {
+ return file_v1_database_catalog_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *UpdateDatabaseCatalogRequest) GetCatalog() *DatabaseCatalog {
+ if x != nil {
+ return x.Catalog
+ }
+ return nil
+}
+
+func (x *UpdateDatabaseCatalogRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+type DatabaseCatalog struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The name of the database catalog.
+ // Format: instances/{instance}/databases/{database}/catalog
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *DatabaseCatalog) Reset() {
+ *x = DatabaseCatalog{}
+ mi := &file_v1_database_catalog_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *DatabaseCatalog) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DatabaseCatalog) ProtoMessage() {}
+
+func (x *DatabaseCatalog) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_database_catalog_service_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use DatabaseCatalog.ProtoReflect.Descriptor instead.
+func (*DatabaseCatalog) Descriptor() ([]byte, []int) {
+ return file_v1_database_catalog_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *DatabaseCatalog) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+var File_v1_database_catalog_service_proto protoreflect.FileDescriptor
+
+var file_v1_database_catalog_service_proto_rawDesc = []byte{
+ 0x0a, 0x21, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x61,
+ 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e,
+ 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69,
+ 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x19, 0x47, 0x65,
+ 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x1e, 0x0a, 0x1c,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c,
+ 0x6f, 0x67, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f,
+ 0x67, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61,
+ 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x7b,
+ 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f,
+ 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x54, 0xea, 0x41, 0x51, 0x0a, 0x1c, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x31, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
+ 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x7d, 0x2f, 0x64,
+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x7d, 0x2f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x32, 0xb3, 0x03, 0x0a, 0x16,
+ 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xb4, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x44, 0x61,
+ 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x26, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44,
+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61,
+ 0x6c, 0x6f, 0x67, 0x22, 0x58, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x17,
+ 0x62, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c,
+ 0x6f, 0x67, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x2c, 0x12, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x73,
+ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x7d, 0x12, 0xe1, 0x01,
+ 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
+ 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67,
+ 0x22, 0x7f, 0xda, 0x41, 0x13, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x2c, 0x75, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x1a, 0x62, 0x62, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x73, 0x2e,
+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x3d, 0x3a, 0x07, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x32, 0x32, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x64, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x2f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67,
+ 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67,
+ 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_v1_database_catalog_service_proto_rawDescOnce sync.Once
+ file_v1_database_catalog_service_proto_rawDescData = file_v1_database_catalog_service_proto_rawDesc
+)
+
+func file_v1_database_catalog_service_proto_rawDescGZIP() []byte {
+ file_v1_database_catalog_service_proto_rawDescOnce.Do(func() {
+ file_v1_database_catalog_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_database_catalog_service_proto_rawDescData)
+ })
+ return file_v1_database_catalog_service_proto_rawDescData
+}
+
+var file_v1_database_catalog_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_v1_database_catalog_service_proto_goTypes = []any{
+ (*GetDatabaseCatalogRequest)(nil), // 0: bytebase.v1.GetDatabaseCatalogRequest
+ (*UpdateDatabaseCatalogRequest)(nil), // 1: bytebase.v1.UpdateDatabaseCatalogRequest
+ (*DatabaseCatalog)(nil), // 2: bytebase.v1.DatabaseCatalog
+ (*fieldmaskpb.FieldMask)(nil), // 3: google.protobuf.FieldMask
+}
+var file_v1_database_catalog_service_proto_depIdxs = []int32{
+ 2, // 0: bytebase.v1.UpdateDatabaseCatalogRequest.catalog:type_name -> bytebase.v1.DatabaseCatalog
+ 3, // 1: bytebase.v1.UpdateDatabaseCatalogRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 0, // 2: bytebase.v1.DatabaseCatalogService.GetDatabaseCatalog:input_type -> bytebase.v1.GetDatabaseCatalogRequest
+ 1, // 3: bytebase.v1.DatabaseCatalogService.UpdateDatabaseCatalog:input_type -> bytebase.v1.UpdateDatabaseCatalogRequest
+ 2, // 4: bytebase.v1.DatabaseCatalogService.GetDatabaseCatalog:output_type -> bytebase.v1.DatabaseCatalog
+ 2, // 5: bytebase.v1.DatabaseCatalogService.UpdateDatabaseCatalog:output_type -> bytebase.v1.DatabaseCatalog
+ 4, // [4:6] is the sub-list for method output_type
+ 2, // [2:4] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_v1_database_catalog_service_proto_init() }
+func file_v1_database_catalog_service_proto_init() {
+ if File_v1_database_catalog_service_proto != nil {
+ return
+ }
+ file_v1_annotation_proto_init()
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_v1_database_catalog_service_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 3,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_v1_database_catalog_service_proto_goTypes,
+ DependencyIndexes: file_v1_database_catalog_service_proto_depIdxs,
+ MessageInfos: file_v1_database_catalog_service_proto_msgTypes,
+ }.Build()
+ File_v1_database_catalog_service_proto = out.File
+ file_v1_database_catalog_service_proto_rawDesc = nil
+ file_v1_database_catalog_service_proto_goTypes = nil
+ file_v1_database_catalog_service_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/v1/database_catalog_service.pb.gw.go b/proto/generated-go/v1/database_catalog_service.pb.gw.go
new file mode 100644
index 0000000000..1b61f76067
--- /dev/null
+++ b/proto/generated-go/v1/database_catalog_service.pb.gw.go
@@ -0,0 +1,283 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: v1/database_catalog_service.proto
+
+/*
+Package v1 is a reverse proxy.
+
+It translates gRPC into RESTful JSON APIs.
+*/
+package v1
+
+import (
+ "context"
+ "errors"
+ "io"
+ "net/http"
+
+ "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
+ "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
+)
+
+// Suppress "imported and not used" errors
+var (
+ _ codes.Code
+ _ io.Reader
+ _ status.Status
+ _ = errors.New
+ _ = runtime.String
+ _ = utilities.NewDoubleArray
+ _ = metadata.Join
+)
+
+func request_DatabaseCatalogService_GetDatabaseCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client DatabaseCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq GetDatabaseCatalogRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := client.GetDatabaseCatalog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_DatabaseCatalogService_GetDatabaseCatalog_0(ctx context.Context, marshaler runtime.Marshaler, server DatabaseCatalogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq GetDatabaseCatalogRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := server.GetDatabaseCatalog(ctx, &protoReq)
+ return msg, metadata, err
+}
+
+var filter_DatabaseCatalogService_UpdateDatabaseCatalog_0 = &utilities.DoubleArray{Encoding: map[string]int{"catalog": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
+
+func request_DatabaseCatalogService_UpdateDatabaseCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client DatabaseCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq UpdateDatabaseCatalogRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Catalog); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Catalog); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+ val, ok := pathParams["catalog.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "catalog.name")
+ }
+ err = runtime.PopulateFieldFromPath(&protoReq, "catalog.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "catalog.name", err)
+ }
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseCatalogService_UpdateDatabaseCatalog_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ msg, err := client.UpdateDatabaseCatalog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_DatabaseCatalogService_UpdateDatabaseCatalog_0(ctx context.Context, marshaler runtime.Marshaler, server DatabaseCatalogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq UpdateDatabaseCatalogRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Catalog); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Catalog); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+ val, ok := pathParams["catalog.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "catalog.name")
+ }
+ err = runtime.PopulateFieldFromPath(&protoReq, "catalog.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "catalog.name", err)
+ }
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DatabaseCatalogService_UpdateDatabaseCatalog_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ msg, err := server.UpdateDatabaseCatalog(ctx, &protoReq)
+ return msg, metadata, err
+}
+
+// RegisterDatabaseCatalogServiceHandlerServer registers the http handlers for service DatabaseCatalogService to "mux".
+// UnaryRPC :call DatabaseCatalogServiceServer directly.
+// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
+// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDatabaseCatalogServiceHandlerFromEndpoint instead.
+// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
+func RegisterDatabaseCatalogServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DatabaseCatalogServiceServer) error {
+ mux.Handle(http.MethodGet, pattern_DatabaseCatalogService_GetDatabaseCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.DatabaseCatalogService/GetDatabaseCatalog", runtime.WithHTTPPathPattern("/v1/{name=instances/*/databases/*/catalog}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_DatabaseCatalogService_GetDatabaseCatalog_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_DatabaseCatalogService_GetDatabaseCatalog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPatch, pattern_DatabaseCatalogService_UpdateDatabaseCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.DatabaseCatalogService/UpdateDatabaseCatalog", runtime.WithHTTPPathPattern("/v1/{catalog.name=instances/*/databases/*/catalog}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_DatabaseCatalogService_UpdateDatabaseCatalog_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_DatabaseCatalogService_UpdateDatabaseCatalog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+
+ return nil
+}
+
+// RegisterDatabaseCatalogServiceHandlerFromEndpoint is same as RegisterDatabaseCatalogServiceHandler but
+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
+func RegisterDatabaseCatalogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
+ conn, err := grpc.NewClient(endpoint, opts...)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err != nil {
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ return
+ }
+ go func() {
+ <-ctx.Done()
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ }()
+ }()
+ return RegisterDatabaseCatalogServiceHandler(ctx, mux, conn)
+}
+
+// RegisterDatabaseCatalogServiceHandler registers the http handlers for service DatabaseCatalogService to "mux".
+// The handlers forward requests to the grpc endpoint over "conn".
+func RegisterDatabaseCatalogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
+ return RegisterDatabaseCatalogServiceHandlerClient(ctx, mux, NewDatabaseCatalogServiceClient(conn))
+}
+
+// RegisterDatabaseCatalogServiceHandlerClient registers the http handlers for service DatabaseCatalogService
+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DatabaseCatalogServiceClient".
+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DatabaseCatalogServiceClient"
+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
+// "DatabaseCatalogServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
+func RegisterDatabaseCatalogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DatabaseCatalogServiceClient) error {
+ mux.Handle(http.MethodGet, pattern_DatabaseCatalogService_GetDatabaseCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.DatabaseCatalogService/GetDatabaseCatalog", runtime.WithHTTPPathPattern("/v1/{name=instances/*/databases/*/catalog}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_DatabaseCatalogService_GetDatabaseCatalog_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_DatabaseCatalogService_GetDatabaseCatalog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPatch, pattern_DatabaseCatalogService_UpdateDatabaseCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.DatabaseCatalogService/UpdateDatabaseCatalog", runtime.WithHTTPPathPattern("/v1/{catalog.name=instances/*/databases/*/catalog}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_DatabaseCatalogService_UpdateDatabaseCatalog_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_DatabaseCatalogService_UpdateDatabaseCatalog_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ return nil
+}
+
+var (
+ pattern_DatabaseCatalogService_GetDatabaseCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "instances", "databases", "catalog", "name"}, ""))
+ pattern_DatabaseCatalogService_UpdateDatabaseCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 2, 3, 4, 5, 5, 4}, []string{"v1", "instances", "databases", "catalog", "catalog.name"}, ""))
+)
+
+var (
+ forward_DatabaseCatalogService_GetDatabaseCatalog_0 = runtime.ForwardResponseMessage
+ forward_DatabaseCatalogService_UpdateDatabaseCatalog_0 = runtime.ForwardResponseMessage
+)
diff --git a/proto/generated-go/v1/database_catalog_service_grpc.pb.go b/proto/generated-go/v1/database_catalog_service_grpc.pb.go
new file mode 100644
index 0000000000..c3a2784d36
--- /dev/null
+++ b/proto/generated-go/v1/database_catalog_service_grpc.pb.go
@@ -0,0 +1,160 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.5.1
+// - protoc (unknown)
+// source: v1/database_catalog_service.proto
+
+package v1
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.64.0 or later.
+const _ = grpc.SupportPackageIsVersion9
+
+const (
+ DatabaseCatalogService_GetDatabaseCatalog_FullMethodName = "/bytebase.v1.DatabaseCatalogService/GetDatabaseCatalog"
+ DatabaseCatalogService_UpdateDatabaseCatalog_FullMethodName = "/bytebase.v1.DatabaseCatalogService/UpdateDatabaseCatalog"
+)
+
+// DatabaseCatalogServiceClient is the client API for DatabaseCatalogService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type DatabaseCatalogServiceClient interface {
+ GetDatabaseCatalog(ctx context.Context, in *GetDatabaseCatalogRequest, opts ...grpc.CallOption) (*DatabaseCatalog, error)
+ UpdateDatabaseCatalog(ctx context.Context, in *UpdateDatabaseCatalogRequest, opts ...grpc.CallOption) (*DatabaseCatalog, error)
+}
+
+type databaseCatalogServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewDatabaseCatalogServiceClient(cc grpc.ClientConnInterface) DatabaseCatalogServiceClient {
+ return &databaseCatalogServiceClient{cc}
+}
+
+func (c *databaseCatalogServiceClient) GetDatabaseCatalog(ctx context.Context, in *GetDatabaseCatalogRequest, opts ...grpc.CallOption) (*DatabaseCatalog, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(DatabaseCatalog)
+ err := c.cc.Invoke(ctx, DatabaseCatalogService_GetDatabaseCatalog_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *databaseCatalogServiceClient) UpdateDatabaseCatalog(ctx context.Context, in *UpdateDatabaseCatalogRequest, opts ...grpc.CallOption) (*DatabaseCatalog, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(DatabaseCatalog)
+ err := c.cc.Invoke(ctx, DatabaseCatalogService_UpdateDatabaseCatalog_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// DatabaseCatalogServiceServer is the server API for DatabaseCatalogService service.
+// All implementations must embed UnimplementedDatabaseCatalogServiceServer
+// for forward compatibility.
+type DatabaseCatalogServiceServer interface {
+ GetDatabaseCatalog(context.Context, *GetDatabaseCatalogRequest) (*DatabaseCatalog, error)
+ UpdateDatabaseCatalog(context.Context, *UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error)
+ mustEmbedUnimplementedDatabaseCatalogServiceServer()
+}
+
+// UnimplementedDatabaseCatalogServiceServer must be embedded to have
+// forward compatible implementations.
+//
+// NOTE: this should be embedded by value instead of pointer to avoid a nil
+// pointer dereference when methods are called.
+type UnimplementedDatabaseCatalogServiceServer struct{}
+
+func (UnimplementedDatabaseCatalogServiceServer) GetDatabaseCatalog(context.Context, *GetDatabaseCatalogRequest) (*DatabaseCatalog, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetDatabaseCatalog not implemented")
+}
+func (UnimplementedDatabaseCatalogServiceServer) UpdateDatabaseCatalog(context.Context, *UpdateDatabaseCatalogRequest) (*DatabaseCatalog, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateDatabaseCatalog not implemented")
+}
+func (UnimplementedDatabaseCatalogServiceServer) mustEmbedUnimplementedDatabaseCatalogServiceServer() {
+}
+func (UnimplementedDatabaseCatalogServiceServer) testEmbeddedByValue() {}
+
+// UnsafeDatabaseCatalogServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to DatabaseCatalogServiceServer will
+// result in compilation errors.
+type UnsafeDatabaseCatalogServiceServer interface {
+ mustEmbedUnimplementedDatabaseCatalogServiceServer()
+}
+
+func RegisterDatabaseCatalogServiceServer(s grpc.ServiceRegistrar, srv DatabaseCatalogServiceServer) {
+ // If the following call pancis, it indicates UnimplementedDatabaseCatalogServiceServer was
+ // embedded by pointer and is nil. This will cause panics if an
+ // unimplemented method is ever invoked, so we test this at initialization
+ // time to prevent it from happening at runtime later due to I/O.
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
+ t.testEmbeddedByValue()
+ }
+ s.RegisterService(&DatabaseCatalogService_ServiceDesc, srv)
+}
+
+func _DatabaseCatalogService_GetDatabaseCatalog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetDatabaseCatalogRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(DatabaseCatalogServiceServer).GetDatabaseCatalog(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: DatabaseCatalogService_GetDatabaseCatalog_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(DatabaseCatalogServiceServer).GetDatabaseCatalog(ctx, req.(*GetDatabaseCatalogRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _DatabaseCatalogService_UpdateDatabaseCatalog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateDatabaseCatalogRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(DatabaseCatalogServiceServer).UpdateDatabaseCatalog(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: DatabaseCatalogService_UpdateDatabaseCatalog_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(DatabaseCatalogServiceServer).UpdateDatabaseCatalog(ctx, req.(*UpdateDatabaseCatalogRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// DatabaseCatalogService_ServiceDesc is the grpc.ServiceDesc for DatabaseCatalogService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var DatabaseCatalogService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "bytebase.v1.DatabaseCatalogService",
+ HandlerType: (*DatabaseCatalogServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "GetDatabaseCatalog",
+ Handler: _DatabaseCatalogService_GetDatabaseCatalog_Handler,
+ },
+ {
+ MethodName: "UpdateDatabaseCatalog",
+ Handler: _DatabaseCatalogService_UpdateDatabaseCatalog_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "v1/database_catalog_service.proto",
+}
diff --git a/proto/v1/database_catalog_service.proto b/proto/v1/database_catalog_service.proto
new file mode 100644
index 0000000000..56f7fa30b9
--- /dev/null
+++ b/proto/v1/database_catalog_service.proto
@@ -0,0 +1,63 @@
+syntax = "proto3";
+
+package bytebase.v1;
+
+import "google/api/annotations.proto";
+import "google/api/client.proto";
+import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
+import "google/protobuf/field_mask.proto";
+import "v1/annotation.proto";
+
+option go_package = "generated-go/v1";
+
+service DatabaseCatalogService {
+ rpc GetDatabaseCatalog(GetDatabaseCatalogRequest) returns (DatabaseCatalog) {
+ option (google.api.http) = {get: "/v1/{name=instances/*/databases/*/catalog}"};
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.databaseCatalogs.get";
+ option (bytebase.v1.auth_method) = IAM;
+ }
+
+ rpc UpdateDatabaseCatalog(UpdateDatabaseCatalogRequest) returns (DatabaseCatalog) {
+ option (google.api.http) = {
+ patch: "/v1/{catalog.name=instances/*/databases/*/catalog}"
+ body: "catalog"
+ };
+ option (google.api.method_signature) = "catalog,update_mask";
+ option (bytebase.v1.permission) = "bb.databaseCatalogs.update";
+ option (bytebase.v1.auth_method) = IAM;
+ option (bytebase.v1.audit) = true;
+ }
+}
+
+message GetDatabaseCatalogRequest {
+ // The name of the database catalog to retrieve.
+ // Format: instances/{instance}/databases/{database}/catalog
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/DatabaseCatalog"}
+ ];
+}
+
+message UpdateDatabaseCatalogRequest {
+ // The database catalog to update.
+ //
+ // The catalog's `name` field is used to identify the database catalog to update.
+ // Format: instances/{instance}/databases/{database}/catalog
+ DatabaseCatalog catalog = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The list of fields to update.
+ google.protobuf.FieldMask update_mask = 2;
+}
+
+message DatabaseCatalog {
+ option (google.api.resource) = {
+ type: "bytebase.com/DatabaseCatalog"
+ pattern: "instances/{instance}/databases/{database}/catalog"
+ };
+
+ // The name of the database catalog.
+ // Format: instances/{instance}/databases/{database}/catalog
+ string name = 1;
+}