42 lines
665 B
C++
Executable File
42 lines
665 B
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "ngldb_export.h"
|
|
#include <QString>
|
|
|
|
|
|
|
|
namespace DBCommon
|
|
{
|
|
|
|
enum class eDatabaseSchema
|
|
{
|
|
Exercise
|
|
};
|
|
|
|
|
|
|
|
inline QString getExerciseSchemaName(int exerciseId)
|
|
{
|
|
return QLatin1String("ex_") + QString::number(exerciseId);
|
|
}
|
|
|
|
|
|
|
|
inline QString getTableName(const QString &tableName, const QString &schemaName)
|
|
{
|
|
if (schemaName.isEmpty())
|
|
return tableName;
|
|
return schemaName + QLatin1Char('.') + tableName;
|
|
}
|
|
|
|
|
|
|
|
inline QString getExerciseTableName(const QString &tableName, int exerciseId)
|
|
{
|
|
return getTableName(tableName, getExerciseSchemaName(exerciseId));
|
|
}
|
|
}
|