-
Notifications
You must be signed in to change notification settings - Fork 2
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
CT-1169 add parsing of precision&scale to SNFLK #127
Conversation
0c4ad36
to
5e17c4d
Compare
36a2a6a
to
daaae47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vypadá to cajk.
- přidal case kdy uděláš víc změn naráz
- nebylo by od věci aby to mělo funkcionální test proti SNFLK
$parsed = array_map(intval(...), explode(',', $this->getLength())); | ||
return ['numeric_precision' => $parsed[0], 'numeric_scale' => $parsed[1]]; | ||
} | ||
return ['character_maximum' => $this->getLength()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm co když si nadefinuju NUMERIC(10) bez precision? Opraví to v konstruktoru? Failne to v konstruktoru? Nebo to failne tady? Vlastně nevím :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je škoda žes k tomu není DTO ale dělá to array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, doplním do testu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undefined array key 1
/var/www/html/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:132
/var/www/html/vendor/keboola/php-datatypes/src/Definition/Snowflake.php:213
/var/www/html/vendor/keboola/php-datatypes/tests/SnowflakeDatatypeTest.php:393
🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SNFLK to interně přeloží na NUMBER(10,0), ale to se sem nepropíše :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jestli to padá tady tak bych tam přidal 0 asi, otázka jaký to má case reálný pak. Jestli to može propadnůt ze SNFLK nebo ze Storage Api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ze SNFLK ne. Tam když pošleš něco nekompletního, tak to vrací kompletní.
NUMBER(10) → NUMBER(10,0)
NUMBER → NUMBER(38,0)
Ze SAPI asi jo, pokud někde nastavujeme tyhle hodnoty z requestu a ne z backendu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vyřšeno v 87bae6c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jo to mě přijde v cajku
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho přes api by to přešlo tam sa spoléhá na validaci z tady toho Snowflake objektu
packages/php-table-backend-utils/src/Table/Snowflake/SnowflakeTableQueryBuilder.php
Show resolved
Hide resolved
/** | ||
* @return \Generator<string, array{Snowflake,Snowflake,string}> | ||
*/ | ||
public function provideGetColumnDefinitionUpdate(): Generator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chybý mě test co dělá víc věcí naráz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vyřešeno v 15a44a4
15a44a4
to
f74d392
Compare
f74d392
to
f3b83ba
Compare
Jira: CT-1169
Connection PR: https://github.com/keboola/connection/pull/4838
SAPI PR: keboola/storage-api-php-client#1264