Data-Test-Executer Framework speziell zum Test von Datenverarbeitungen mit Datengenerierung, Systemvorbereitungen, Einspielungen, ganzheitlicher diversifizierender Vergleich
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

2 years ago
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------------------------------------
# Author : Ulrich Carmesin
# Source : gitea.ucarmesin.de
# ---------------------------------------------------------------------------------------------------------
import basic.toolHandling
import utils.data_const as D
import basic.constants as B
2 years ago
import model.entity
2 years ago
ddl = {
"user": {
"id": {
D.DDL_TYPE: D.TYPE_PK,
},
"username": {
D.DDL_TYPE: D.TYPE_STR,
},
"password": {
D.DDL_TYPE: D.TYPE_STRING,
}
}
}
2 years ago
class User(model.entity.Entity):
2 years ago
username = ""
password = ""
def __init__(self, job):
"""
to be initialized by readSpec
:param job:
"""
self.job = job
self.conf = {}
self.conf[B.SUBJECT_CONN] = self.getDbAttr(job)
self.conf[B.DATA_NODE_DDL] = self.getDdl(job, ddl)
self.m = job.m
2 years ago
2 years ago
def get_schema(self):
2 years ago
dbtype = self.job.conf[B.TOPIC_NODE_DB][B.ATTR_TYPE]
2 years ago
dbi = basic.toolHandling.getDbTool(self.job, None, dbtype)
sql = dbi.getCreateTable("user")
sql += dbi.getSchemaAttribut("id", "id")+","
sql += dbi.getSchemaAttribut("username", D.TYPE_STR)+","
sql += dbi.getSchemaAttribut("password", D.TYPE_STR)
sql += ");\n"
return sql