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