Socket
Socket
Sign inDemoInstall

@vulcan-sql/extension-api-caller

Package Overview
Dependencies
189
Maintainers
6
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @vulcan-sql/extension-api-caller

Calling APIs to get data from other sources


Version published
Weekly downloads
1
decreased by-80%
Maintainers
6
Created
Weekly downloads
 

Readme

Source

extension-api-caller

Allow to call APIs from other sources for VulcanSQL, provided by Canner.

Installation

  1. Install the package:

    npm i @vulcan-sql/extension-api-caller
    
  2. Update your vulcan.yaml file to enable the extension:

    extensions:
      api: '@vulcan-sql/extension-api-caller'
    

Usage

To pass the path parameters:

{% set a_variable_you_can_define = { "path": { "id": 1 } } %}
SELECT {{ a_variable_you_can_define | rest_api(url='https://dummyjson.com/products/:id') }}

To pass the query parameters:

{% set a_variable_you_can_define = { "query": { "q": "phone" }  } %}
SELECT {{ a_variable_you_can_define | rest_api(url='https://dummyjson.com/products/search') }}

To issue the POST request:

{% set a_variable_you_can_define = { "body": { "title": "BMW Pencil" } } %}
SELECT {{ a_variable_you_can_define | rest_api(url='https://dummyjson.com/products/add', method='POST') }}

To pass the headers and multiple fields:

{% set a_variable_you_can_define = { "headers": { "Content-Type": "application/json" }, "body": { "title": "BMW Pencil" } } %}
SELECT {{ a_variable_you_can_define | rest_api(url='https://dummyjson.com/products/add', method='POST') }}

Keywords

FAQs

Last updated on 18 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc