Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github: ddc
ko_fi: ddcsta
ko_fi: ddc
custom: "https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ"
3 changes: 0 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
## Summary
<!-- Brief description of what this PR does and why -->

## Changes Made
<!-- List the key changes -->

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
uv sync --locked --all-extras --dev --no-install-package mysqlclient --no-install-package aiomysql
elif [[ '${{ matrix.os }}' == 'macos-latest' ]]; then
export PKG_CONFIG_PATH="$(brew --prefix mysql-client)/lib/pkgconfig"
uv sync --locked --all-extras --group dev
uv sync --locked --all-extras --all-groups
else
uv sync --locked --all-extras --group dev
uv sync --locked --all-extras --all-groups
fi
shell: bash

Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y default-libmysqlclient-dev pkg-config

- name: Install dependencies
run: uv sync --locked --all-extras --group dev
run: uv sync --locked --all-extras --all-groups

- name: Install ODBC driver for MSSQL
run: |
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<a href="https://ko-fi.com/ddc"><img src="https://img.shields.io/badge/Ko--fi-ddc-FF5E5B?style=plastic&logo=kofi&logoColor=white&color=brightgreen" alt="Ko-fi"/></a>
<a href="https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ"><img src="https://img.shields.io/badge/Donate-PayPal-brightgreen.svg?style=plastic&logo=paypal&logoColor=white" alt="Donate"/></a>
<br>
<a href="https://pypi.python.org/pypi/ddcDatabases"><img src="https://img.shields.io/pypi/v/ddcDatabases.svg?style=plastic&logo=python&cacheSeconds=3600" alt="PyPi"/></a>
<a href="https://pepy.tech/projects/ddcDatabases"><img src="https://img.shields.io/pepy/dt/ddcDatabases?style=plastic&logo=pypi&logoColor=3776AB" alt="PyPI Downloads"/></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic&logo=creativecommons&logoColor=white" alt="License: MIT"/></a>
<br>
<a href="https://www.python.org/downloads"><img src="https://img.shields.io/pypi/pyversions/ddcDatabases.svg?style=plastic&logo=python&cacheSeconds=3600" alt="Python"/></a>
<a href="https://github.com/astral-sh/uv"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json&style=plastic" alt="uv"/></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&style=plastic" alt="Ruff"/></a>
<br>
<a href="https://pypi.python.org/pypi/ddcDatabases"><img src="https://img.shields.io/pypi/v/ddcDatabases.svg?style=plastic&logo=python&cacheSeconds=3600" alt="PyPi"/></a>
<a href="https://pepy.tech/projects/ddcDatabases"><img src="https://img.shields.io/pepy/dt/ddcDatabases?style=plastic&logo=pypi&logoColor=3776AB" alt="PyPI Downloads"/></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic&logo=creativecommons&logoColor=white" alt="License: MIT"/></a>
<br>
<a href="https://github.com/ddc/ddcDatabases/issues"><img src="https://img.shields.io/github/issues/ddc/ddcDatabases?style=plastic&logo=github&logoColor=white" alt="issues"/></a>
<a href="https://codecov.io/gh/ddc/ddcDatabases"><img src="https://img.shields.io/codecov/c/github/ddc/ddcDatabases?token=XWB53034GI&style=plastic&logo=codecov" alt="codecov"/></a>
<a href="https://sonarcloud.io/dashboard?id=ddc_ddcDatabases"><img src="https://img.shields.io/sonar/quality_gate/ddc_ddcDatabases?server=https%3A%2F%2Fsonarcloud.io&style=plastic&logo=sonarqubecloud&logoColor=white" alt="Quality Gate Status"/></a>
Expand Down
6 changes: 3 additions & 3 deletions ddcdatabases/core/configs.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import dataclasses
from dataclasses import dataclass
from typing import Any, TypeVar
from typing import Any, Final, TypeVar

_C = TypeVar("_C")

# Field maps for merging retry configs with settings
CONNECTION_RETRY_FIELD_MAP: dict[str, str] = {
CONNECTION_RETRY_FIELD_MAP: Final[dict[str, str]] = {
"enable_retry": "connection_enable_retry",
"max_retries": "connection_max_retries",
"initial_retry_delay": "connection_initial_retry_delay",
"max_retry_delay": "connection_max_retry_delay",
}

OPERATION_RETRY_FIELD_MAP: dict[str, str] = {
OPERATION_RETRY_FIELD_MAP: Final[dict[str, str]] = {
"enable_retry": "operation_enable_retry",
"max_retries": "operation_max_retries",
"initial_retry_delay": "operation_initial_retry_delay",
Expand Down
8 changes: 5 additions & 3 deletions ddcdatabases/core/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Final

# SSL Modes
POSTGRESQL_SSL_MODES: frozenset[str] = frozenset(
POSTGRESQL_SSL_MODES: Final[frozenset[str]] = frozenset(
{
"disable",
"allow",
Expand All @@ -10,7 +12,7 @@
}
)

MYSQL_SSL_MODES: frozenset[str] = frozenset(
MYSQL_SSL_MODES: Final[frozenset[str]] = frozenset(
{
"DISABLED",
"PREFERRED",
Expand All @@ -21,7 +23,7 @@
)

# Connection error keywords for retry logic
CONNECTION_ERROR_KEYWORDS: frozenset[str] = frozenset(
CONNECTION_ERROR_KEYWORDS: Final[frozenset[str]] = frozenset(
{
"connection",
"connect",
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packages = ["ddcdatabases"]

[project]
name = "ddcdatabases"
version = "4.0.1"
version = "4.0.2"
description = "Simplified database ORM connections with support for multiple database engines"
urls.Repository = "https://github.com/ddc/ddcDatabases"
urls.Homepage = "https://pypi.org/project/ddcDatabases"
Expand Down Expand Up @@ -53,7 +53,7 @@ classifiers = [
requires-python = ">=3.12"
dependencies = [
"pydantic-settings>=2.11.0",
"sqlalchemy[asyncio]>=2.0.48",
"sqlalchemy[asyncio]>=2.0.49",
]

[project.optional-dependencies]
Expand All @@ -68,9 +68,9 @@ mariadb = ["ddcdatabases[mysql]"]
[dependency-groups]
dev = [
"coverage>=7.13.5",
"poethepoet>=0.42.1",
"poethepoet>=0.43.0",
"pytest-asyncio>=1.3.0",
"ruff>=0.15.7",
"ruff>=0.15.9",
"testcontainers[postgres,mysql,mssql,mongodb,oracle]>=4.14.2",
]

Expand All @@ -83,7 +83,7 @@ profile-integration = "uv run python -m cProfile -o cprofile_integration.prof -m
test.sequence = [{ shell = "uv run coverage run -m pytest tests/unit" }, { shell = "uv run coverage report" }, { shell = "uv run coverage xml" }]
test-integration = "uv run pytest tests/integration"
tests.sequence = ["linter", "test", "test-integration"]
updatedev.sequence = ["linter", {shell = "uv lock --upgrade && uv sync --all-extras --group dev"}]
updatedev.sequence = ["linter", {shell = "uv lock --upgrade && uv sync --all-extras --all-groups"}]
build.sequence = ["updatedev", "tests", {shell = "uv build --wheel"}]

[tool.pytest.ini_options]
Expand Down
Loading
Loading