ensure proper table creation in session::create_schema including foreign key constraints
This commit is contained in:
@@ -13,27 +13,28 @@
|
||||
namespace matador::sql {
|
||||
class connection_impl;
|
||||
|
||||
const auto null_logger = std::make_shared<null_sql_logger>();
|
||||
|
||||
/**
|
||||
* @brief The connection class represents a connection to a database.
|
||||
*/
|
||||
class connection final : public executor {
|
||||
public:
|
||||
using logger_ptr = std::shared_ptr<abstract_sql_logger>;
|
||||
/**
|
||||
* @brief Creates a database connection from a connection info data.
|
||||
* @brief Creates a database connection from connection info data.
|
||||
*
|
||||
* @param info The database connection info data
|
||||
* @param sql_logger The logging handler
|
||||
*/
|
||||
explicit connection(connection_info info,
|
||||
const std::shared_ptr<abstract_sql_logger> &sql_logger = std::make_shared<null_sql_logger>());
|
||||
explicit connection(connection_info info, const logger_ptr &sql_logger = null_logger);
|
||||
/**
|
||||
* @brief Creates a database connection from a connection string.
|
||||
*
|
||||
* @param dns The database connection string
|
||||
* @param sql_logger The logging handler
|
||||
*/
|
||||
explicit connection(const std::string &dns,
|
||||
const std::shared_ptr<abstract_sql_logger> &sql_logger = std::make_shared<null_sql_logger>());
|
||||
explicit connection(const std::string &dns, const logger_ptr &sql_logger = null_logger);
|
||||
/**
|
||||
* Copies a given connection
|
||||
*
|
||||
@@ -66,8 +67,8 @@ public:
|
||||
/**
|
||||
* @brief Opens the database connection for the given dns.
|
||||
*
|
||||
* Opens the database connection. If database connection
|
||||
* couldn't be opened an exception is thrown.
|
||||
* Opens the database connection. If the database connection
|
||||
* couldn't be opened, an exception is thrown.
|
||||
*/
|
||||
[[nodiscard]] utils::result<void, utils::error> open() const;
|
||||
/**
|
||||
@@ -77,11 +78,11 @@ public:
|
||||
*/
|
||||
[[nodiscard]] utils::result<void, utils::error> close() const;
|
||||
/**
|
||||
* @brief Returns true if database connection is open.
|
||||
* @brief Returns true if the database connection is open.
|
||||
*
|
||||
* Returns true if database connection is open
|
||||
* Returns true if the database connection is open
|
||||
*
|
||||
* @return True on open database connection.
|
||||
* @return True on an open database connection.
|
||||
*/
|
||||
[[nodiscard]] utils::result<bool, utils::error> is_open() const;
|
||||
|
||||
@@ -95,7 +96,7 @@ public:
|
||||
/**
|
||||
* @brief Return the database type of the connection.
|
||||
*
|
||||
* Returns the database type of the connection which is
|
||||
* Returns the database type of the connection, which is
|
||||
* currently one of
|
||||
* - mssql
|
||||
* - mysql
|
||||
@@ -108,21 +109,21 @@ public:
|
||||
|
||||
/**
|
||||
* @brief Starts a transaction by calling the
|
||||
* underlying database backends transaction begin
|
||||
* underlying database backends a transaction begin
|
||||
* statement.
|
||||
*/
|
||||
[[nodiscard]] utils::result<void, utils::error> begin() const;
|
||||
|
||||
/**
|
||||
* @brief Commits a transaction by calling the
|
||||
* underlying database backends transaction commit
|
||||
* underlying database backends a transaction commit
|
||||
* statement.
|
||||
*/
|
||||
[[nodiscard]] utils::result<void, utils::error> commit() const;
|
||||
|
||||
/**
|
||||
* @brief Rollback a transaction by calling the
|
||||
* underlying database backends transaction rollback/abort
|
||||
* @brief Roll back a transaction by calling the
|
||||
* underlying database backends transaction rollback or abort
|
||||
* statement.
|
||||
*/
|
||||
[[nodiscard]] utils::result<void, utils::error> rollback() const;
|
||||
|
||||
Reference in New Issue
Block a user