{"id":20329333,"url":"https://github.com/ddev/ddev-sqlsrv","last_synced_at":"2025-04-11T20:41:38.076Z","repository":{"id":153560846,"uuid":"618290272","full_name":"ddev/ddev-sqlsrv","owner":"ddev","description":"MS SQL server add-on for DDEV","archived":false,"fork":false,"pushed_at":"2025-04-10T19:02:46.000Z","size":77,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-10T19:53:23.653Z","etag":null,"topics":["ddev-get"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["ddev"],"custom":["https://www.paypal.com/donate/?hosted_button_id=MCNCSZHC7LHSQ","https://ddev.com/support-ddev/"]}},"created_at":"2023-03-24T06:36:39.000Z","updated_at":"2025-04-10T18:45:10.000Z","dependencies_parsed_at":"2023-05-19T16:00:35.729Z","dependency_job_id":"eb2928ce-2680-4b1d-b450-f03c10bfe1fd","html_url":"https://github.com/ddev/ddev-sqlsrv","commit_stats":null,"previous_names":["ddev/ddev-sqlsrv"],"tags_count":10,"template":false,"template_full_name":"ddev/ddev-addon-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddev%2Fddev-sqlsrv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddev%2Fddev-sqlsrv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddev%2Fddev-sqlsrv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddev%2Fddev-sqlsrv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddev","download_url":"https://codeload.github.com/ddev/ddev-sqlsrv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248478809,"owners_count":21110767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ddev-get"],"created_at":"2024-11-14T20:10:12.717Z","updated_at":"2025-04-11T20:41:38.065Z","avatar_url":"https://github.com/ddev.png","language":"Shell","funding_links":["https://github.com/sponsors/ddev","https://www.paypal.com/donate/?hosted_button_id=MCNCSZHC7LHSQ","https://ddev.com/support-ddev/"],"categories":[],"sub_categories":[],"readme":"[![tests](https://github.com/ddev/ddev-sqlsrv/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddev/ddev-sqlsrv/actions/workflows/tests.yml?query=branch%3Amain)\n[![last commit](https://img.shields.io/github/last-commit/ddev/ddev-sqlsrv)](https://github.com/ddev/ddev-sqlsrv/commits)\n[![release](https://img.shields.io/github/v/release/ddev/ddev-sqlsrv)](https://github.com/ddev/ddev-sqlsrv/releases/latest)\n\n# DDEV SQLSRV\n\n## Overview\n\nThis add-on quickly installs the MS SQL server into a DDEV project.\nIt is based on the [mcr.microsoft.com/mssql/server](https://hub.docker.com/_/microsoft-mssql-server) image.\n\nYou have to keep in mind that the [mssql-docker](https://github.com/microsoft/mssql-docker) does not natively work on M1 (arm64).\nSome workarounds are described in the following threads:\n* [Does not work on Mac M1](https://github.com/microsoft/mssql-docker/issues/734)\n* [MSSQL container for aarch64 (arm64) for better performance](https://github.com/microsoft/mssql-docker/issues/802)\n\n## Installation\n\n\u003e [!WARNING]\n\u003e Due to lack of upstream support, this add-on can only be used with amd64 machines, and is not usable on arm64 machines like Apple Silicon computers.\n\u003e (You can try installing it on Rosetta using `DDEV_IGNORE_ARCH_CHECK=true ddev add-on get ddev/ddev-sqlsrv`)\n\n```bash\nddev add-on get ddev/ddev-sqlsrv\nddev restart\n```\n\nAfter installation, make sure to commit the `.ddev` directory to version control.\n\n## Usage\n\n| Command | Description |\n| ------- | ----------- |\n| `ddev sqlcmd` | For Transact-SQL statements, system procedures, and script files |\n| `ddev drupal-regex` | For compatibility with Drupal version 9 or higher |\n\n### Drupal Notice\n\nDrupal CMS needs the database function installed that is mimicking the Regex function as Drupal requires. As a one-time setup for Drupal, install the database function by running the following command from your project's directory:\n\n```bash\nddev drupal-regex\n```\n\nThis script also changes the setting for the following database variables:\n\n* `show advanced options` will be set to 1\n* `clr strict security` will be set to 0\n* `clr enable` will be set to 1\n\nDrupal also required the [`sqlsrv` module](https://www.drupal.org/project/sqlsrv) to be installed as it is provides the database driver for SQL Server. The module can be installed with composer with the following command:\n\n```bash\nddev composer require drupal/sqlsrv\n```\n\n**There is an open issue for Drupal 9.4+ installations. Until merged, you need to apply [patch #4](https://www.drupal.org/project/sqlsrv/issues/3291199#comment-14576456), see [Call to a member function fetchField() on null\n](https://www.drupal.org/project/sqlsrv/issues/3291199)**\n\n### Manually enabling MySQL/MariaDB/PostgreSQL\n\n**This addons disables the default database by automatically adding `omit_containers: [db]` in the `config.sqlsrv.yaml`**\n\nIf your project needs to use both MariaDB and MS SQL Server databases, you have to remove `#ddev-generated` and\n`omit_containers: [db]` from `config.sqlsrv.yaml`.\n\nSee [Config Options](https://ddev.readthedocs.io/en/stable/users/configuration/config/) for additional notes.\n\n## Advanced Customization\n\nUse a different port:\n\n```bash\nddev dotenv set .ddev/.env.sqlsrv --mssql-external-port=1434\nddev add-on get ddev/ddev-sqlsrv\nddev restart\n```\n\nMake sure to commit the `.ddev/.env.sqlsrv` file to version control.\n\nOr change the password:\n\n```bash\nddev dotenv set .ddev/.env.sqlsrv --mssql-sa-password='myNewPassword'\nddev add-on get ddev/ddev-sqlsrv\nddev restart\n```\n\nMake sure to commit the `.ddev/.env.sqlsrv` file to version control.\n\nAll customization options (use with caution):\n\n| Variable | Flag | Default |\n| -------- | ---- | ------- |\n| `MSSQL_DOCKER_IMAGE` | `--mssql-docker-image` | `mcr.microsoft.com/mssql/server:2022-CU17-ubuntu-22.04` |\n| `MSSQL_EXTERNAL_PORT` | `--mssql-external-port` | `1433` |\n| `MSSQL_SA_PASSWORD` | `--mssql-sa-password` | `Password12!` |\n| `MSSQL_PID` | `--mssql-pid` | `Evaluation` |\n| `MSSQL_DB_NAME` | `--mssql-db-name` | `master` |\n| `MSSQL_HOST` | `--mssql-host` | `sqlsrv` |\n| `MSSQL_COLLATION` | `--mssql-collation` | `LATIN1_GENERAL_100_CI_AS_SC_UTF8` |\n\n## Links with useful information\n\n* [SQL Server docker hub](https://hub.docker.com/_/microsoft-mssql-server)\n* [Installing the ODBC driver for SQL Server](https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server)\n* [Installing the ODBC driver for SQL Server Tutorial](https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac)\n* [Installation tutorial for MS drivers for PHP](https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac)\n* [The SQLCMD utility](https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility)\n* [The SQL Server on Linux](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-overview)\n* [The password policy](https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy)\n* [The SQL Server environment variables](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-environment-variables)\n* [Beakerboy's Drupal Regex database function](https://github.com/Beakerboy/drupal-sqlsrv-regex)\n* [Drupal's module for the SQL Server](https://www.drupal.org/project/sqlsrv)\n* [Github MS drivers for PHP](https://github.com/microsoft/msphpsql)\n\nNote that more advanced techniques are discussed in [DDEV docs](https://ddev.readthedocs.io/en/stable/users/extend/additional-services/).\n\n## Credits\n\n**Contributed and maintained by [@robertoperuzzo](https://github.com/robertoperuzzo) based on the original [ddev-contrib recipe](https://github.com/ddev/ddev-contrib/tree/master/docker-compose-services/sqlsrv) by [drupal-daffie](https://github.com/drupal-daffie)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddev%2Fddev-sqlsrv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddev%2Fddev-sqlsrv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddev%2Fddev-sqlsrv/lists"}