Support embed type annotation

オープン
#285 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
43/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
postgresql, rust, sql
領域
backend, databases

調査の方向性

Start by reading the SQL annotation examples in the issue and locating the parser and type-generation entry points for return type annotations; the payload does not name specific files or tests. Trace how a declared embed type such as Author maps to selected columns, then determine how the proposed Author + Country form should behave. Done means embedded return types are supported and covered by tests for the shown examples.

索引モデルが issue の本文から書いたものです。

説明

codegen feature parser

Migrated from halcyonnouveau/clorinde#139, originally reported by @Folyd on 2025-06-20.

For example:

--: Author(age?)

--! authors : Author
SELECT name, age FROM Authors;

--! authors_from_country (country?) : (age?)
SELECT a.*, COUNT(*) OVER() as total_count
FROM Authors as a
WHERE a.nationality = :country;

--! authors_from_country (country?) : Author
SELECT a.*, COUNT(*) OVER() as total_count
FROM Authors as a
WHERE a.nationality = :country;

The authors_from_country return all author columns plus an extra total_account, currently we need to declare (age?) as the type annotation. I hope to support embed another type into here, such as Author

Even further:

--: Author(age?)
--: Country(gdp?)
--! authors_from_country (country?) : Author + Country
SELECT a.*, 
c.*,
COUNT(*) OVER() as total_count
FROM Authors as a
FROM Country as c JOIN a.nationality = c.id
WHERE a.nationality = :country;
主要言語
Rust
スター
1.2k
フォーク
77
平均マージ
5日 12時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cornucopia-rs/cornucopia のほかの issue

cornucopia-rs/cornucopia の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。