apache / apache/datafusion-sqlparser-rs
Support `CREATE TYPE` for creating custom type
- 主要语言
- Rust
- 星标
- 3.5k
- 派生
- 772
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 17
描述
Hello, I think it would be nice to add `CREATE TYPE` statement for creating custom composite type.
### Use cases
```sql
-- Defining composite type
CREATE TYPE inventory_item AS (
name text,
supplier_id integer,
price numeric
);
-- Using composite type `inventory_item`
CREATE TABLE on_hand (
item inventory_item,
count integer
);
INSERT INTO on_hand VALUES (ROW('fuzzy dice', 42, 1.99), 1000);
```
### References
- Postgres: https://www.postgresql.org/docs/current/sql-createtype.html
- SQL server: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-type-transact-sql?view=sql-server-ver16
贡献指南
这个仓库没有索引到贡献指南
调研方向
未指定实现文件或测试。首先定位 parser 的入口点和 CREATE 语句的 AST 定义,然后检查方言特有的语法是如何表示的。当 PostgreSQL 示例中的复合 CREATE TYPE 语句能够成功解析,并且受支持的语法有测试覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust, sql
- 领域
- compilers, databases
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100