Connecting to Oracle NoSQL Database from Visual Studio Code

Oracle NoSQL Database Visual Studio (VS) Code extension provides two methods to connect to Oracle NoSQL Database. You can either provide a config file with the connection information or fill in the connection information in the specific fields.

  1. In Visual Studio Code, click the Oracle NoSQL DB view in the Activity Bar.


    Oracle NoSQL DB View

  2. Open the Oracle NoSQL DB Show Connection Settings page from the Command Palette or the Oracle NoSQL DB view in the Activity Bar.
    • Open from Command Palette
      1. Open the Command Palette by pressing:
        • (Windows and Linux) Control + Shift + P
        • (macOS) Command + Shift + P
      2. From the Command Palette, select OracleNoSQL: Show Connections Settings.

        Tip:

        Enter oraclenosql in the Command Palette to display all of the Oracle NoSQL DB commands you can use.


        Show Connections Settings

    • Open from Oracle NoSQL DB View
      1. Expand the Schema Explorer pane in the left navigation if it's collapsed.
      2. Click Add Connection to open the Oracle NoSQL DB Show Connection Settings page.


      Add Connection

  3. In the Show Connection Settings page, click Onprem to connect to Oracle NoSQL Database.


    NoSQL DB Connection Settings View

  4. Enter the connection information.

    Table 5-7 Oracle NoSQL Database Connection Parameters

    Field Description
    Endpoint: Service URL of the Oracle NoSQL Database Proxy.
    • http://<proxy_host>:<proxy_http_port>
    • https://<proxy_host>:<proxy_https_port>
    where,
    • http or https indicates the store security. For a secure KVStore, the proxy URL begins with https.
    • proxy_host is the host name of the machine to host the Oracle NoSQL Database Proxy service. For more information, see Configuring the Proxy.
    Security: Select SSL for secure KVStores. In case you are creating the connection to a non-secure KVStore, select None.

    The default value is None.

    Username: User name to connect to the secure store. This value is required only if you select SSL for the Security parameter.
    Password: Password to connect to the secure store. This value is required only if you select SSL for the Security parameter.
    Certificate File: Browse to the location of the SSL certificate file (for example, certificate.pem). See Using the Proxy in a secure data store.
  5. Click Connect.
  6. Click Reset to clear the saved connection details from the workspace.
  1. Create the config file, for example, config.json or a file with the JSON object. The config file format for connecting to Oracle NoSQL Database is as shown below.

    Table 5-8 Configuration Templates

    Secure KVStore Non-secure KVStore
    Configuration template to connect using OCI configuration file
    {
     "serviceType": "KVSTORE",
     "endpoint": "<service-URL-of-Oracle-NoSQL-Database-Proxy>",
     "auth":
      {
       "kvstore":
        {
         "configFile": "<path-to-OCI-config-file>"
        }
      }
    }
    Configuration template to connect using authentication credentials
    {
     "serviceType": "KVSTORE",
     "endpoint": "<service-URL-of-Oracle-NoSQL-Database-Proxy>",
     "auth":
      {
       "kvstore":
        {
         "user": "<username>",
         "password": "<password>"
        }
      }
    }
    {
     "serviceType": "KVSTORE",
     "endpoint": "<service-URL-of-Oracle-NoSQL-Database-Proxy>"
    }
  2. Open the Command Palette by pressing:
    • (Windows and Linux) Control + Shift + X
    • (macOS) Command + Shift + X
  3. From the Command Palette, select Oracle NoSQL: Connect via Config File.

    Tip:

    Enter oraclenosql in the Command Palette to display all of the Oracle NoSQL DB commands you can use.


    Connect Via Config File

  4. Browse to the location where the *.config file is stored and click Select.

Note:

When you want to connect to a on-premise secure cluster using Visual Studio Code Extension, you need to do one of the following if you have self-signed certificates:
  • Add the self-signed certificate to the trusted root store in your Windows configuration (using Microsoft Management Console)).
  • Open Visual Studio Code. Go to File > Preferences > Settings > Application > Proxy. In the Proxy Support menu select off.