Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Enhancement: Parsed connection strings proxy

Đang mở
#5 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, typescript
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Start with the parseSqlConnectionString entry point and review the linked MDN Proxy reference. The requested result should support the shown host, port, proto, alias, and case-insensitive property access while retaining the original connection-string values; the issue does not name any files or tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

Ideally a connection object should add some layer of abstraction around the parsed connection string. This would result in more than a simple map of key value pairs being returned and instead the object being queried and parsed in a more helpful way.

eg:


const { parseSqlConnectionString } = require('@tediousjs/connection-string');
const connStr = "Data Source=tcp:mydomain.com,1433";

const connectionObj = parseSqlConnectionString(connStr);

console.log(connectionObj.host); // mydomain.com
console.log(connectionObj.port); // 1433
console.log(connectionObj.proto); // tcp
console.log(connectionObj['data source']); // tcp:mydomain.com,1433
console.log(connectionObj.Addr); // tcp:mydomain.com,1433

This could be implemented as

const connStr = "Data Source=tcp:mydomain.com,1433";
const connectionObj = parseSqlConnectionString(connStr);
return new Proxy(connectionObj, {
    get: (target, prop, receiver) => {
        // special handling for some cases like alias props
        // special handling for computed props (eg: host, proto, port)
        // return case insensitive look up
    }
});
Ngôn ngữ chính
TypeScript
Star
9
Fork
6
Merge trung bình
1 ngày 6 giờ
Pull request đã merge (30 ngày)
13

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của tediousjs/connection-string

Tất cả issue của tediousjs/connection-string

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.