You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Too few arguments to function Illuminate\Database\Query\Expression::getValue(), 0 passed in /var/www/html/vendor/yoramdelangen/laravel-pdo-odbc/src/Flavours/Snowflake/Concerns/GrammarHelper.php on line 58 and exactly 1 expected
It appeared to me there was a bug in GrammarHelper.php:
public function getValue($expression)
{
return $expression instanceof Expression ? $expression->getValue() : $expression;
}
The $expression->getValue method expects a parameter, I hacked the library and added it:
public function getValue($expression)
{
return $expression instanceof Expression ? $expression->getValue(new Query()) : $expression;
}
That got me to another error:
Invalid expression [PARSE_JSON('{"test": "value"}')] in VALUES clause (Connection: pdl_dev, SQL: insert into VARIA (PDL_PERSON) values (PARSE_JSON('{"test": "value"}')))
I can see that this compiled statement doesn't exactly match what snowflake expects for a json parse:
Hi All
I'm trying to use this package to do inserts to snowflake from laravel but I'm running into some issues getting the right syntax to work.
This statement works via Snowflake SQL:
I tried to create a similar eloquent style insert:
At first I was getting this error:
It appeared to me there was a bug in GrammarHelper.php:
The $expression->getValue method expects a parameter, I hacked the library and added it:
That got me to another error:
I can see that this compiled statement doesn't exactly match what snowflake expects for a json parse:
https://docs.snowflake.com/en/sql-reference/sql/insert
It apparently doesn't want to have the entire select / parse wrapped in parenthesis.
Has anyone successfully inserted into snowflake with this library? I would love to see some working example code.
The text was updated successfully, but these errors were encountered: