spring-data-relational icon indicating copy to clipboard operation
spring-data-relational copied to clipboard

Ability to use non default schema in Microsoft sql

Open danielfosse opened this issue 4 years ago • 1 comments

In Microsoft SQL the default schema for tables is "dbo" but you can have other schemas also. When using r2dbc @Table(value="dbo.product") it works but when i use @Table(value="My_schema.product") i get error message io.r2dbc.mssql.ExceptionFactory$MssqlBadGrammarException: Invalid object name 'product'.

i tried adding the following:

@Bean
    NamingStrategy namingStrategy() {
        return new NamingStrategy() {
            @Override
            public String getSchema() {
                return "My_schema";
            }
        };
    }

but still get the same error

danielfosse avatar Feb 19 '21 09:02 danielfosse

We need to have a dedicated schema attribute in the @Table annotation.

schauder avatar Feb 25 '21 13:02 schauder

A separate schema attribute was introduced with d12146d78c54c4f65b0f420a36596395a747f586 which is part of the 2.4 release.

Could you please verify that this resolves the issue?

schauder avatar Sep 02 '22 10:09 schauder

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Sep 09 '22 10:09 spring-projects-issues

Hi, i can't verify this anymore

danielfosse avatar Sep 09 '22 12:09 danielfosse