Lot of code for generating code. Working on unit tests.
This commit is contained in:
parent
da45929b12
commit
8f4845d4d2
42 changed files with 1089 additions and 267 deletions
28
pglablib/codebuilder/CodeBuilder.h
Normal file
28
pglablib/codebuilder/CodeBuilder.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef CODEBUILDER_H
|
||||
#define CODEBUILDER_H
|
||||
|
||||
#include "Pgsql_declare.h"
|
||||
#include <QString>
|
||||
|
||||
class LanguageConfig;
|
||||
class QTextStream;
|
||||
|
||||
class CodeBuilder {
|
||||
public:
|
||||
void GenCodeForExecutingQuery(QTextStream &q, const QString &query, const Pgsql::Result &result);
|
||||
void GenReturnStructDefinition(QTextStream &q, const Pgsql::Result &result) const;
|
||||
|
||||
// Generating code for performing query and going through the result
|
||||
// - Code for executing the query
|
||||
// - Code for looping the result
|
||||
// - Code for processing a single row
|
||||
// - Declaration of struct for holding single row result
|
||||
QString columnNameToVariableName(QString column_name) const;
|
||||
QString getTypeName(Oid dbtype) const;
|
||||
private:
|
||||
std::shared_ptr<const LanguageConfig> m_configuration;
|
||||
|
||||
void genFieldDeclaration(QTextStream &q, const QString &format, const QString &column_name, Oid column_type) const;
|
||||
};
|
||||
|
||||
#endif // CODEBUILDER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue