rebus-org / Rebus.SqlServer

:bus: Microsoft SQL Server transport and persistence for Rebus
https://mookid.dk/category/rebus
Other
43 stars 42 forks source link

Added support for tables schemas #5

Closed cleytonb closed 7 years ago

cleytonb commented 7 years ago

Support added by creating a TableName object which parses a string, stripping brackets, and stores the schema and table name.

When reading, the object has three properties: Schema (contains the schema), Name (contains the table name) and QualifiedName (concatenates schema and table name in [schema].[name] format).

Four tests were added to test the parse behavior.

It was also necessary to add checks before queries that creates something, because the schema might not exist.

All tests passing.

image


Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.

CLAassistant commented 7 years ago

CLA assistant check
All committers have signed the CLA.

mookid8000 commented 7 years ago

Hey @cleytonb , this is super cool!

I've installed @CLAassistant as an experiment – can I get you to sign off on the licensing thing? (you need to agree that the code you submit can be included in the Rebus code base on the same terms as all of the existing code).

If the @CLAassistant thing is annoying, please let me know – I want to make this process as smooth as possible.

cleytonb commented 7 years ago

The email I used when pushing was not the same as here. After adding the email to my account, I signed, but it seems that didn't count. Signed again today. It was pretty straightforward, no problems here.

mookid8000 commented 7 years ago

Excellent work! 💪

Thanks!

I'm gonna give the TableName an extra pass, as I could see that e.g. [schema with . in it].[table with . in it] would fool the parser 😄

mookid8000 commented 7 years ago

I'll release it as 2.1.0-b01 (i.e. as a prerelease version) for now – then you can try it out and see if it works for you.