Skip to content

Commit

Permalink
Tested component with queries
Browse files Browse the repository at this point in the history
  • Loading branch information
jcortes committed May 6, 2024
1 parent ef0a454 commit 02aca44
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion components/snowflake/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/snowflake",
"version": "0.9.6",
"version": "0.9.7",
"description": "Pipedream Snowflake Components",
"main": "snowflake.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
// eslint-disable-next-line
name: "New, Updated, or Deleted Warehouse",
description: "Emit new events when a warehouse is created, altered, or dropped",
version: "0.0.10",
version: "0.0.11",
async run() {
await this.watchObjectsAndEmitChanges("WAREHOUSE", this.warehouses, this.queryTypes);
},
Expand Down
13 changes: 10 additions & 3 deletions components/snowflake/sources/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ export default {
_setLastMaxTimestamp(lastMaxTimestamp) {
this.db.set("lastMaxTimestamp", lastMaxTimestamp);
},
async streamToArray(stream) {
const result = [];
for await (const item of stream) {
result.push(item);
}
return result;
},
async processCollection(statement, timestamp) {
const rowStream = await this.snowflake.getRows(statement);
this.$emit({
rows: rowStream,
const rows = await this.streamToArray(rowStream);
this.$emit(rows, this.generateMetaForCollection({
timestamp,
});
}));
},
async processSingle(statement, timestamp) {
let lastResultId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
// eslint-disable-next-line
name: "Failed Task in Schema",
description: "Emit new events when a task fails in a database schema",
version: "0.0.11",
version: "0.0.12",
async run() {
await this.emitFailedTasks({
database: this.database,
Expand Down
2 changes: 1 addition & 1 deletion components/snowflake/sources/new-database/new-database.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "snowflake-new-database",
name: "New Database",
description: "Emit new event when a database is created",
version: "0.0.9",
version: "0.0.10",
methods: {
...common.methods,
alwaysRunInSingleProcessMode() {
Expand Down
2 changes: 1 addition & 1 deletion components/snowflake/sources/new-role/new-role.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "snowflake-new-role",
name: "New Role",
description: "Emit new event when a role is created",
version: "0.0.8",
version: "0.0.9",
methods: {
...common.methods,
alwaysRunInSingleProcessMode() {
Expand Down
2 changes: 1 addition & 1 deletion components/snowflake/sources/new-row/new-row.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "snowflake-new-row",
name: "New Row",
description: "Emit new event when a row is added to a table",
version: "0.1.10",
version: "0.1.11",
methods: {
...common.methods,
async getStatement(lastResultId) {
Expand Down
2 changes: 1 addition & 1 deletion components/snowflake/sources/new-schema/new-schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "snowflake-new-schema",
name: "New Schema",
description: "Emit new event when a schema is created",
version: "0.0.9",
version: "0.0.10",
methods: {
...common.methods,
alwaysRunInSingleProcessMode() {
Expand Down
2 changes: 1 addition & 1 deletion components/snowflake/sources/new-table/new-table.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "snowflake-new-table",
name: "New Table",
description: "Emit new event when a table is created",
version: "0.0.9",
version: "0.0.10",
methods: {
...common.methods,
alwaysRunInSingleProcessMode() {
Expand Down
2 changes: 1 addition & 1 deletion components/snowflake/sources/new-user/new-user.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "snowflake-new-user",
name: "New User",
description: "Emit new event when a user is created",
version: "0.0.8",
version: "0.0.9",
methods: {
...common.methods,
alwaysRunInSingleProcessMode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
name: "New Query Results",
// eslint-disable-next-line
description: "Run a SQL query on a schedule, triggering a workflow for each row of results",
version: "0.1.10",
version: "0.1.11",
props: {
...common.props,
sqlQuery: {
Expand Down

0 comments on commit 02aca44

Please sign in to comment.