DataReader is a struct which holds a reference to the database, transaction options and a logger. It is responsible for reading data from the database.
| 25 | // DataReader is a struct which holds a reference to the database, transaction options and a logger. |
| 26 | // It is responsible for reading data from the database. |
| 27 | type DataReader struct { |
| 28 | database *db.Postgres // database is an instance of the PostgreSQL database |
| 29 | txOptions pgx.TxOptions // txOptions specifies the isolation level for database transaction and sets it as read only |
| 30 | } |
| 31 | |
| 32 | // NewDataReader is a constructor function for DataReader. |
| 33 | // It initializes a new DataReader with a given database, a logger, and sets transaction options to be read-only with Repeatable Read isolation level. |
nothing calls this directly
no outgoing calls
no test coverage detected