0.0.20 • Published 1 year ago

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

Weekly downloads
-
License
-
Repository
-
Last release
1 year 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.20

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.9

1 year ago

0.0.16

1 year ago

0.0.8

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago