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.catalog; 018 019import java.util.List; 020 021/** 022 * Represents a schema in a database catalog. 023 * 024 * <p>A schema is a namespace that contains tables, views, and other database objects. 025 * 026 * <p>Originally derived from Apache Calcite's catalog interfaces. 027 */ 028public interface Schema { 029 /** 030 * Returns the name of the schema. 031 * 032 * @return Schema name 033 */ 034 String getName(); 035 036 /** 037 * Returns the catalog that this schema belongs to. 038 * 039 * @return Catalog 040 */ 041 Catalog getCatalog(); 042 043 /** 044 * Returns all tables in this schema. 045 * 046 * @return List of tables 047 */ 048 List<Table> getTables(); 049 050 /** 051 * Returns a table by name, or null if not found. 052 * 053 * @param tableName Table name (case-sensitive) 054 * @return Table, or null 055 */ 056 Table getTable(String tableName); 057 058 /** 059 * Returns all table names in this schema. 060 * 061 * @return List of table names 062 */ 063 List<String> getTableNames(); 064}