import type { Sql } from "https://deno.land/x/windmill@v1.85.0/mod.ts";
export async function main(
token: string,
account_id: string,
database: string,
schema: string,
sql: Sql,
) {
const POST_URL = `https://${account_id}.snowflakecomputing.com/api/statements`;
const body = {
statement: `${sql}`,
timeout: 60,
database: `${database}`,
schema: `${schema}`,
};
const response = await fetch(POST_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.json();
}
Submitted by admin 497 days ago
import type { Sql } from "https://deno.land/x/windmill@v1.85.0/mod.ts";
export async function main(token: string, account_id: string, database: string, schema: string, sql: Sql) {
const POST_URL = `https://${account_id}.snowflakecomputing.com/api/statements`;
const body = {
"statement": `${sql}`,
"timeout": 60,
"database": `${database}`,
"schema": `${schema}`,
};
const response = await fetch(POST_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.json();
}
Submitted by adam186 628 days ago
import type { Sql } from "https://deno.land/x/windmill@v1.70.1/mod.ts";
export async function main(token: string, account_id: string, database: string, schema: string, sql: Sql) {
const POST_URL = `https://${account_id}.snowflakecomputing.com/api/statements`;
const body = {
"statement": `${sql}`,
"timeout": 60,
"database": `${database}`,
"schema": `${schema}`,
};
const response = await fetch(POST_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.json();
}
Submitted by adam186 663 days ago
import type { Sql } from "https://deno.land/x/windmill@v1.31.0/mod.ts";
export async function main(token: string, account_id: string, database: string, schema: string, sql: Sql) {
const POST_URL = `https://${account_id}.snowflakecomputing.com/api/statements`;
const body = {
"statement": `${sql}`,
"timeout": 60,
"database": `${database}`,
"schema": `${schema}`,
};
const response = await fetch(POST_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.json();
}
Submitted by rossmccrann 858 days ago
import * as wmill from "https://deno.land/x/windmill@v1.31.0/mod.ts";
export async function main(token: string, account_id: string, database: string, schema: string, sql: wmill.Sql) {
const POST_URL = `https://${account_id}.snowflakecomputing.com/api/statements`;
const body = {
"statement": `${sql}`,
"timeout": 60,
"database": `${database}`,
"schema": `${schema}`,
};
const response = await fetch(POST_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.json();
}
Submitted by rossmccrann 858 days ago
import * as wmill from "https://deno.land/x/windmill@v1.31.0/mod.ts";
export async function main(token: string, account_id: string, database: string, schema: string, sql: wmill.Sql) {
const POST_URL = `https://${account_id}.snowflakecomputing.com/api/statements`;
const body = {
"statement": `${sql}`,
"timeout": 60,
"database": `${database}`,
"schema": `${schema}`,
};
const response = await fetch(POST_URL, {
method: "POST",
body: JSON.stringify(body),
headers: {
Authorization: "Bearer " + token,
"Content-Type": "application/json",
},
});
return await response.text();
}
Submitted by rossmccrann 858 days ago