rebus-org / Rebus.PostgreSql

:bus: PostgreSQL persistence for Rebus
https://mookid.dk/category/rebus
Other
18 stars 20 forks source link

Schema/Owner Table Config Support #11

Closed davious closed 1 year ago

davious commented 5 years ago

Is there a way to configure the owner/schema of the rebus tables? If not, would you add that configuration option?

btw ❤️ and 👏 rebus and this plugin

mookid8000 commented 4 years ago

Hi @davious , I'm so sorry about the late reply!!

I am not that familiar with PostgreSQL... what is "the owner/schema of the schema/owner"?

And yes, I am definitely open to adding whichever configuration is needed to make the Postgres integration align better with common usage 🙂

davious commented 4 years ago

Hi @davious , I'm so sorry about the late reply!!

I am not that familiar with PostgreSQL... what is "the owner/schema of the schema/owner"?

And yes, I am definitely open to adding whichever configuration is needed to make the Postgres integration align better with common usage 🙂

Hi @mookid8000,

It's just the schema. I think in postgres it's public by default.

SELECT * FROM messages would work -- and SELECT * FROM public.messages would also work.

In SQL Server, the default is dbo.

And, what I what to do is keep the rebus tables in a separate rebus schema within the same database -- so it is nicely separated from my application's tables.

The concept is simple; my typo made it confusing. Sorry about that - I've updated my question -- "the owner/schema of the schema/owner" -> "the owner/schema".

mookid8000 commented 4 years ago

Ah, it makes sense then 😁 for Rebus' SQL Server transport I am currently working on making it possible to configure a schema for the transport, which will work as a namespace of sorts for all of the queue names.

The current version of the SQL Server transport accepts fully qualified queue names on the form [dbo].[my-queue], [rebus].[another-queue], etc., but it's actually kind of cumbersome to support that.... also it made the code using those names very hard to port to other queueing systems, so on this branch I started working on cleaning up the SQL transport.

With the new transport, you will configure the schema like this:

Configure.With(...)
    .Transport(t => t.UseSqlServer(connectionString, "my-queue")
        .WithSchema("rebus"))
    .Start();

Do you think something like that would work for the Postgres transport?

davious commented 4 years ago

Do you think something like that would work for the Postgres transport?

Yes. Precisely. 👌

zabulus commented 4 years ago

my 50 cents: SqlServer works if you specify <schemaname>.my-queue without any additional effort.

patrick11994 commented 1 year ago

This issue is resolved by PR #33 🚀