Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cca74b24

Von Christian Ehringfeld vor fast 6 Jahren hinzugefügt

  • ID cca74b2439a47e6548d012eb67a2d3d6f6388107
  • Vorgänger 3da0a096
  • Nachfolger 85fe847f

imp

Unterschiede anzeigen:

samples/simple/main.cpp
QSharedPointer<CuteEntityManager::EntityManager> e =
QSharedPointer<CuteEntityManager::EntityManager>(new
CuteEntityManager::EntityManager("QSQLITE",
QDir::currentPath() + "/db.sqlite"));
QDir::currentPath() + "/db.sqlite","","","test"));
QStringList inits = QStringList() << "Article";
e->startup("0.1", inits);
QSharedPointer<Article> a = QSharedPointer<Article>(new Article(5.0,
src/database.cpp
switch (db) {
case DatabaseType::SQLITE:
return new SqliteSchema(database);
break;
// case PGSQL:
// return QSharedPointer<Schema>(new PgSqlSchema());
// break;
case DatabaseType::MYSQL:
return new MysqlSchema(database);
break;
default:
return new SqliteSchema(database);
break;
}
}
src/entitymanager.cpp
hostname,
databasename, username,
password,
port.toInt(), true, logQueries, databaseOptions, logActions));
port.toInt(), logQueries, true, databaseOptions, logActions));
this->init(inspectEntities, logActions);
}
src/schema/sqliteschema.cpp
SqliteSchema::SqliteSchema(QSharedPointer<Database> database) : Schema(
database, QSharedPointer<QueryBuilder>(new SqliteQueryBuilder(this, database))) {
if(this->tables.empty()) {
QStringList inits = QStringList() << "PRAGMA locking_mode = EXCLUSIVE;"<<"PRAGMA synchronous = 1;" << "PRAGMA journal_mode = WAL;" << "PRAGMA wal_autocheckpoint = 16;" << "PRAGMA journal_size_limit = 1536;" << "PRAGMA temp_store = MEMORY;" << "PRAGMA foreign_keys = ON;";
database->exec(inits);
}
}
SqliteSchema::~SqliteSchema() {

Auch abrufbar als: Unified diff