Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure odbc locates SQL Server drivers on macOS running on Apple Silicon. Addresses #892 #893

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

stevecondylios
Copy link
Contributor

This updates common_dirs in locate_install_unixodbc() to ensure odbc is able to find database drivers and set the ODBCSYSINI environment variable correctly. It is based on the path to which homebrew installs SQL Server drivers on macOS running on Apple Silicon.

Homebrew is the installation method recommended by Microsoft.

Before change:

odbc::odbcListDrivers()
# [1] name      attribute value    
# <0 rows> (or 0-length row.names)

After change (drivers automatically located by odbc):

odbc::odbcListDrivers()
#                            name   attribute                                   value
# 1 ODBC Driver 18 for SQL Server Description Microsoft ODBC Driver 18 for SQL Server
# 2 ODBC Driver 18 for SQL Server      Driver /opt/homebrew/lib/libmsodbcsql.18.dylib
# 3 ODBC Driver 18 for SQL Server  UsageCount                                       1


Copy link
Collaborator

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, @stevecondylios. Thank you!

@simonpcouch simonpcouch merged commit a9c438c into r-dbi:main Feb 10, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odbc locating SQL Server drivers installed via homebrew on macOS running on Apple Silicon
2 participants