Skip to content

Commit

Permalink
narrowdown issue ignored NoExecuteInSqlPrepare statement for alter ad…
Browse files Browse the repository at this point in the history
…d constraints #8
  • Loading branch information
yoramdelangen committed May 25, 2022
1 parent ccbdc86 commit 640908d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/Contracts/OdbcDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace LaravelPdoOdbc\Contracts;

use Closure;
use LaravelPdoOdbc\ODBCConnector;

interface OdbcDriver
{
Expand Down
4 changes: 2 additions & 2 deletions src/Flavours/Snowflake/PDO/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ protected function _prepareValues(): array

public function execute($bound_input_params = null)
{
// TODO: quick fix for broken ODBC connection.. please make sure odbc config -> NoExecuteInSqlPrepare=false
if (count($this->bindings) === 0) {
// TEMP: all adding constraints queries are failing, current workaround.
if (str_contains($this->queryString, 'add constraint')) {
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion src/ODBCConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ public static function registerDriver(): Closure
protected function buildDsnDynamicly(array $config): string
{
// ignore some default props...
$ignoreProps = ['driver', 'odbc_driver', 'dsn', 'options', 'username', 'password'];
$ignoreProps = ['driver', 'odbc_driver', 'dsn', 'options', 'server', 'username', 'password'];
$props = Arr::except($config, $ignoreProps);


if ($this->dsnIncludeDriver) {
$props = ['driver' => Arr::get($config, 'odbc_driver')] + $props;
}
Expand Down

0 comments on commit 640908d

Please sign in to comment.