Skip to content

Feature Request: Make project friendlier to build schemas #70

Description

@Spikhalskiy
  1. For some reason, the classes that need to be used for the creation of schemas from scratch had been moved into an internal _classes package. This is not conventional. According to the doc, these classes originally were in a public package, which makes more sense: https://github.com/Vanderhoof/PyDBML/blob/6781ccfb1fc636d8076af09d2098c44609ce7dd0/docs/creating_schema.md

  2. It would be great if main classes got a sort of copy() method that creates a detached instance from the parent entity, with all the main fields (and children) copied.
    For example, a copy() of Database should create a complete deep copy of the entities.
    At the same time, a copy() of a column should return a column with the same name, type, and notes. But detached from the parent table, like

def copy(self) -> Column:
    Column(
          name=self.name,
          type=self.type,
          unique=self.unique,
          not_null=self.not_null,
          pk=self.pk,
          autoinc=self.autoinc,
          default=self.default,
          note=self.note,
          comment=self.comment,
          properties=self.properties.copy()
    )

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions