|
- #pragma once
-
- #include "../classes/schema/schema.h"
-
- namespace cpphibernate {
- namespace mariadb {
-
- struct driver_t;
-
- /**
- * @brief Actual implementation of the mariadb driver.
- *
- * This class is used/owner by the mariadb driver class (as a member).
- * The public interface of this class will not be part of the cpphibernate context.
- */
- struct driver_impl_t
- {
- driver_t& owner;
- schema_ptr_u schema;
-
- /**
- * @brief Constructor.
-
- * @param[in] p_owner Object the driver implementation is owned by.
- * @param[in] p_schema Cpphibernate schema to use with the driver.
- */
- template<typename T_schema>
- inline driver_impl_t(driver_t& p_owner, T_schema&& p_schema);
-
- /**
- * @brief Initialize the schema in the database.
- *
- * @param[in] recreate Recreate the whole schema (this will drop all existing data).
- */
- inline void init(bool recreate) const;
-
- /**
- * @brief Create a new dataset in the database.
- * This will update the primary key field of the passed dataset.
- *
- * @param[in] dataset Dataset to create in the database.
- */
- template<typename T_dataset>
- inline void create(T_dataset& dataset) const;
-
- /**
- * @brief Read datasets from the database.
- *
- * @param[in] dataset Dataset to read from the database.
- * @param[in] modifiers Modifiers to apply to the select query.
- */
- template<typename T_dataset, typename T_modifiers>
- inline void read(T_dataset& dataset, const T_modifiers& modifiers) const;
-
- /**
- * @brief Update an exsisting dataset in the database.
- *
- * @param[in] dataset Dataset to update in the database.
- */
- template<typename T_dataset>
- inline void update(T_dataset& dataset) const;
-
- /**
- * @brief Destroy an exsisting dataset in the database.
- *
- * @param[in] dataset Dataset to destroy in the database.
- */
- template<typename T_dataset>
- inline void destroy(T_dataset& dataset) const;
- };
-
- } }
|