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

Ability to customize column sizes for subscription storage #6

Open mookid8000 opened 7 years ago

mookid8000 commented 7 years ago

Because column sizes are tricky when they are NVARCHARs and they are used in an index, it should be possible to configure the sizes.

It could look like this:

Configure.With(...)
    .Transport(t => (...))
    .Subscriptions(s => {
        s.StoreInSqlServer(..., "Subscriptions")
            .SetColumnSizes(topicColumnSize: 350, addressColumnSize: 50);
    })
    .Start();

which would then create the schema accordingly.

Moreover, a warning could be logged or an error could be thrown if the schema reflection in Initialize detects that the schema does not match the sizes specified in the Customize... thing.