0.0.7 • Published 1 month ago

oute-services-db-connection-sdk v0.0.7

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

This module expose helper functions

  • Initialization
  params = {
    url: @server url
    token: @access token
  }
  DbConnection = require("oute-services-db-connection-sdk")
  db_connection_instance = new DbConnection(params)

Cache functions

Core functions

  • Save deployment
  body = {
    "_id": "mandb1",
    "name": "Postgres SQL",
    "thumbnail": "https://ccc.oute.app/cdata/db_hub/postgres.svg",
    "db_type": "postgres",
    "parent_id": "q-GmTD5-K",
    "workspace_id": "ZzBfJMpfQ",
    "configs": [],
    "state": "ACTIVE"
  }
  await db_connection_instance.save(body)
  • get db hub list
  query = {}
  await db_connection_instance.dbHubList(query)
  • delete by id
  connection_id = "mandb1"
  await db_connection_instance.deleteById(connection_id)
  • get by parent id
  query = {
    parent_id: "q-GmTD5-K"
  }
  await db_connection_instance.getByParent(query)
  • map to assets
  body = {
    "connection_ids": ["mandb1"],
    "workspace_id": "ZzBfJMpfQ",
    "asset_id" : "q-GmTD5-K"
  }
  await db_connection_instance.mapToAsset(body)
  • Test connection
  body: {
    connection_id: "mandb1", //Send this to save the schema for the given connections
    state: {},
    db_config: {"db_type": "postgres","configs": []},
    options: {logging: false}
  }
  await db_connection_instance.testConnection(body)
  • get tables
  query: {
    connection_id: "mandb1"
  }
  await db_connection_instance.getTables(query)
  • get table fields
  query: {
    connection_id: "mandb1",
    table_id: "Wz6viqLBxkU"
  }
  await db_connection_instance.getTableFields(query)
0.0.7

1 month ago

0.0.6

1 month ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago