AbsaOSS / ultet

Database deployment tool
Apache License 2.0
3 stars 0 forks source link

Diff function for two tables #12

Closed benedeki closed 7 months ago

benedeki commented 1 year ago

Background

This is the analysis function, that will identify how an alter the table to get it to the desired state.

Feature

Create a diff function - could be named - ` whose result is an sequence of SQL entries to alter the table into the desired shape.

Proposed Solution [Optional]

Function signature

def -(other: Option[DBTable]): Seq[SQLEntry] = {
// if (other.isEmpty) start with table creation expression
}

NB! SQLExpression is basically an just a string, but probably within a hierarchy of classes because of ordering of operations.

Depends on AbsaOSS/ultet#16

dk1844 commented 1 year ago

Notes: (Table from file minus table from DB)

DBTable.-(Option[DBTable]) - only for structure, so result is (if other not none): seq[alter table]

benedeki commented 8 months ago

This item depends on: