Advice: typescript query builder
Maintainer thường phản hồi trong vòng 5 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- api
Hướng nghiên cứu
The issue describes a possible TypeScript query-builder client but names no repository files, tests, or entry points. First review PRQL’s type-system specification linked in the issue and the existing client-library structure; the issue asks for advice and adoption criteria rather than defining an implementation or a completion test.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What's up?
I want to build a query builder in typescript with exceptional, schema-aware type safety. TLDR something like this:
const penguins = prql.table('penguins', {
"species": "string",
"year": "int32",
"bill_length_mm": "float64",
})
const by_year_species = penguins
.group(
r => [r.col("species"), r.col("year")],
g => g
.filter(r => r.col("bill_length_mm").is_not_null())
.agg(
g => ({
count: prql.count(),
mean_length: g.col("bill_length_mm").mean(),
})
)
)
.sort(r => r.col("mean_length"))
.take(10)
const recent_longest_per_year = penguins
.group(
r => r.col("year"),
g => g.sort(r => r.col("bill_length_mm").desc()).take(1)
)
.filter(r => r.col("bill_length_mm").gt(50))
.derive(r => {
bill_length_cm = r.col("bill_length_mm").div(10), // yuck that we need .div() since typescript doesn't have operator overloading
version = prql.sql<"string">("version()"),
})
I am coming from experience maintaining https://github.com/ibis-project/ibis, which is similar to prql in the sense that it is mostly pipelined, but it really suffers from the root limitation that python doesn't have the complex typing system required to track a relations schema through transformations. It also is in python, and I want something that I can use on the web.
I also have used drizzle ORM and zod in some web projects, and I love the type safety they provide, and they demonstrate how much you can leverage advanced typescript features to get exceptional DX.
I started hacking a prototype implementation of the above together, but I was using duckb's json_deserialize_sql() function to compile my IR into SQL. But that was limiting me to duckdb only, and it was requiring a very SQL-like format, where my lib was working with a very pipeline-like format, so it was requiring a lot of complex transformation. Then I thought of PRQL, which is basically exactly the semantics I was looking for in the user-facing API, and it also has the compilation solved! So I want to pivot to using PRQL as the compiler, and while I'm at it align the semantics to be a 1:1 correspondence with PRQL (which I think are awesome semantics!).
A few things I'm looking for:
- Is there other prior art here that I should be looking at?
- If I try to actually implement a query builder with the above semantics, what do you think my biggest challenge would be?
- The above example relies on an explicit type system for all the scalars/columns in the relations. I read https://prql-lang.org/book/reference/spec/type-system.html, which is a great start, but it doesn't look like there was actually any decision made here. Is there something I can use as a spec to map these types 1:1 into typescript? PS, if any of your contributors want to see prior art on this topic, ibis had to solve a very similar problem of presenting a ibis datatype system that can be converted to/from the underlying backend's type sytem.
- If I do end up going for this, what would you need to see to be interested in adopting this under this repo as an official client library?
- Ngôn ngữ chính
- Rust
- Star
- 10.9k
- Fork
- 261
- Merge trung bình
- 4 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 77
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PRQL/prql
-
Underscore does not work as expectedCó thể đã có người làm @prql-bot đã nhận 6 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PRQL/prql#6518 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
prqlc Debug Report HTML Does Not Escape Source File Name, Enabling Stored XSS via PRQLC_DEBUG_LOGĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
PRQL/prql#6502 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Add `.prql` to linguistĐang mởfriendliness integrations
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
PRQL/prql#1636 · 2 bình luận · 2 reaction ·
Maintainer thường phản hồi trong vòng 5 ngày
-
review-runs-tracking: 2026-11Đang mởreview-runs-tracking
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 5/100
PRQL/prql#6513 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Formatted SQL adds spaces inside the next string literal after a string ending in a backslashCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 38/100
PRQL/prql#6500 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Non-`main` default branchesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
max-sixty/worktrunk#4727 · 7 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
carrick-sh/carrick#1859 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
crate: spate-kafka documentation priority: medium
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày