Skip to content

Simplify/streamline Options overrides,merges,inheritance between classes (admin and otherwise) #114

@sl-at-ibm

Description

@sl-at-ibm

There seems to be some redundancy in how the various CommandOptions (/subclasses) are handled between Admin, DBAdmin and Databases/Tables/Collections.

Database, for example, holds an array "optionsTree" that is then collapsed at each method invocation (via merge), applying the last layer (a possible cmdOptions provided to the method itself. Probably a list is not necessary here.

Similarly, classes hold a reference to other classes (e.g. DatabaseAdminAstra/DatabaseAdminAstra hold a DataAPIClient and a Database, Database holds a DataAPIClient, and so on) which may actually lead to contradictory options reachable from a given object, e.g. under useKeyspace invocation or simply spawn options being overridden. This might be better removed?

Care must be taken in ensuring options are always deep-copies when inherited between objects, as we do not want mutations (should they ever happen) to alter the settings of another object during its life.

Finally, should ensure that default keyspace stays undefined for non-Astra, forcing user to name one when they get a database from a client.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions