SQL Parameter Detection and Substitution in Plan Editor
Maintainer thường phản hồi trong vòng 1 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
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- sql, typescript
Hướng nghiên cứu
Bắt đầu bằng cách đọc sqlParamDetector.ts, SqlParamPanel.vue và patch của EditorView.vue, sau đó lần theo luồng tải SQL lên của trình chỉnh sửa Plan. Xác nhận cách phát hiện sáu mẫu tham số được liệt kê, cách gửi các giá trị và cách tạo chuỗi EXEC của stored procedure; hoàn thành khi biểu mẫu inline xử lý được các trường hợp đó mà không yêu cầu chỉnh sửa SQL trực tiếp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem?
Yes. We are currently evaluating Bytebase for adoption at our organization. In our workflow, vendor-provided SQL scripts are handed over to developers who are responsible for submitting them as database changes. However, these developers should not need to modify the SQL scripts directly. They should only be able to fill in the required parameter values and submit. Without a built-in parameter detection and substitution feature, developers are forced to manually edit the SQL files before uploading, which breaks our intended workflow and introduces risk.
Describe the solution you'd like
When a SQL file is uploaded in the Plan editor, Bytebase should automatically detect parameters in the script and display an inline form where the user can fill in the required values before the change is submitted. The detection should cover the following common patterns:
Stored Procedures — parameters defined in CREATE OR ALTER PROCEDURE signatures
SSMS Template Format — placeholders like <ParameterName,DATETIME,YYYY-MM-DD>, which is the standard template syntax used in SQL Server Management Studio (SSMS)
DECLARE with template values — DECLARE @StartDate DATETIME = '<StartDate,DATETIME,YYYY-MM-DD>'
Bare parameter usage — @param references with no DECLARE block
EXEC with parameters — EXEC SP_NAME @param1, @param2
For stored procedures, the form should also generate a copyable EXEC string with the filled-in values.
We have already implemented a working proof of concept for this feature as a local customization in our Bytebase fork and are happy to contribute it as a pull request.
Additional context
We have implemented this as a proof of concept in our Bytebase fork. The implementation consists of three files:
sqlParamDetector.ts - a pure TypeScript utility that detects parameters across all 6 scenarios
SqlParamPanel.vue - a Vue component that renders the parameter input form inline in the editor
A small diff to EditorView.vue to trigger detection on SQL upload
The changes are self-contained and do not touch any core Bytebase functionality. We are happy to contribute this as a pull request if the team is interested.
- Ngôn ngữ chính
- TypeScript
- Star
- 14.7k
- Fork
- 1k
- Merge trung bình
- 7 giờ 23 phút
- Pull request đã merge (30 ngày)
- 454
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 bytebase/bytebase
-
BigQuery schema sync fails when ORDINAL_POSITION is NULLCó thể đã có người làm @tuyndoan đã nhận 89 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
bytebase/bytebase#21217 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Github
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Github
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature Github
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Unbounded goroutine/memory growth: 28k goroutines parked in MCP streamable session reads (OOM)Có thể đã có người làm @vsai12 đã nhận 19 ngày trước. Đang mởBug Github
bytebase/bytebase#21721 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bytebase/bytebase
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
e2e-failure ready-to-code
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
redhat-developer/rhdh-plugin-export-overlays#4794 · 1 bình luận ·
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 78/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 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: plugins documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
CatVinci-Studio/Textus#727 ·
Maintainer thường phản hồi trong vòng 1 ngày