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

Bug: Dot in schema name #1015

Closed
adanek opened this issue Dec 15, 2021 · 3 comments
Closed

Bug: Dot in schema name #1015

adanek opened this issue Dec 15, 2021 · 3 comments
Assignees
Labels
bug Something isn't working fixed The bug, issue, incident has been fixed.

Comments

@adanek
Copy link

adanek commented Dec 15, 2021

Bug Description

I get an error indicating that database fields are missing when I query data from a table like [A.B].[C]

Exception Message:

RepoDb.Exceptions.MissingFieldsException: There are no database fields found for table '[A.B].[C]'. Make sure that the target table '[A.B].[C]' is present in the database and/or at least a single field is available.

When I trace the connection with SQL Server Profiler i see that a table definition lookup is performed with the parameters

@Schema=N'A',@TableName=N'B.C'

I found a stack overflow article mentioning that a similar issue has been fixed for tables in version 1.0.13.
Avoiding the dot in the schema name is unfortunatly not an option for me.

Schema and Model:

CREATE TABLE [A.B].[C]
(
    [Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY, 
    [Name] NVARCHAR(50) NOT NULL
)

And also the model that corresponds the schema.

[Table("[C]", Schema = "[A.B]")]
public class MyDto
{
    public Guid Id { get; set; }
    public string Name { get; set; }
}

Library Version:

<PackageReference Include="RepoDb" Version="1.12.8" />
<PackageReference Include="RepoDb.SqlServer" Version="1.1.4" />
@adanek adanek added the bug Something isn't working label Dec 15, 2021
@mikependon
Copy link
Owner

Thanks for reporting this issue. We will look into this. We will make sure this will be part of the next beta release.

@mikependon mikependon pinned this issue Jan 14, 2022
mikependon added a commit that referenced this issue Jan 14, 2022
mikependon added a commit that referenced this issue Jan 14, 2022
mikependon added a commit that referenced this issue Jan 14, 2022
mikependon added a commit that referenced this issue Jan 14, 2022
@mikependon
Copy link
Owner

The fixes has been aded and it will be a part of the next release (> RepoDb.SqlServer v1.1.5-beta4).

@mikependon mikependon added the fixed The bug, issue, incident has been fixed. label Jan 14, 2022
@mikependon mikependon unpinned this issue Jan 14, 2022
@adanek
Copy link
Author

adanek commented Jan 17, 2022

Thank you very much!
I'm looking forward to give it a try.

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

No branches or pull requests

2 participants