Table Of Contents

Database

A resource of the “Database” type represents an interface for a set of database tables and a user with administrative privileges to these tables. The resource must contain the name of a database instance with tables, login/password of the user and host/port which are used to connect to the database.

A database may contain a table prefix. In this case creation of tables which name does not include the prefix must be prohibited to the administrative user. Otherwise the user must be allowed to create and manage tables with any name.

Different resources of the “Database” type may have the same name of database (may share the same database instance).

The Database type schema: download

	{
		"apsVersion": "2.0",

		"name": "Database",

		"id": "http://aps-standard.org/types/infrastructure/database/1.0",
		
		"properties": {
			"host": {
				"type": "string",
				"format": "host-name",
				"required": true
			},
			"port": {
				"type": "integer"
			},
        
			"login": {
				"type": "string",
				"required": true
			},
			
			"password": {
				"type": "string",
				"required": true,
				"encrypted": true,
				"access": { "referrer": true }
			},
			
			"name": {
				"type": "string",
				"required": true
			},
			
			"tablePrefix": {
				"type": "string"
			},
			
			"userDSN": {
				"type": "string"
			},
			
			"systemDSN": {
				"type": "string"
			},
			
			"version": {
				"type": "string"
			}			
		}
	}

The properties have to be filled with the following data:

Property

Description

host

IP address or hostname of the server on which the database is available.

port

Port of the server on which the database is available.

login

Login of an administrative user to the tables.

password

Password of the administrative user to the tables.

name

Name of the database which contains the tables.

tablePrefix

Prefix for the tables.

userDSN

String with a User DSN for the database with tables, see https://en.wikipedia.org/wiki/Data_Source_Name. It must be in sync with the server, login, password, name properties.

For example:

mysql://user31:o1Kj@192.168.0.1:3306/user31_db

systemDSN

String with a System DSN for the database with tables, see https://en.wikipedia.org/wiki/Data_Source_Name. It must be in sync with the server and name properties.

For example:

mysql:host=192.168.0.1;dbname=user31_db

version

Version of the database server where the tables are hosted.

MySQL

A resource of the “MySQL” type represents a set of MySQL tables with an administrative user for them. Its getDSN() method must contain a DSN with ‘mysql’ driver name.

Database type schema: download

	{
		"apsVersion": "2.0",

		"name": "MySQL",

		"id": "http://aps-standard.org/types/infrastructure/database/mysql/1.0",
		
		"implements": [ 
		    "http://aps-standard.org/types/infrastructure/database/1.0" 
		 ]
	}

MSSQL

A resource of the “MSSQL” type represents a set of Microsoft SQL tables with an administrative user for them. Its getDSN() method must contain a DSN with ‘microsoft:sqlserver’ driver name.

Database type schema: download

	{
		"apsVersion": "2.0",

		"name": "MSSQL",

		"id": "http://aps-standard.org/types/infrastructure/database/mssql/1.0",
		
		"implements": [ 
		    "http://aps-standard.org/types/infrastructure/database/1.0" 
		 ]
	}

PostgreSQL

A resource of the “PostgreSQL” type represents a set of PostgreSQL tables with an administrative user for them. Its getDSN() method must contain a DSN with ‘postgresql’ driver name.

Database type schema: download

	{
		"apsVersion": "2.0",

		"name": "PostgreSQL",

		"id": "http://aps-standard.org/types/infrastructure/database/pgsql/1.0",
		
		"implements": [ 
		    "http://aps-standard.org/types/infrastructure/database/1.0" 
		]
	}