question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ConnectionString parsing

See original GitHub issue

In plenty of cases we receive connection strings for azure resources. We should port ConnectionString parser from iot sdk, so that it’s easier and more consistent to work with APIs https://github.com/Azure/azure-iot-sdk-python/blob/master/azure-iot-device/azure/iot/device/common/auth/connection_string.py

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
swathipilcommented, Mar 31, 2021

Hi @nfx,

The feature has been added and will be available in the next release. We did consider your proposed option of some sort of ConnectionString class, but ultimately decided that a parsing function is the best solution, as it provides validation that is generic enough for parsing connection strings across services and is simplest to use.

If you are looking for a ConnectionString class, specifically, Event Hubs already has the EventHubConnectionStringProperties class, which I believe is similar to what you are looking for. Storage does not seem to have a similar class, but we can create an issue for this if you still find this necessary.

Thank you for your feedback!

0reactions
swathipilcommented, Apr 16, 2021

Hi @nfx, in the core parse_connection_string method, we provide docstring and define the types of the input and type of the keys and values in the output dict. Documentation here.

In the Java example, it looks like there are four instance variables/properties on a ConnectionString, with only one key and one value, rather than parsed key/value pairs. I may be misunderstanding the kind of documentation you are looking for. Would you be able to clarify the purpose of the ConnectionString interface? (If you could provide a sample connection string that would be passed to the implementation of the ConnectionString and the return value of name(), value(), type(), and sticky(), that would be very helpful.)

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there any connection string parser in C#? - Stack Overflow
Yes, there's the System.Data.Common.DbConnectionStringBuilder class. The DbConnectionStringBuilder class provides the base class from which ...
Read more >
connection-string-parser - npm
Start using connection-string-parser in your project by running `npm i connection-string-parser` ... Install. npm i connection-string-parser ...
Read more >
DbConnectionStringBuilder.ConnectionString Property
The ConnectionString property of the DbConnectionStringBuilder class acts generally as a mechanism for creating and parsing semicolon-delimited lists of key/ ...
Read more >
tediousjs/connection-string: A connection string parsing library
The library comes with a generic connection string parser that will parse through valid connections strings and produce a key-value map of the...
Read more >
Quick Tip C#: How to parse any connection string?
DbConnectionStringBuilder is an inbuilt class from the Microsoft which allow us to parse connection string into KeyValue pair object. Please ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found