Hanja
Getting hanja characters for korean words
 
Loading...
Searching...
No Matches
src.database.DatabaseConnection Class Reference

A class to manage database connections using a context manager. More...

Collaboration diagram for src.database.DatabaseConnection:
Collaboration graph

Public Member Functions

 __enter__ (self)
 Establishes a connection to the SQLite database.
 
 __exit__ (self, exc_type, exc_val, exc_tb)
 Closes the database connection when exiting the context.
 

Public Attributes

 conn
 

Detailed Description

A class to manage database connections using a context manager.

Provides a convenient way to handle SQLite connections, ensuring the connection is properly closed after use.

Member Function Documentation

◆ __enter__()

src.database.DatabaseConnection.__enter__ (   self)

Establishes a connection to the SQLite database.

Returns
sqlite3.Connection object representing the database connection.

◆ __exit__()

src.database.DatabaseConnection.__exit__ (   self,
  exc_type,
  exc_val,
  exc_tb 
)

Closes the database connection when exiting the context.

Parameters
exc_valThe value of the exception (if any).
exc_typeThe type of the exception (if any).
exc_tbThe traceback of the exception (if any).

Member Data Documentation

◆ conn

src.database.DatabaseConnection.conn

The documentation for this class was generated from the following file: