Skip to content

Unsafe table names generate invalid ts file #104

@anup-the-magic

Description

@anup-the-magic

If we have table names that, on the db side, need to be quoted, the generated type names end up being invalid typescript names. Not certain what the ideal end result should be, but just figured this was worth documenting.

for instance:

CREATE TABLE "has spaces" (id int not null);
CREATE TABLE "has-dashes" (id int not null);

Produces

export namespace has spacesFields {
  export type id = number;
}
export interface has spaces {
  id: has spacesFields.id;
}
export namespace has-dashesFields {
  export type id = number;
}
export interface has-dashes {
  id: has-dashes.id;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions