Data Source Specification

Overview

A datasource creates a database on the db server. An application can define multiple data sources depending upon the grouping of classes (tables).
The default db server is chosen for the new data source which can be changed to one of the supported external servers.

Specifying datasource

Property Type Description
name string Datasource name
useDefault boolean Use the default DB server? (default: true)
type string One of following DB servers (default: MySQL)
permitsDBCreate boolean Whether to allow creating new databases (default:false)
uid string Internally generated identifier

Datasource DB servers

  • MySQL
  • PostgreSQL
  • MongoDB

Specifying external datasource servers

Property Type Description
url string JDBC connection URL of the DB server
username string DB username
password string DB user password
hostname string Optional (and ignored) if it is already mentioned in the connection url
port string Optional (and ignored) if it is already mentioned in the connection url
database string Optional (and ignored) if mentioned in the connection url. It is not needed for application development as a new database is always created. However it is useful when introspecting existing database. The introspection is provided to assist in developing apps using the existing data.

Datasource JSON Example

{
    "name" : "ds1",
    "permitsDBCreate" : false,
    "properties" : {
      "url" : "jdbc:mysql://localhost:3306/",
      "hostname" : "",
      "port" : "",
      "database" : "",
      "username" : "***db user***",
      "password" : "***db password***"
    },
    "type" : "mysql",
    "uid" : "DataSourceM.ds1",
    "useDefault" : false
 }