-
Notifications
You must be signed in to change notification settings - Fork 0
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
Generate SQL templates #1
Conversation
268ed84
to
d4aba15
Compare
a49f40a
to
e9bbd8a
Compare
913ae1d
to
c1fb666
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.
Jako POC mě to přijde dobrý, nevím jak stema named parametrama. To je dobrý kakánek ten replace, nebylo špatné tak hodit zrovna example co to znamená, protože mě chvilku trvalo než sem pochopil co to znamená že to dělá replace at the end apod.
@@ -1,4 +1,4 @@ | |||
FROM php:8-cli | |||
FROM php:7.4-cli |
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.
proč 7.4 jestli kvůli csv-options tak bysme měli vydat novů verzi nebo by šlo ignorovat ten requirement
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.
Zatim to nejspis nepujde... Je tam totiz zavislost:
php-db-import-export
- php8 readyphp-csv-options
- php8 readyphp-csv-db-import
-^7.1
phpunit/dbunit
-^7.1
+ no longer maintained
Muzeme to forknout a upravit (nejaky takovy forky uz jsou)...
tests/functional/ComponentTest.php
Outdated
self::assertStringStartsWith( | ||
"IF OBJECT_ID (N'{{ id(destSchemaName) }}.{{ id(stageTableName ~ '_tmp') }}', N'U') " . | ||
"IS NOT NULL DROP TABLE {{ id(destSchemaName) }}.{{ id(stageTableName ~ '_tmp') }}", | ||
$queries[6]['sql'] | ||
); | ||
self::assertStringStartsWith( | ||
"IF OBJECT_ID (N'{{ id(destSchemaName) }}.{{ id(stageTableName ~ '_tmp_rename') }}', N'U') IS NOT NULL " . | ||
"DROP TABLE {{ id(destSchemaName) }}.{{ id(stageTableName ~ '_tmp_rename') }}", | ||
$queries[7]['sql'] | ||
); |
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.
to budem muset ještě nějak pořešit protože toto je ve finally
<<<SQL | ||
COPY INTO [stageSchemaName634ff46baec71046847136].[__temp_stageTableName634ff46baec72821993597] | ||
FROM 'sourceFile1634ff46baec6c521446965' | ||
WITH ( CREDENTIAL=(IDENTITY='Shared Access Signature', SECRET={{ '?' ~ sourceSasSecret }}) ) |
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.
nejsu si jistý jestli ten name parametr bude fungovat takto, doctrine na to má :param
s dvojtečků. A řekl bych, že SQL server používá @param
syntax. Možná bych použil nepojmenované parametry 🤔 ale vlastně nevím.
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.
SECRET jsme vyhodili, pac se ted vsude pouziva Managed identity.
Ale aby se secret nevypisoval do query, tak bude vhodne pouzit funkci, napr. secret(...)
.
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.
mělo by tam imho pak byt SECRET=?
a udělat parameter bind v SQL, tak abysme ten secret nelogovali, případně ho v eventě replacnůt za hvězdičky
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.
U mě dobrý dělá to to co má, asi bych to nehrotil teď.
Jira: KBC-2928
Sample
data/config.json
:Supported combinations (backend, operation, source):