# Path: pyelt/datalayers/database.py
# class Columns():
#     class TextColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'text', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class TextArrayColumn(Column):
#         #voorlopig deze gewoon op type text laten staan. Misschien later aanpassen naar text[]
#         def __init__(self, name:str = '', default_value=None, fhir_name=''):
#             super().__init__(name, 'text', default_value=default_value, fhir_name=fhir_name)
# 
#     class RefColumn(Column):
#         def __init__(self,  valueset_name:str,name:str = '', default_value='', nullable=True, fhir_name=''):
#             super().__init__(name, 'text', default_value=default_value, indexed=True, nullable=nullable, fhir_name=fhir_name)
#             self.valueset_name = valueset_name
# 
#     class DateTimeColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'timestamp', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class DateColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'date', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class IntColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'integer', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class SerialColumn(Column):
#         def __init__(self, name:str = ''):
#             super().__init__(name, 'SERIAL', pk=True)
# 
#     class FloatColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'numeric', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class BoolColumn(Column):
#         def __init__(self, name:str = '' , default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'bool', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class JsonColumn(Column):
#         def __init__(self, name:str = '' , default_value={}, fhir_name=''):
#             super().__init__(name, 'jsonb', default_value=default_value, fhir_name=fhir_name)
# 
#     class FHIR():
#         # voorlopig onderstaande  gewoon op type text laten staan. Misschien later aanpassen naar fhire types
#         class PeriodColumn(Column):
#             def __init__(self, name: str = '', default_value=None):
#                 super().__init__(name, 'text', default_value=default_value)
#                 # super().__init__(name, 'fhir.period', default_value=default_value)
# 
#         class CodingColumn(Column):
#             def __init__(self, name: str = '', default_value=None):
#                 super().__init__(name, 'text', default_value=default_value)
#                 # super().__init__(name, 'fhir.coding', default_value=default_value)
# 
#         class CodeableConceptColumn(Column):
#             def __init__(self, name: str = '', default_value=None):
#                 super().__init__(name, 'text', default_value=default_value)
#                 # super().__init__(name, 'fhir.codeable_concept', default_value=default_value)
# 
# Path: pyelt/datalayers/dv.py
# class AbstractOrderderTable(Table, metaclass=OrderedTableMetaClass):
#     """De colummen die zijn opgegeven blijven gesorteerd"""
# 
#     @classmethod
#     def cls_create_dbname(cls):
#         """override deze methode in subclasses"""
#         return cls.__dbname__
# 
#     @classmethod
#     def cls_get_name(cls) -> str:
#         """Geeft database name terug
#         :return: return __dbname__
#         :rtype: str"""
#         return cls.__dbname__
# 
#     @classmethod
#     def cls_get_schema(cls, db) -> 'Schema':
#         """Geeft schema object terug. met daarin een gekoppelde db. Je kunt dit object reflecten"""
#         schema_name = cls.__dbschema__
#         schema = db.get_schema(schema_name)
#         return schema
# 
#     @classmethod
#     def cls_get_columns(cls) -> List[Column]:
#         """:return: return __cols__
#         :rtype: List[Column]"""
#         return cls.__cols__
# 
#     @classmethod
#     def cls_get_key(cls) -> List[Column]:
#         """:return: return __cols__
#         :rtype: List[Column]"""
#         key = [col.name for col in cls.__cols__ if col.is_key]
#         return key


from pyelt.datalayers.database import Columns
from pyelt.datalayers.dv import AbstractOrderderTable


class Sys():
    class Runs(AbstractOrderderTable):
        __dbschema__ = 'sys'

# Path: pyelt/datalayers/database.py
# class Columns():
#     class TextColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'text', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class TextArrayColumn(Column):
#         #voorlopig deze gewoon op type text laten staan. Misschien later aanpassen naar text[]
#         def __init__(self, name:str = '', default_value=None, fhir_name=''):
#             super().__init__(name, 'text', default_value=default_value, fhir_name=fhir_name)
# 
#     class RefColumn(Column):
#         def __init__(self,  valueset_name:str,name:str = '', default_value='', nullable=True, fhir_name=''):
#             super().__init__(name, 'text', default_value=default_value, indexed=True, nullable=nullable, fhir_name=fhir_name)
#             self.valueset_name = valueset_name
# 
#     class DateTimeColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'timestamp', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class DateColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'date', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class IntColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'integer', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class SerialColumn(Column):
#         def __init__(self, name:str = ''):
#             super().__init__(name, 'SERIAL', pk=True)
# 
#     class FloatColumn(Column):
#         def __init__(self, name:str = '', default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'numeric', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class BoolColumn(Column):
#         def __init__(self, name:str = '' , default_value='', pk = False, unique = False, indexed=False, nullable=True, fhir_name=''):
#             super().__init__(name, 'bool', default_value=default_value, pk=pk, unique=unique, indexed=indexed, nullable=nullable, fhir_name=fhir_name)
# 
#     class JsonColumn(Column):
#         def __init__(self, name:str = '' , default_value={}, fhir_name=''):
#             super().__init__(name, 'jsonb', default_value=default_value, fhir_name=fhir_name)
# 
#     class FHIR():
#         # voorlopig onderstaande  gewoon op type text laten staan. Misschien later aanpassen naar fhire types
#         class PeriodColumn(Column):
#             def __init__(self, name: str = '', default_value=None):
#                 super().__init__(name, 'text', default_value=default_value)
#                 # super().__init__(name, 'fhir.period', default_value=default_value)
# 
#         class CodingColumn(Column):
#             def __init__(self, name: str = '', default_value=None):
#                 super().__init__(name, 'text', default_value=default_value)
#                 # super().__init__(name, 'fhir.coding', default_value=default_value)
# 
#         class CodeableConceptColumn(Column):
#             def __init__(self, name: str = '', default_value=None):
#                 super().__init__(name, 'text', default_value=default_value)
#                 # super().__init__(name, 'fhir.codeable_concept', default_value=default_value)
# 
# Path: pyelt/datalayers/dv.py
# class AbstractOrderderTable(Table, metaclass=OrderedTableMetaClass):
#     """De colummen die zijn opgegeven blijven gesorteerd"""
# 
#     @classmethod
#     def cls_create_dbname(cls):
#         """override deze methode in subclasses"""
#         return cls.__dbname__
# 
#     @classmethod
#     def cls_get_name(cls) -> str:
#         """Geeft database name terug
#         :return: return __dbname__
#         :rtype: str"""
#         return cls.__dbname__
# 
#     @classmethod
#     def cls_get_schema(cls, db) -> 'Schema':
#         """Geeft schema object terug. met daarin een gekoppelde db. Je kunt dit object reflecten"""
#         schema_name = cls.__dbschema__
#         schema = db.get_schema(schema_name)
#         return schema
# 
#     @classmethod
#     def cls_get_columns(cls) -> List[Column]:
#         """:return: return __cols__
#         :rtype: List[Column]"""
#         return cls.__cols__
# 
#     @classmethod
#     def cls_get_key(cls) -> List[Column]:
#         """:return: return __cols__
#         :rtype: List[Column]"""
#         key = [col.name for col in cls.__cols__ if col.is_key]
#         return key


# Path: pyelt/datalayers/sys.py
from pyelt.datalayers.database import Columns
from pyelt.datalayers.dv import AbstractOrderderTable



class Sys():
    class Runs(AbstractOrderderTable):
        __dbschema__ = 'sys'

        runid = Columns.FloatColumn(pk=True)