MarketSquare / MarketSquare/Robotframework-Database-Library
Self managed connections
@amochin is already working on this.
Since Oct 21, 2025.
- Dominant language
- Python
- Stars
- 179
- Forks
- 178
- PR merge metrics
- No merged PRs in 30d
Description
One of the major problems with using libraries like DatabaseLibrary is managing the connection. If we implement #149, it could cause additional problems. Typically QA need to implement following logic:
Connect To Database (...)
Query
[Teardown] Disconnect Connection
But often Disconnect Connection is not in teardown (so the connection can remain open after test fails), we could several long running connections even if we're not querying for anything. For that reason we could add optional option for 'self managed connection' - in short, we could open and close connection each time we perform an query.
The default behaviour of the library will not change, it will be only extra option that will open/close connection if it doesn't exist.
*** Settings ***
Library DatabaseLibrary auto_connect=${True}
Suite Setup Configure Connection ${params} # need to configure default connection
*** Test Cases ***
Test 1
Query SELECT * FROM table1 # will open and close connection on its own
Test 2
Query SELECT * FROM table2 # will open and close connection on its own
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.