Skip to content

Commit

Permalink
feat(jans-linux-setup): multivalued json enhancement (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar authored Mar 23, 2022
1 parent a0740df commit b8fb658
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 0 additions & 6 deletions jans-linux-setup/jans_setup/setup_app/installers/rdbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ def local_install(self):

def get_sql_col_type(self, attrname, table=None):

for attr_ in self.jans_attributes:
if attrname in attr_['names'] and attr_.get('multivalued'):
if Config.rdbm_type == 'spanner':
return 'ARRAY<STRING(MAX)>'
return 'JSON'

if attrname in self.dbUtils.sql_data_types:
type_ = self.dbUtils.sql_data_types[attrname].get(Config.rdbm_type) or self.dbUtils.sql_data_types[attrname]['mysql']
if table in type_.get('tables', {}):
Expand Down
4 changes: 4 additions & 0 deletions jans-linux-setup/jans_setup/setup_app/utils/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ def read_jans_schema(self, others=[]):
self.opendj_attributes_syntax = base.readJsonFile(os.path.join(Config.static_rdbm_dir, 'opendj_attributes_syntax.json'))
self.sub_tables = base.readJsonFile(os.path.join(Config.static_rdbm_dir, 'sub_tables.json'))

for attr in attribDataTypes.listAttributes:
if not attr in self.sql_data_types:
self.sql_data_types[attr] = { 'mysql': {'type': 'JSON'}, 'spanner': {'type': 'ARRAY<STRING(MAX)>'} }

def in_subtable(self, table, attr):
if table in self.sub_tables[Config.rdbm_type]:
for stbl in self.sub_tables[Config.rdbm_type][table]:
Expand Down

0 comments on commit b8fb658

Please sign in to comment.