Skip to content

Commit

Permalink
Updated the SQL plugin's schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat committed Jul 18, 2024
1 parent a445dd6 commit fa25429
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 20 deletions.
26 changes: 13 additions & 13 deletions schema/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"additionalProperties": false,
"properties": {
"custom": {
"$ref": "plugin/custom.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/custom.json"
}
},
"required": ["custom"]
Expand All @@ -153,7 +153,7 @@
"additionalProperties": false,
"properties": {
"akeneo": {
"$ref": "plugin/akeneo.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/akeneo.json"
}
},
"required": ["akeneo"]
Expand All @@ -163,7 +163,7 @@
"additionalProperties": false,
"properties": {
"sylius": {
"$ref": "plugin/sylius.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sylius.json"
}
},
"required": ["sylius"]
Expand All @@ -173,7 +173,7 @@
"additionalProperties": false,
"properties": {
"csv": {
"$ref": "plugin/csv.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/csv.json"
}
},
"required": ["csv"]
Expand All @@ -183,7 +183,7 @@
"additionalProperties": false,
"properties": {
"spreadsheet": {
"$ref": "plugin/spreadsheet.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/spreadsheet.json"
}
},
"required": ["spreadsheet"]
Expand All @@ -193,7 +193,7 @@
"additionalProperties": false,
"properties": {
"fastmap": {
"$ref": "plugin/fastmap.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json"
}
},
"required": ["fastmap"]
Expand All @@ -203,7 +203,7 @@
"additionalProperties": false,
"properties": {
"stream": {
"$ref": "plugin/stream.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/stream.json"
}
},
"required": ["stream"]
Expand All @@ -213,7 +213,7 @@
"additionalProperties": false,
"properties": {
"batch": {
"$ref": "plugin/batch.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/batch.json"
}
},
"required": ["batch"]
Expand All @@ -223,7 +223,7 @@
"additionalProperties": false,
"properties": {
"ftp": {
"$ref": "plugin/ftp.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/ftp.json"
}
},
"required": ["ftp"]
Expand All @@ -233,7 +233,7 @@
"additionalProperties": false,
"properties": {
"http": {
"$ref": "plugin/http.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/http.json"
}
},
"required": ["http"]
Expand All @@ -243,7 +243,7 @@
"additionalProperties": false,
"properties": {
"sftp": {
"$ref": "plugin/sftp.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sftp.json"
}
},
"required": ["sftp"]
Expand All @@ -253,7 +253,7 @@
"additionalProperties": false,
"properties": {
"sql": {
"$ref": "plugin/sql.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sql.json"
}
},
"required": ["sql"]
Expand All @@ -263,7 +263,7 @@
"additionalProperties": false,
"properties": {
"json": {
"$ref": "plugin/json.json"
"$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/json.json"
}
},
"required": ["json"]
Expand Down
15 changes: 15 additions & 0 deletions schema/expressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@
{ "type": "number" }
]
},
"expression-or-boolean": {
"oneOf": [
{ "$ref": "#/$defs/bundled-expression" },
{ "type": "boolean" }
]
},
"expression-or-any": {
"oneOf": [
{ "$ref": "#/$defs/bundled-expression" },
{ "$ref": "#/$defs/datetime" },
{ "type": "string" },
{ "type": "number" },
{ "type": "boolean" }
]
},
"expression-or-datetime": {
"oneOf": [
{ "$ref": "#/$defs/bundled-expression" },
Expand Down
4 changes: 2 additions & 2 deletions schema/plugin/akeneo.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@
"type": "object",
"additionalProperties": false,
"properties": {
"map": { "$ref": "fastmap.json#/$defs/fastmap-items" }
"map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"object": { "$ref": "fastmap.json#/$defs/fastmap-items" },
"object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" },
"class": { "type": "string" }
}
}
Expand Down
212 changes: 207 additions & 5 deletions schema/plugin/sql.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,211 @@
"$id": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/sql.json",
"title": "SQL plugin for Middleware Satellite",
"description": "A Satellite is a micro-service aimed at managing data pipelines and data processing",
"type": "object",
"additionalProperties": false,
"properties": {
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" }
}
"$defs": {
"connection": {
"type": "object",
"properties": {
"dsn": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"username": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"password": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"persistent": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-boolean" },
"shared": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-boolean" }
}
},
"query-parameters": {
"oneOf": [
{
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"oneOf": [
{
"type": "object",
"properties": {
"value": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-any" }
}
},
{
"type": "object",
"properties": {
"from": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" }
}
}
]
}
}
}
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"type": "object",
"properties": {
"value": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-any" }
}
}
}
}
]
},
"query-list": {
"type": "array",
"items": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" }
}
},
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" },
"connection": { "$ref": "#/$defs/connection"},
"before": { "$ref": "#/$defs/query-list"},
"after": { "$ref": "#/$defs/query-list"},
"extractor": {
"oneOf": [
{
"type": "object",
"properties": {
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"parameters": { "$ref": "#/$defs/query-parameters"}
}
},
{
"type": "object",
"properties": {
"conditional": {
"type": "array",
"items": {
"type": "object",
"properties": {
"condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" },
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"parameters": { "$ref": "#/$defs/query-parameters"}
}
}
}
}
}
]
}
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" },
"connection": { "$ref": "#/$defs/connection"},
"before": { "$ref": "#/$defs/query-list"},
"after": { "$ref": "#/$defs/query-list"},
"lookup": {
"oneOf": [
{
"type": "object",
"properties": {
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"parameters": { "$ref": "#/$defs/query-parameters"},
"merge": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" },
"class": { "type": "string" }
}
}
]
}
}
},
{
"type": "object",
"properties": {
"conditional": {
"type": "array",
"items": {
"type": "object",
"properties": {
"condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" },
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"parameters": { "$ref": "#/$defs/query-parameters"},
"merge": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"map": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" }
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"object": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/plugin/fastmap.json#/$defs/fastmap-items" },
"class": { "type": "string" }
}
}
]
}
}
}
}
}
}
]
}
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"expression_language": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/definitions.json#/$defs/expression_language" },
"connection": { "$ref": "#/$defs/connection"},
"before": { "$ref": "#/$defs/query-list"},
"after": { "$ref": "#/$defs/query-list"},
"loader": {
"oneOf": [
{
"type": "object",
"properties": {
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"parameters": { "$ref": "#/$defs/query-parameters"}
}
},
{
"type": "object",
"properties": {
"conditional": {
"type": "array",
"items": {
"type": "object",
"properties": {
"condition":{ "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/bundled-expression" },
"query": { "$ref": "https://raw.githubusercontent.com/php-etl/satellite/master/schema/expressions.json#/$defs/expression-or-string" },
"parameters": { "$ref": "#/$defs/query-parameters"}
}
}
}
}
}
]
}
}
}
]
}

0 comments on commit fa25429

Please sign in to comment.