Skip to content

Database servers file descriptor

Eduardo Nunes edited this page Sep 19, 2015 · 3 revisions

Database servers file descriptor

This document provides information about the json file that stores all database servers settings defined by the user. The file described here will stored in the user's home directory ~/.sqlectron.json.

Structure (sample)

{
  "id": "http://some.site.somewhere/entry-schema#",
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "schema for an fstab entry",
  "type": "object",
  "required": [ "servers" ],
  "properties": {
    "servers": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "oneOf": [
          { "$ref": "#/definitions/host" },
          { "$ref": "#/definitions/socketPath" }
        ]
      }
    }
  },
  "definitions": {
    "host": {
      "properties": {
        "name": { "type": "string" },
        "client": { "enum": [ "mysql", "postgresql" ] },
        "host": { "type": "string" },
        "port": { "type": "number" },
        "database": { "type": "string" },
        "user": { "type": "string" },
        "password": { "type": "string" },
        "ssh": {
          "type": "object",
          "oneOf": [
            { "$ref": "#/definitions/sshPassword" },
            { "$ref": "#/definitions/sshPrivateKey" }
          ]
        }
      },
      "required": [ "name", "client", "host", "port", "database", "user", "password" ],
      "additionalProperties": false
    },
    "socketPath": {
      "properties": {
        "name": { "type": "string" },
        "client": { "enum": [ "mysql", "postgresql" ] },
        "socketPath": { "type": "string" },
        "database": { "type": "string" },
        "user": { "type": "string" },
        "password": { "type": "string" },
        "ssh": {
          "type": "object",
          "oneOf": [
            { "$ref": "#/definitions/sshPassword" },
            { "$ref": "#/definitions/sshPrivateKey" }
          ]
        }
      },
      "required": [ "name", "client", "socketPath", "database", "user", "password" ],
      "additionalProperties": false
    },
    "sshPassword": {
      "properties": {
        "host": { "type": "string" },
        "port": { "type": "number" },
        "user": { "type": "string" },
        "password": { "type": "string" }
      },
      "required": [ "host", "port", "user", "password" ],
      "additionalProperties": false
    },
    "sshPrivateKey": {
      "properties": {
        "host": { "type": "string" },
        "port": { "type": "number" },
        "user": { "type": "string" },
        "privateKey": { "type": "string" }
      },
      "required": [ "host", "port", "user", "privateKey" ],
      "additionalProperties": false
    }
  }
}
Clone this wiki locally