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.