Skip to content

Commit 7aa1a57

Browse files
author
Saumya Garg
committed
adding comments
1 parent ba286db commit 7aa1a57

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

mssql_python/pybind/connection/connection.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
// Implements the Connection class declared in connection.h.
5-
// This class wraps low-level ODBC operations like connect/disconnect,
6-
// transaction control, and autocommit configuration.
7-
84
#include "connection.h"
95
#include <iostream>
106

7+
//-------------------------------------------------------------------------------------------------
8+
// Implements the Connection class declared in connection.h.
9+
// This class wraps low-level ODBC operations like connect/disconnect,
10+
// transaction control, and autocommit configuration.
11+
//-------------------------------------------------------------------------------------------------
1112
Connection::Connection(const std::wstring& conn_str) : _conn_str(conn_str) {}
1213

1314
Connection::~Connection() {
14-
close();
15+
LOG("Connection destructor called");
16+
close(); // Ensure the connection is closed when the object is destroyed.
1517
}
1618

1719
SQLRETURN Connection::connect() {
@@ -39,11 +41,11 @@ SQLRETURN Connection::end_transaction(SQLSMALLINT completion_type) {
3941
}
4042

4143
SQLRETURN Connection::set_autocommit(bool enable) {
42-
LOG("Setting autocommit mode C++");
44+
LOG("Setting autocommit mode");
4345
// to be added
4446
}
4547

4648
bool Connection::get_autocommit() const {
47-
LOG("Getting autocommit mode C++");
49+
LOG("Getting autocommit mode");
4850
// to be added
4951
}

0 commit comments

Comments
 (0)