Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SQL] Support create table SQL statement. #424

Open
dongzl opened this issue Sep 25, 2022 · 2 comments
Open

[SQL] Support create table SQL statement. #424

dongzl opened this issue Sep 25, 2022 · 2 comments
Assignees
Labels
SQL SQL support
Milestone

Comments

@dongzl
Copy link
Contributor

dongzl commented Sep 25, 2022

What would you like to be added:

Why is this needed:

https://dev.mysql.com/doc/refman/8.0/en/create-table.html

@dongzl dongzl added the SQL SQL support label Sep 25, 2022
@dongzl dongzl modified the milestones: 0.1.0, 0.2.0 Sep 25, 2022
@jjeffcaii
Copy link
Contributor

之前想过这么几个方案,假设 create table foo ...

  1. 检查配置规则里有没有这个foo逻辑表,如果有,则按照其拓扑来创建所有物理子表(这里需要检查下片键字段),如果没有,在0号库上透传创建单表
  2. 默认在0号库上透传创建单表,除非检测到HINT,比如: /*A! 设计一种表述拓扑的方式 */ create table foo...,按指定拓扑来创建表

@dongzl
Copy link
Contributor Author

dongzl commented Feb 25, 2023

1、非命中shadow rule,非命中sharding rule:穿透到0库建表;
2、非命中shadow rule,命中sharding rule:建分区表;
3、命中shadow rule,非命中sharding rule:穿透到0库建影子表;
4、命中shadow rule,命中sharding rule:建影子分区表;
只考虑物理表,不考虑逻辑表;

AlexStocks pushed a commit that referenced this issue Apr 18, 2023
* add node config support (#464)

* Support MySQL CAST_CHAR function.

* format style

* Support MySQL CAST_TIME function. (#570)

* Support MySQL CAST_DATE function. (#569)

* Support MySQL CAST_DATETIME function. (#568)

* Support MySQL CAST_TIME/CAST_DATE/CAST_DATETIME function

* Resolve Conversation

* Support CREATE TABLE

* add: IfNotExists

* fix: reformat imports

* Resolve Conversation
@dongzl dongzl modified the milestones: 0.2.0, 0.3.0 Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SQL SQL support
Projects
None yet
Development

No branches or pull requests

3 participants