001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to you under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package gudusoft.gsqlparser.ext.calcite.catalog; 018 019import org.checkerframework.checker.nullness.qual.Nullable; 020 021import java.util.List; 022 023/** 024 * Represents a schema in a database catalog. 025 * 026 * <p>A schema is a namespace that contains tables, views, and other database objects. 027 * 028 * <p>This is a standalone version that can be used independently of Apache Calcite. 029 */ 030public interface Schema { 031 /** 032 * Returns the name of the schema. 033 * 034 * @return Schema name 035 */ 036 String getName(); 037 038 /** 039 * Returns the catalog that this schema belongs to. 040 * 041 * @return Catalog 042 */ 043 Catalog getCatalog(); 044 045 /** 046 * Returns all tables in this schema. 047 * 048 * @return List of tables 049 */ 050 List<Table> getTables(); 051 052 /** 053 * Returns a table by name, or null if not found. 054 * 055 * @param tableName Table name (case-sensitive) 056 * @return Table, or null 057 */ 058 @Nullable Table getTable(String tableName); 059 060 /** 061 * Returns all table names in this schema. 062 * 063 * @return List of table names 064 */ 065 List<String> getTableNames(); 066}