//
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto2";

package zetasql;

import "zetasql/proto/function.proto";
import "zetasql/proto/options.proto";
import "zetasql/public/simple_connection.proto";
import "zetasql/public/simple_constant.proto";
import "zetasql/public/simple_model.proto";
import "zetasql/public/simple_table.proto";
import "zetasql/public/type.proto";

option java_package = "com.google.zetasql";
option java_outer_classname = "SimpleCatalogProtos";

message SimpleCatalogProto {
  message NamedTypeProto {
    optional string name = 1;
    optional TypeProto type = 2;
  }

  optional string name = 1;
  repeated SimpleTableProto table = 2;
  repeated NamedTypeProto named_type = 3;
  repeated SimpleCatalogProto catalog = 4;
  // Specify built-in functions to load.
  optional ZetaSQLBuiltinFunctionOptionsProto builtin_function_options = 5;
  repeated FunctionProto custom_function = 6;
  repeated TableValuedFunctionProto custom_tvf = 9;
  // The index of the FileDescriptorSet in the top-level request proto.
  // If set, SimpleCatalog::SetDescriptorPool will be called with the
  // DescriptorPool deserialized from the referred FileDescriptorSet.
  optional int32 file_descriptor_set_index = 7 [default = -1];
  repeated ProcedureProto procedure = 8;
  repeated SimpleConstantProto constant = 10;
  repeated SimpleConnectionProto connection = 12;
  repeated SimpleModelProto model = 13;
}
