Edits history of script submission #112 for ' Execute Query & Return Results (snowflake)'

  • deno
    import type { Sql } from "https://deno.land/x/[email protected]/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 hugo697 395 days ago

  • deno
    import type { Sql } from "https://deno.land/x/[email protected]/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 1028 days ago

  • deno
    
    import type { Sql } from "https://deno.land/x/[email protected]/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 1159 days ago

  • deno
    
    import type { Sql } from "https://deno.land/x/[email protected]/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 1194 days ago

  • deno
    
    import type { Sql } from "https://deno.land/x/[email protected]/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 1389 days ago

  • deno
    
    import * as wmill from "https://deno.land/x/[email protected]/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 1389 days ago

  • deno
    
    import * as wmill from "https://deno.land/x/[email protected]/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 1389 days ago