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 019/** 020 * Represents a column in a database table. 021 * 022 * <p>Originally derived from Apache Calcite's catalog interfaces. 023 */ 024public interface Column { 025 /** 026 * Returns the name of the column. 027 * 028 * @return Column name 029 */ 030 String getName(); 031 032 /** 033 * Returns the SQL type name of the column (e.g., "VARCHAR", "INTEGER", "DECIMAL"). 034 * 035 * @return SQL type name 036 */ 037 String getTypeName(); 038 039 /** 040 * Returns the ordinal position of the column in the table (1-based). 041 * 042 * @return Ordinal position 043 */ 044 int getOrdinalPosition(); 045 046 /** 047 * Returns whether the column allows NULL values. 048 * 049 * @return true if nullable, false otherwise 050 */ 051 boolean isNullable(); 052 053 /** 054 * Returns the column size (e.g., VARCHAR length, INTEGER precision). 055 * 056 * @return Column size, or null if not applicable 057 */ 058 Integer getSize(); 059 060 /** 061 * Returns the number of decimal digits (for numeric types). 062 * 063 * @return Decimal digits, or null if not applicable 064 */ 065 Integer getDecimalDigits(); 066 067 /** 068 * Returns the default value of the column. 069 * 070 * @return Default value, or null if none 071 */ 072 String getDefaultValue(); 073 074 /** 075 * Returns the comment or description of the column. 076 * 077 * @return Column comment, or null if none 078 */ 079 String getComment(); 080}