Skip to content

Bug: Dot in schema name #1015

@adanek

Description

@adanek

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" />

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfixedThe bug, issue, incident has been fixed.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions