AbsaOSS / ultet

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

Creation of the model of DBItems #6

Closed benedeki closed 7 months ago

benedeki commented 1 year ago

Background

Once the source files has been identified they need to be changed to a tree of the model representing all kind of DBItems

Feature

Provided the list of files and DB connection build up the model, resulting in a tree of `DBItems, returning the tree root.

It's up to your consideration what will be the function signature. If to accept a list of strings as file names. Or to get another structure like a Map[String, Seq[String] + rootPath where the keys of the map are the schemas and sequences the files within.

Also up to your consideration if related 'DBItem's are created recursively or explicitly by this function. E,g, the DBUserItem which is the owner of a function will be returned as part of the DBFunctionFromSource creation. Or explicitly called in this function because it known a function has an owner and list of users. (Probably the slightly preferred option is the recursive approach).

Proposed Solution

Sets for collections seem to be an effective way to do, to ensure same items are not there multiple times.

NB! Database creation has to be done on a different connection than all the other steps. But perhaps we can skip the DB creation at the moment or do it explicitly before calling this function.

NB! Issue of schema merging. (Let's discuss when we get to it)

Depends on #

jakipatryk commented 1 year ago

Tables part still TODO.