forked from opengaussexamples/examples
revise create table document
This commit is contained in:
parent
189d3db242
commit
c379bd2e85
|
|
@ -4,8 +4,8 @@
|
||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="d8d12963-4777-48e3-9669-309cf5e41d60" name="更改" comment="add alter table ast class">
|
<list default="true" id="d8d12963-4777-48e3-9669-309cf5e41d60" name="更改" comment="add alter table parser">
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/Lexer/OracleLexer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Lexer/OracleLexer.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|
@ -103,20 +103,6 @@
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1723106789329</updated>
|
<updated>1723106789329</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="init">
|
|
||||||
<created>1723106890550</created>
|
|
||||||
<option name="number" value="00001" />
|
|
||||||
<option name="presentableId" value="LOCAL-00001" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1723106890550</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00002" summary="lexer">
|
|
||||||
<created>1723818930161</created>
|
|
||||||
<option name="number" value="00002" />
|
|
||||||
<option name="presentableId" value="LOCAL-00002" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1723818930161</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00003" summary="AST node">
|
<task id="LOCAL-00003" summary="AST node">
|
||||||
<created>1723871742424</created>
|
<created>1723871742424</created>
|
||||||
<option name="number" value="00003" />
|
<option name="number" value="00003" />
|
||||||
|
|
@ -446,7 +432,21 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1726153977485</updated>
|
<updated>1726153977485</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="50" />
|
<task id="LOCAL-00050" summary="add alter table keywords">
|
||||||
|
<created>1726154243358</created>
|
||||||
|
<option name="number" value="00050" />
|
||||||
|
<option name="presentableId" value="LOCAL-00050" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1726154243360</updated>
|
||||||
|
</task>
|
||||||
|
<task id="LOCAL-00051" summary="add alter table parser">
|
||||||
|
<created>1726154479052</created>
|
||||||
|
<option name="number" value="00051" />
|
||||||
|
<option name="presentableId" value="LOCAL-00051" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1726154479052</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="52" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
|
@ -461,8 +461,6 @@
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="add functions" />
|
|
||||||
<MESSAGE value="add parser function" />
|
|
||||||
<MESSAGE value="add function" />
|
<MESSAGE value="add function" />
|
||||||
<MESSAGE value="coding" />
|
<MESSAGE value="coding" />
|
||||||
<MESSAGE value="finish the framework of sqltranslate (createTab sql is now being supported!)" />
|
<MESSAGE value="finish the framework of sqltranslate (createTab sql is now being supported!)" />
|
||||||
|
|
@ -486,7 +484,9 @@
|
||||||
<MESSAGE value="add Delete" />
|
<MESSAGE value="add Delete" />
|
||||||
<MESSAGE value="add alter table grammar document" />
|
<MESSAGE value="add alter table grammar document" />
|
||||||
<MESSAGE value="add alter table ast class" />
|
<MESSAGE value="add alter table ast class" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="add alter table ast class" />
|
<MESSAGE value="add alter table keywords" />
|
||||||
|
<MESSAGE value="add alter table parser" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="add alter table parser" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<watches-manager>
|
<watches-manager>
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
NOT NULL
|
|
||||||
用于指定某列不允许为空。
|
|
||||||
示例:column_name VARCHAR2(50) NOT NULL
|
|
||||||
PRIMARY KEY
|
|
||||||
用于指定某列为表的主键,主键列必须唯一且不能为空。
|
|
||||||
示例:column_name NUMBER(10) PRIMARY KEY
|
|
||||||
UNIQUE
|
|
||||||
用于指定某列的值必须是唯一的,但允许为空。
|
|
||||||
示例:column_name VARCHAR2(50) UNIQUE
|
|
||||||
CHECK
|
|
||||||
用于指定某列上的值必须满足一个条件。
|
|
||||||
示例:column_name NUMBER CHECK (column_name > 0)
|
|
||||||
FOREIGN KEY
|
|
||||||
用于定义外键约束,外键引用另一个表的主键或唯一键。
|
|
||||||
示例:column_name NUMBER(10) REFERENCES other_table(other_column)
|
|
||||||
DEFAULT
|
|
||||||
用于指定某列如果没有给定值时的默认值。
|
|
||||||
示例:column_name VARCHAR2(50) DEFAULT 'default_value'
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
PRIMARY KEY
|
|
||||||
用于定义表的主键,主键列必须唯一且不能为空。
|
|
||||||
可以定义单个列或多个列作为复合主键。
|
|
||||||
示例:CONSTRAINT pk_example PRIMARY KEY (column1, column2)
|
|
||||||
UNIQUE
|
|
||||||
用于定义列的唯一性约束,允许为空。
|
|
||||||
可以定义在单个列或多列上。
|
|
||||||
示例:CONSTRAINT uk_example UNIQUE (column1)
|
|
||||||
FOREIGN KEY
|
|
||||||
用于定义外键约束,外键引用另一个表的主键或唯一键。
|
|
||||||
示例:CONSTRAINT fk_example FOREIGN KEY (column1) REFERENCES other_table(column2)
|
|
||||||
CHECK
|
|
||||||
用于定义整个表的一个或多个列上的约束条件。
|
|
||||||
示例:CONSTRAINT chk_example CHECK (column1 > 0)
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class OracleParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CREATE TEMPORARY? TABLE _table ( _column _type [, _column _type]... ) [CONSTRAINT _constraint] [, _column _type [, _column _type]...]
|
* CREATE TEMPORARY? TABLE _table ( (_column _type column_constraint), (_column _type column_constraint)* table_constraint?)
|
||||||
*/
|
*/
|
||||||
private ASTNode parseCreateTab(List<Token> parseTokens) {
|
private ASTNode parseCreateTab(List<Token> parseTokens) {
|
||||||
List <Token> tokens = new ArrayList<>();
|
List <Token> tokens = new ArrayList<>();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue