Enhancement: Parsed connection strings proxy
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, typescript
- Domain
- backend-api-design
Research direction
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.
Written by the indexing model from the issue text.
Description
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
}
});
- Dominant language
- TypeScript
- Stars
- 9
- Forks
- 6
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tediousjs/connection-string
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
tediousjs/connection-string#279 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tediousjs/connection-string#6 · 1 reaction ·
Maintainers usually reply within 2 days
All issues in tediousjs/connection-string
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
external-issue to-triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
diegosouzapw/OmniRoute#15401 ·
Maintainers usually reply within 2 days
-
Sign the pledgeOpen
Difficulty 1/5 Under an hour Newbie friendliness 95/100
input-output-hk/devx-updates#163 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
code-yeongyu/oh-my-openagent#9454 ·
Maintainers usually reply within 1 day