Nimbus

Nimbus

  • Docs
  • Getting Started
  • Help

›Clients

Documentation

  • Introduction
  • Deployment

Deploying Resources

  • File Storage Bucket
  • Document Store
  • Key-Value Store
  • Relational Database
  • Functions

    • HTTP Function
    • WebSocket Function
    • Document Store Function
    • Key-Value Store Function
    • Notification Function
    • Queue Function
    • Basic Function
    • File Storage Function
    • After Deployment Function
    • Environment Variables

Clients

  • Document Store Client
  • Key-Value Store Client
  • File Storage Client
  • WebSocket Management Client
  • Basic Serverless Function Client
  • Notification Topic Client
  • Queue Client
  • Relational Database Client
  • Environment Variable Client

Local Deployment

  • Unit Testing
  • Local Server

Relational Database Client

A database client allows you to obtain an active connection to a relational database.

Initialisation

A database client has a type parameter which should correspond to a class that is annotated with @RelationalDatabase

To get an instance of a DatabaseClient you do:

DatabaseClient client = ClientBuilder.getDatabaseClient(DatabaseClass.class);

In addition the serverless function from which the client is used needs to be annotated with @UsesRelationalDatabase(DatabaseClass.class), to handle cloud permissions.

In this example DatabaseClass would be replaced with your class that you have annotated with @RelationalDatabase.

DatabaseClient Methods

  • Connection getConnection() - Returns an active connection to the database, with no active database selected.

  • Connection getConnection(String databaseName, boolean createIfNotExist) - Returns an active connection to the database with an active database selected. Option for creating this database if it does not exist.

Annotation Specification

@UsesRelationalDatabase

Required Parameters

  • dataModel - The class annotated with @RelationalDatabase that this function will access.

Optional Parameters

  • stages - The stages which this function has access to the relational database
← Queue ClientEnvironment Variable Client →
  • Initialisation
  • DatabaseClient Methods
  • Annotation Specification
    • @UsesRelationalDatabase
Nimbus
Docs
Getting StartedDocumentation
More
GitHubStar
Copyright © 2019 Thomas Allerton