|
| 1 | +// Copyright (c) Microsoft Corporation. |
| 2 | +// Licensed under the MIT license. |
| 3 | + |
| 4 | +// INFO|TODO - Note that is file is Windows specific right now. Making it arch agnostic will be |
| 5 | +// taken up in future |
| 6 | + |
| 7 | +#include "connection.h" |
| 8 | +#include <iostream> |
| 9 | + |
| 10 | +//------------------------------------------------------------------------------------------------- |
| 11 | +// Implements the Connection class declared in connection.h. |
| 12 | +// This class wraps low-level ODBC operations like connect/disconnect, |
| 13 | +// transaction control, and autocommit configuration. |
| 14 | +//------------------------------------------------------------------------------------------------- |
| 15 | +Connection::Connection(const std::wstring& conn_str) : _conn_str(conn_str) {} |
| 16 | + |
| 17 | +Connection::~Connection() { |
| 18 | + LOG("Connection destructor called"); |
| 19 | + close(); // Ensure the connection is closed when the object is destroyed. |
| 20 | +} |
| 21 | + |
| 22 | +SQLRETURN Connection::connect() { |
| 23 | + LOG("Connecting to MSSQL"); |
| 24 | + // to be added |
| 25 | +} |
| 26 | + |
| 27 | +SQLRETURN Connection::close() { |
| 28 | + LOG("Disconnect from MSSQL"); |
| 29 | + // to be added |
| 30 | +} |
| 31 | + |
| 32 | +SQLRETURN Connection::commit() { |
| 33 | + LOG("Committing transaction"); |
| 34 | + // to be added |
| 35 | +} |
| 36 | + |
| 37 | +SQLRETURN Connection::rollback() { |
| 38 | + LOG("Rolling back transaction"); |
| 39 | + // to be added |
| 40 | +} |
| 41 | + |
| 42 | +SQLRETURN Connection::end_transaction(SQLSMALLINT completion_type) { |
| 43 | + // to be added |
| 44 | +} |
| 45 | + |
| 46 | +SQLRETURN Connection::set_autocommit(bool enable) { |
| 47 | + LOG("Setting autocommit mode"); |
| 48 | + // to be added |
| 49 | +} |
| 50 | + |
| 51 | +bool Connection::get_autocommit() const { |
| 52 | + LOG("Getting autocommit mode"); |
| 53 | + // to be added |
| 54 | +} |
0 commit comments