Skip to content

GetCreateTablesScriptAsync in Sql Server provider table name splitting issue #69

Description

@ErikEJ
var splittedTableNames = tables.Select(t =>
{
    var parts = t.Split('.', StringSplitOptions.TrimEntries);
    var schema = parts[0].TrimStart('[').TrimEnd(']');
    var name = parts[1].TrimStart('[').TrimEnd(']');
    return new { Schema = schema, Name = name };
});

This can "easily" break, as this is a valid CREATE TABLE statement:

CREATE TABLE "[.[Ew!l💩]"
(
	Id int
)

One possible solution could be to create an abstraction like:

public class Table
{
   string? Schema { get; set;}
   string Name { get; set;}
}

Happy to create a PR if interested?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions