mevdschee / mevdschee/php-crud-api

Add support of MSSQL ODBC

Open
#569 7 comments 1 reaction 1 assignee View on GitHub

@mevdschee is already working on this.

Since Aug 28, 2019.

enhancement
Dominant language
PHP
Stars
3.7k
Forks
1k
Avg merge
1h 55m
Merged PRs (30d)
7

Description

As of first congrats for this package - I'm using it quite often & it's a great help.

I'd like to ask a feature request - add support for MSSQL DB.
The main official mode of connection recommended by MS is ODBC/PDO.
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017#microsoft-odbc-driver-17-for-sql-server

As far as I've tested it could be pretty the same as 'sqlsrv' driver but the following differences:

  • GenericDB: getOptions\PDO::SQLSRV_ATTR_DIRECT_QUERY &
    PDO::SQLSRV_ATTR_FETCHES_NUMERIC_TYPE are not valid options in case of MSSQL ODBC PDO - so please remove them on the new driver case.

  • GenericReflection: getTableColumnsSQL and getTablePrimaryKeysSQL - please remove unnecessary "and '' <> ? " query parameter from the end as it fails during execution.

  • GenericDB: getDSN would require an additional driver case parameter where direct DB DSN could be specified eg: could come as Config parameter.

Sorry not sending as direct pull request - but I'm new contrib on github, whoever would be happy to help with testing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.