Ahjo

Latest version: v3.10.1

Safety actively analyzes 722032 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 7

3.5.0

Ability to connect with SQLAlchemy URL
Added support for connecting to database with [SQLAlchemy URL](https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls). The URL can be used to define more complex connection settings, e.g. [pyodbc connection attributes](https://learn.microsoft.com/en-us/sql/connect/odbc/dsn-connection-string-attribute?view=sql-server-ver16). Use `sqlalchemy.url` setting in config file to define the URL. If the URL is defined, it overrides the values of `dialect`, `sql_port`, `sql_driver`, `target_server_hostname` and `target_database_name`.

Support for SQLAlchemy engine configuration
Previously ahjo was hard-coded to use SQLAlchemy's default engine configuration. Now it is possible to customize the engine with SQLAlchemy's [create_engine](https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.create_engine) function parameters. The parameters can be defined in config file under `sqlalchemy.*` key. For example `sqlalchemy.pool_size: 10` is passed as pool_size=10 to `create_engine` function.

Support for SQLAlchemy URL query configuration
SQLAlchemy's class method `sqlalchemy.engine.URL.create` accepts a [query](https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.engine.URL.create.params.query) dictionary to be passed to the dialect and/or the DBAPI upon connect. The dictionary can be defined in ahjo config file under `sqla_url_query_map` key. The dictionary can be used for example to define [pyodbc connection attributes](https://learn.microsoft.com/en-us/sql/connect/odbc/dsn-connection-string-attribute?view=sql-server-ver16).

ODBC Driver 18 for SQL Server support
In previous versions, support for ODBC Driver 18 for SQL Server was limited due to hard-coded connection attributes. Now this has been fixed and the driver is supported.

The ODBC Driver 18.0 allows users to send long data types as max data types with the `LongAsMax` connection attribute. In ahjo, this is set to `Yes` by default.

**Notice that the connection encryption defaults have changed in ODBC Driver 18 for SQL Server.** The default value for `Encrypt` is `yes` and the default value for `TrustServerCertificate` is `no`. This means that the driver will encrypt the connection by default and it will not trust the server certificate by default. If you want to use the old defaults, e.g. in development environment, you need to define `Encrypt=no` and/or `TrustServerCertificate=yes` in `sqla_url_query_map` or `sqlalchemy.url` settings in config file.

Deprecated config parameters
`odbc_trust_server_certificate` and `odbc_encrypt` settings are deprecated and will be removed in the future. Use `sqla_url_query_map` or `sqlalchemy.url` settings in config file instead.

Build & Sign pipeline for ahjo MSI installation package
Added a build & sign pipeline for ahjo MSI installation package. The pipeline builds the package and signs it with a certificate. The signed package is published to Azure Artifacts.

Azure-identity to ahjo MSI installation package
In previous version of ahjo MSI installation package, azure-identity was not included. This caused an error when trying to use azure-identity authentication if ahjo was installed with MSI package. This has now been fixed.

Regression fix: UnboundLocalError in drop_sqlfile_objects
Fixed a regression bug where `UnboundLocalError` was raised when `drop_sqlfile_objects` was called.

Regression fix: git version table is not updated when using git version info file
In previous version, git version table was not updated when using git version info file. This has now been fixed.

Disable pyodbc pooling
Disabled pyodbc pooling by default since SQLAlchemy has its own pooling behavior. See [Pyodbc Pooling / connection close behavior](https://docs.sqlalchemy.org/en/20/dialects/mssql.html#pyodbc-pooling-connection-close-behavior) for more information.

Close SQLAlchemy connection if an error occurs
If an error occurs when running an action, the SQLAlchemy connection is now closed so that the connection is not left open.

3.4.0

MSI installer
Ahjo can now be installed with MSI installer. Currently, the installer is not available in public, but it can be built with the instructions in `README.md`. The installation package installs everything that is needed to execute ahjo shell commands including the required parts of the Python runtime setup. In other words, the target environment doesn't need to have Python installed and there is no need to create separate venvs for ahjo.

Ahjo scan
Added ability to scan files in ahjo project with search rules. Currently this feature can be used to search for Finnish Personal Identity Numbers (hetu), but later on it can be used to search for other patterns as well.

Git pre-commit hook for ahjo scan
Added ability to run ahjo scan as a pre-commit hook in git. It can be used to prevent committing files that contain sensitive information to git repository. To install the pre-commit hook, run `ahjo-install-git-hook` in the root of the ahjo project.

Windows Event Logging
Extended logging to Windows Event Log. This feature can be utilized for Azure Monitor activities, for example. To enable logging to Windows Event Log, set `windows_event_log` to `true` in ahjo config file.

Support for yaml config format
Ahjo config file can now be in yaml format. The old json or jsonc format is still supported. Ahjo config file can be converted from json/jsonc to yaml or vice versa with `ahjo-config` command.

Ability to import ahjo actions from different files
By default, ahjo actions are imported from `ahjo_actions.jsonc` file. Now it is possible to import actions from different files as well. It can be useful for example when one wants to use different actions for different environments or separate actions that are compatible with MSI-installed ahjo from actions that are compatible with pip-installed ahjo.

Upper and lower limits to requirements
`setup.cfg` requirements are no longer pinned to specific versions. Instead, upper and lower limits are set to requirements.

Collation check only if database exists and ahjo action affects database
Ahjo checks collation info only if database exists and ahjo action affects database. This prevents unnecessary collation checks when ahjo action does not affect database.

Bug fix: database name with hyphens
Fixed a bug where creating a new database fails when the database name contains hyphens.

ahjo-upgrade status code
Ahjo-upgrade now returns status code 1 if upgrade fails. This can be used to check if upgrade was successful or not, for example in pipelines.

Safety check only relevant packages in Bitbucket pipeline
Updated Bitbucket pipeline to check only ahjo specific packages.

3.3.2

Python 3.12 support
Added Python 3.12 support. Updated the following packages in `setup.cfg`:
- sqlalchemy 2.0.4 -> 2.0.22
- PyYAML 6.0 -> 6.0.1
- pyodbc 4.0.39 -> 5.0.1
- azure-identity 1.6.0 -> 1.14.1

Remove commentjson optional dependency
`commentjson` library has not had updates for few years and does not have pre-built wheels available.
Therefore it has been copied to ahjo package and is no longer an optional dependency.

Add more details to update-db-object-prop error message
Added more details to error message when database object property update fails.

Update file object properties bugfix
Due to refactoring related to v3.3.0 changes, `update_file_object_properties` function did not work correctly if optional parameter `schema_list` was not given. This has been fixed.

3.3.1

ahjo-upgrade bugfix
Due to refactoring related to v3.3.0 changes, parameter positioning in ahjo-upgrade execute_action call was incorrect. This caused ahjo-upgrade to fail. The bug is now fixed.

Non-interactive mode to ahjo-upgrade
Non-interactive mode is now supported in ahjo-upgrade command. With `-ni` or `--non-interactive` flag, confirmation messages are skipped.

3.3.0

Support for SQLALchemy transactions
Added ability to use SQLAlchemy transactions in ahjo actions and ahjo-upgrade. To enable transactions, set `context_connectable_type` to `connection` in project config file. The transaction management style can be defined with `transaction_mode` setting. If `transaction_mode` is set to `begin_once`, a transaction is started before running actions and committed after all actions are run. If `transaction_mode` is set to `commit_as_you_go`, a transaction is started before running actions but not committed automatically. Ahjo master actions support transactions, but custom actions need to be modified if transactions are used. See `ahjo.scripts.master_actions.py` for examples.

Database collation check
Ahjo displays database collation information before running actions. If the defined collation is different from the database collation, a warning is logged. The database collation check is enabled by default. The check can be disabled by setting `display_db_info` to `false` in project config file.

Non-interactive mode
Added ability to run ahjo actions in non-interactive mode. Non-interactive mode can be enabled with `-ni` or `--non-interactive` flag.

commentjson package dependency to optional
`commentjson` python package is now optional. If commentjson is not installed, only JSON config files are supported. To install ahjo with commentjson package, use `pip install ahjo[jsonc]` command.

Reload actions in ahjo-upgrade
In previous versions, `ahjo-upgrade` command did not reload actions from `ahjo_actions.py` file. This caused problems when ahjo actions were modified between different versions. `ahjo-upgrade` now reloads actions on each version upgrade.

Maximum execution time for Bitbucket Pipelines
Added maximum execution time for Bitbucket Pipelines. The maximum execution time is 5 minutes.

3.2.1

ahjo-upgrade hotfix
Fixed a bug where the search for upgradable versions of `ahjo-upgrade` script did not work in certain situations.

Page 3 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.