sql_model module

class sql_model.OmnetppTableModel[source]

Bases: object

This contains the SQLAlchemy model definitions for the tables in the OMNet++ SQLite databases. See here for the concepts and classes used for this model.

Every table definition is preceded by the SQL statement used for creating the table. Please note that not all relational dependencies have been implemented as the model is used for reading data, not for modifying the database.

metadata = MetaData()
runAttr_table = Table('runAttr', MetaData(), Column('rowId', Integer(), table=<runAttr>, primary_key=True, nullable=False), Column('runId', Integer(), ForeignKey('run.runId'), table=<runAttr>, nullable=False), Column('attrName', String(), table=<runAttr>, nullable=False), Column('attrValue', String(), table=<runAttr>, nullable=False), schema=None)

Equivalent SQLite statement:

CREATE TABLE runAttr ( runId       INTEGER  NOT NULL REFERENCES run(runId) ON DELETE CASCADE
                      , attrName    TEXT NOT NULL
                      , attrValue   TEXT NOT NULL );
runConfig_table = Table('runConfig', MetaData(), Column('rowId', Integer(), table=<runConfig>, primary_key=True, nullable=False), Column('runId', Integer(), ForeignKey('run.runId'), table=<runConfig>, nullable=False), Column('configKey', String(), table=<runConfig>, nullable=False), Column('configValue', String(), table=<runConfig>, nullable=False), Column('configOrder', Integer(), table=<runConfig>, nullable=False), schema=None)

Equivalent SQLite statement:

CREATE TABLE runConfig ( runId       INTEGER NOT NULL REFERENCES run(runId) ON DELETE CASCADE
                       , configKey    TEXT NOT NULL
                       , configValue  TEXT NOT NULL
                       , configOrder  INTEGER NOT NULL );
runParam_table = Table('runParam', MetaData(), Column('rowId', Integer(), table=<runParam>, primary_key=True, nullable=False), Column('runId', Integer(), ForeignKey('run.runId'), table=<runParam>, nullable=False), Column('paramKey', String(), table=<runParam>, nullable=False), Column('paramValue', String(), table=<runParam>, nullable=False), Column('paramOrder', Integer(), table=<runParam>, nullable=False), schema=None)

Equivalent SQLite statement:

CREATE TABLE runParam ( runId       INTEGER NOT NULL REFERENCES run(runId) ON DELETE CASCADE
                       , paramKey    TEXT NOT NULL
                       , paramValue  TEXT NOT NULL
                       , paramOrder  INTEGER NOT NULL );
run_table = Table('run', MetaData(), Column('runId', Integer(), table=<run>, primary_key=True, nullable=False), Column('runName', String(), table=<run>, nullable=False), Column('simtimeExp', Integer(), table=<run>, nullable=False), schema=None)

Equivalent SQLite statement:

CREATE TABLE run ( runId       INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
                  , runName     TEXT NOT NULL
                  , simtimeExp  INTEGER NOT NULL );
scalar_table = Table('scalar', MetaData(), Column('scalarId', Integer(), table=<scalar>, primary_key=True, nullable=False), Column('runId', Integer(), table=<scalar>, nullable=False), Column('moduleName', String(), table=<scalar>, nullable=False), Column('scalarName', String(), table=<scalar>, nullable=False), Column('scalarValue', Float(), table=<scalar>), schema=None)

Equivalent SQLite statement:

CREATE TABLE scalar ( scalarId      INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
                     , runId         INTEGER  NOT NULL REFERENCES run(runId) ON DELETE CASCADE
                     , moduleName    TEXT NOT NULL
                     , scalarName    TEXT NOT NULL
                     , scalarValue   REAL );
statistic_table = Table('statistic', MetaData(), Column('statId', Integer(), table=<statistic>, primary_key=True, nullable=False), Column('runId', Integer(), table=<statistic>, nullable=False), Column('moduleName', String(), table=<statistic>, nullable=False), Column('statName', String(), table=<statistic>, nullable=False), Column('isHistogram', Integer(), table=<statistic>, nullable=False), Column('isWeighted', Integer(), table=<statistic>, nullable=False), Column('statCount', Integer(), table=<statistic>, nullable=False), Column('statMean', Float(), table=<statistic>), Column('statStddev', Float(), table=<statistic>), Column('statSum', Float(), table=<statistic>), Column('statSqrsum', Float(), table=<statistic>), Column('statMin', Float(), table=<statistic>), Column('statMax', Float(), table=<statistic>), Column('statWeights', Float(), table=<statistic>), Column('statWeightedSum', Float(), table=<statistic>), Column('statSqrSumWeights', Float(), table=<statistic>), Column('statWeightedSqrSum', Float(), table=<statistic>), schema=None)

Equivalent SQLite statement:

CREATE TABLE statistic ( statId        INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
                        , runId         INTEGER NOT NULL REFERENCES run(runId) ON DELETE CASCADE
                        , moduleName    TEXT NOT NULL, statName      TEXT NOT NULL
                        , isHistogram   INTEGER NOT NULL
                        , isWeighted    INTEGER NOT NULL
                        , statCount     INTEGER NOT NULL
                        , statMean      REAL
                        , statStddev    REAL
                        , statSum       REAL
                        , statSqrsum    REAL
                        , statMin       REAL
                        , statMax       REAL
                        , statWeights          REAL
                        , statWeightedSum      REAL
                        , statSqrSumWeights    REAL
                        , statWeightedSqrSum   REAL );
vectorData_table = Table('vectorData', MetaData(), Column('rowId', Integer(), table=<vectorData>, primary_key=True, nullable=False), Column('vectorId', Integer(), ForeignKey('vector.vectorId'), table=<vectorData>, nullable=False), Column('eventNumber', Integer(), table=<vectorData>, nullable=False), Column('simtimeRaw', Integer(), table=<vectorData>, nullable=False), Column('value', Float(), table=<vectorData>), schema=None)

Equivalent SQLite statement:

CREATE TABLE vectorData ( vectorId      INTEGER NOT NULL REFERENCES vector(vectorId) ON DELETE CASCADE
                         , eventNumber   INTEGER NOT NULL
                         , simtimeRaw    INTEGER NOT NULL
                         , value         REAL );
vector_table = Table('vector', MetaData(), Column('vectorId', Integer(), table=<vector>, primary_key=True, nullable=False), Column('moduleName', String(), table=<vector>, nullable=False), Column('vectorName', String(), table=<vector>, nullable=False), schema=None)

Equivalent SQLite statement:

CREATE TABLE vector ( vectorId        INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
                     , runId           INTEGER NOT NULL REFERENCES run(runId) ON DELETE CASCADE
                     , moduleName      TEXT NOT NULL, vectorName      TEXT NOT NULL
                     , vectorCount     INTEGER
                     , vectorMin       REAL
                     , vectorMax       REAL
                     , vectorSum       REAL
                     , vectorSumSqr    REAL
                     , startEventNum   INTEGER
                     , endEventNum     INTEGER
                     , startSimtimeRaw INTEGER
                     , endSimtimeRaw   INTEGER );