Compare commits

..

2 commits

Author SHA1 Message Date
f848d380fc fix ocr violations 2026-01-15 23:35:57 +01:00
6c7ca2fec4 build pqxx with lib 2025-01-24 12:09:49 +01:00
6 changed files with 36 additions and 13 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "third-party/libpqxx"]
path = third-party/libpqxx
url = https://github.com/jtv/libpqxx

View file

@ -69,6 +69,8 @@ set(CMAKE_INSTALL_PREFIX $ENV{ACT_HOME} CACHE PATH "installation path" FORCE)
add_subdirectory(src)
add_subdirectory(third-party/libpqxx build-pqxx EXCLUDE_FROM_ALL)
# Link the needed libraries into it
target_link_libraries(
${PROJECT_NAME}
@ -79,7 +81,7 @@ target_link_libraries(
# Add the Postgresql library
target_link_libraries(
${PROJECT_NAME}
-lpqxx -lpq
pqxx
)
# specify install targets

View file

@ -223,6 +223,11 @@ class SimConfigArtifact: public Artifact {
const bool& has_reference = has_reference_;
inline void set_prolog (std::vector<std::string> prolog) { this->prolog = prolog; };
inline void set_epilog (std::vector<std::string> epilog) { this->epilog = epilog; };
inline std::vector<std::string>& get_prolog () { return this->prolog; };
inline std::vector<std::string>& get_epilog () { return this->epilog; };
/**
* @brief Can this simulation be handled by multiple nodes
*
@ -244,6 +249,8 @@ class SimConfigArtifact: public Artifact {
bool has_reference_;
std::vector<testcase_t> testcases;
std::vector<std::string> prolog;
std::vector<std::string> epilog;
};
/** Reference to a signal in an ACT design */

View file

@ -21,8 +21,7 @@
**************************************************************************
*/
#ifndef __DB_TYPES_HPP__
#define __DB_TYPES_HPP__
#pragma once
#include <iomanip>
#include <pqxx/pqxx>
@ -184,9 +183,6 @@ struct std::hash<db::uuid_t> {
\
\
template<> \
std::string const type_name<T>{name}; \
\
template<> \
struct nullness<T> : pqxx::no_null<T> {}; \
\
template<> \
@ -271,7 +267,9 @@ struct std::hash<db::uuid_t> {
}; \
}; \
};
// template<>
// std::string const type_name<T>{name};
//
/**
* @brief Conversion extension for uuid_t for the pqxx library
@ -281,9 +279,6 @@ struct std::hash<db::uuid_t> {
*/
namespace pqxx {
template<>
std::string const type_name<db::uuid_t>{"uuid_t"};
template<>
struct nullness<db::uuid_t> : pqxx::no_null<db::uuid_t> {};
@ -344,6 +339,3 @@ struct string_traits<db::uuid_t> {
};
DB_REGISTER_ENUM_CLASS(db::JobStatusType, db::job_status_type_st, "job_status_type");
#endif

18
src/db_types.cpp Normal file
View file

@ -0,0 +1,18 @@
#include "db_types.hpp"
#include <pqxx/pqxx>
/**
* @brief Conversion extension for uuid_t for the pqxx library
*
* For more information see https://libpqxx.readthedocs.io/en/7.4.1/a01360.html
*
*/
namespace pqxx {
template<>
std::string const type_name<db::JobStatusType>{"job_status_type"};
template<>
std::string const type_name<db::uuid_t>{"uuid_t"};
};

1
third-party/libpqxx vendored Submodule

@ -0,0 +1 @@
Subproject commit 6af956bb48167ed1e71cc0f0c2d8c8fdc99151a3