Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RENAMED: Additional spacing breaks ProviderName support in connectionString #33

Closed
ericwonglc opened this issue Sep 29, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@ericwonglc
Copy link

Hi Mike,

I am trying out your Mighty ORM in .net core environment.

My code:
string connectionString = "data source = localhost; initial catalog = LegalBO; User Id = sa; Password = abc; persist security info = False; packet size = 4096; ProviderName=System.Data.SqlClient;";

    MightyOrm groups = new MightyOrm(connectionString, "S53Groups", "RecPk");
    dynamic group = await groups.Single(1);

I receive this error code:

   InvalidOperationException: Cannot find ProviderName=... in connection string passed to MightyOrm

Could you please help me to get it right? Thank you very much.

Best regards,
Eric Wong

@mikebeaton
Copy link
Member

Can you try without all the additional extra spacing in your connection string, i.e.:

string connectionString = "data source=localhost;initial catalog=LegalBO;User Id=sa;Password=abc;persist security info=False;packet size=4096;ProviderName=System.Data.SqlClient;"

I think that should get you working.

I haven't seen a connection string done like that, with all that spacing in, before, but if the rest of it works for you normally, spaced like that, then you're correct that Mighty should support ProviderName spaced the same way, so that needs fixing.

@mikebeaton mikebeaton added the bug Something isn't working label Sep 29, 2020
@mikebeaton
Copy link
Member

PS In the next full version of Mighty I'm going to support optionally passing in provider name in a separate parameter, but that isn't available yet.

@ericwonglc
Copy link
Author

ericwonglc commented Sep 29, 2020 via email

@mikebeaton
Copy link
Member

mikebeaton commented Sep 29, 2020

I'm glad you've got it going already! I would imagine that's working because by putting it first you don't have a space before the word ProviderName, which I'm still guessing is what is breaking it.

I'll look into this, and leave this open as a bug for now.

That nobody's reported this before I think must be because most people just use tightly spaced connection strings, which is all I've ever seen in examples, etc.! But I'll double-check, and assuming the more loosely spaced version works on the underlying providers then yes, of course, Mighty should also work with it. (And even if not, the error message you got isn't as helpful as it could be, given what you passed.)

Finally, as with any open source project, I can't give you any guarantee. I do this voluntarily, and there's only one of me (as was the case with Rob Conery and then Frans Bouma on Massive, on which Mighty is fundamentally based). But yes, my current plan is to continue to maintain and support this project for at least the next several years. It took quite a bit of work to get it to this stage, and I'd like to see it used!

@mikebeaton mikebeaton changed the title ConnectionString for use in .Net Core RENAMED: Additional spacing breaks ProviderName support in connectionString Sep 29, 2020
@ericwonglc
Copy link
Author

ericwonglc commented Sep 29, 2020 via email

@mikebeaton
Copy link
Member

mikebeaton commented Sep 29, 2020

I'm using it in production myself, it has a comprehensive test suite (inherited from and extended from the one in Massive) to ensure that continuing upgrades don't change or break anything, and I'm planning to support it. It's also pretty fast. So yes, I consider it production ready.

If I was to mention one thing then, as far as I know, Mighty hasn't been load tested on a massively high throughput site (I mean 10,000s or upwards of requests per second). If you were planning to use it for that, you should probably be writing your own load tests anyway (and feel free to submit any results or code back to the project!). I'm genuinely not aware of any specific issues here, just giving you fair warning that if I was to mention one thing that I don't know that it does okay, it's that.

In the end, however, you need to bear in mind the license, and make your own assessment based on the history, functionality, usage, support, repository activity, etc. of the project - and compare this to any other free or non-free, open or non-open alternatives you might be considering - as you should with any free, open source software!

@ericwonglc
Copy link
Author

ericwonglc commented Sep 29, 2020 via email

@mikebeaton
Copy link
Member

@ericwonglc I double-checked and you are completely right that all Mighty's supported providers accept connection strings spaced out as you were doing it - so Mighty should definitely have accepted what you originally provided.

I've just updated it with a fix, so you can space your connection string in any standard way you prefer now. 😎

https://www.nuget.org/packages/Mighty/3.1.3

Thanks for flagging that up.

@ericwonglc
Copy link
Author

ericwonglc commented Oct 5, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants