Skip to content

Commit 87c01b1

Browse files
Merge branch 'main' into fix-network
2 parents f08286b + d1a6ade commit 87c01b1

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.github/workflows/publication.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44

55
name: Publication
66

7+
permissions:
8+
contents: write
9+
id-token: write
10+
packages: write
11+
712
jobs:
813
publication:
914
runs-on: ubuntu-latest
@@ -18,7 +23,8 @@ jobs:
1823
- run: npm ci
1924
- run: npm publish
2025
env:
21-
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
26+
NODE_AUTH_TOKEN: ''
27+
NPM_TOKEN: ''
2228
- run: npm run build:embedded:archive
2329
- run: gh release upload ${{ github.event.release.tag_name }} $ASSET_NAME.zip
2430
env:

src/containers/Tenant/utils/schemaQueryTemplates.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ function toLF(str: string) {
2424
return str.replace(/\r\n?/g, '\n');
2525
}
2626

27-
function indentBlock(str: string, pad = ' ') {
28-
return str.replace(/^/gm, pad);
29-
}
30-
3127
export const createTableTemplate = (params?: SchemaQueryParams) => {
3228
const tableName = params?.relativePath
3329
? `\`${normalizeParameter(params.relativePath)}/my_row_table\``
@@ -333,8 +329,10 @@ export const createStreamingQueryTemplate = (params?: SchemaQueryParams) => {
333329
RUN = TRUE -- Run the query after creation
334330
) AS
335331
DO BEGIN
336-
INSERT INTO \${2:<external data source>}.\${3:<sink topic>}
337-
SELECT * FROM \${2:<external data source>}.\${4:<source topic>};
332+
333+
INSERT INTO \${2:<external data source>}.\${3:<sink topic>}
334+
SELECT * FROM \${2:<external data source>}.\${4:<source topic>};
335+
338336
END DO;`;
339337
};
340338

@@ -360,14 +358,14 @@ export const alterStreamingQueryText = (params?: SchemaQueryParams) => {
360358
queryText = stripIndentByFirstLine(queryText);
361359
queryText = normalizeParameter(queryText);
362360

363-
const bodyQueryText = queryText
364-
? indentBlock(queryText)
365-
: indentBlock('${2:<streaming_query_text>}');
361+
const bodyQueryText = queryText ? queryText : '${2:<streaming_query_text>}';
366362
return `ALTER STREAMING QUERY ${streamingQueryName} SET (
367363
FORCE = TRUE, -- Allow to drop last query checkpoint if query state can't be loaded
368364
) AS
369365
DO BEGIN
366+
370367
${bodyQueryText}
368+
371369
END DO;`;
372370
};
373371

0 commit comments

Comments
 (0)