Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection types docs #333

Merged
merged 15 commits into from
Oct 31, 2023
18 changes: 16 additions & 2 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
- name: Generate resource schema doc
run: |
cp ./docs/reference/blocks.md /tmp/blocks.md
cp ./docs/reference/connection_types.md /tmp/connection_types.md

rm -rf ./docs/reference
mkdir ./docs/reference

Expand All @@ -37,9 +39,21 @@ jobs:
done

cp /tmp/blocks.md ./docs/reference/blocks.md
cp /tmp/connection_types.md ./docs/reference/connection_types.md

- name: Generate connection type schema docs
run: |
rm -rf ./docs/reference/connection_types
mkdir ./docs/reference/connection_types

for schema in ./core/src/datayoga_core/resources/schemas/connections/*.schema.json
do
npx jsonschema2mk --schema ${schema} --extension yaml-examples \
--extension front-matter --fm.parent "Connection Types" --fm.grand_parent "Reference" > \
./docs/reference/connection_types/$(basename "${schema}" .schema.json).md
done

# generate the markdown from json schema
- name: Generate block schema doc
- name: Generate block schema docs
run: |
rm -rf ./docs/reference/blocks
mkdir ./docs/reference/blocks
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"description": "Cassandra",
"title": "Cassandra",
"description": "Schema for configuring Cassandra database connection parameters",
"type": "object",
"properties": {
"type": {
"description": "DB type",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"title": "MySQL",
"description": "Schema for configuring MySQL database connection parameters",
"type": "object",
"properties": {
"host": { "description": "DB host", "type": "string" },
"port": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"description": "Oracle",
"title": "Oracle",
"description": "Schema for configuring Oracle database connection parameters",
"type": "object",
"properties": {
"host": { "description": "DB host", "type": "string" },
"port": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"title": "PostgreSQL",
"description": "Schema for configuring PostgreSQL database connection parameters",
"type": "object",
"properties": {
"host": { "description": "DB host", "type": "string" },
"port": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"description": "Redis",
"title": "Redis",
"description": "Schema for configuring Redis database connection parameters",
"type": "object",
"properties": {
"type": {
"description": "DB type",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"title": "SQL Server",
"description": "Schema for configuring SQL Server database connection parameters",
"type": "object",
"properties": {
"host": { "description": "DB host", "type": "string" },
"port": {
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/connection_types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
parent: Reference
has_children: true
---

# Connection Types
46 changes: 46 additions & 0 deletions docs/reference/connection_types/cassandra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
parent: Connection Types
grand_parent: Reference
---

# Cassandra

Schema for configuring Cassandra database connection parameters


**Properties**

|Name|Type|Description|Required|
|----|----|-----------|--------|
|**type**|`string`|DB type<br/>Enum: `"cassandra"`<br/>|yes|
|[**hosts**](#hosts)|`string[]`|Cassandra hosts<br/>|yes|
|**port**|`integer`|Cassandra DB port<br/>Default: `9042`<br/>Minimum: `1`<br/>Maximum: `65535`<br/>|no|
|**database**|`string`|DB name<br/>|no|
|**user**|`string`|DB user<br/>|no|
|**password**|`string`|DB password<br/>|no|

**Additional Properties:** not allowed
**Example**

```yaml
cache:
type: cassandra
hosts:
- localhost
port: 9042
database: myDB
user: myUser
password: myPassword

```

<a name="hosts"></a>
## hosts\[\]: array

Cassandra hosts


**Items: Address of Cassandra node**

**Item Type:** `string`

54 changes: 54 additions & 0 deletions docs/reference/connection_types/mysql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
parent: Connection Types
grand_parent: Reference
---

# MySQL

Schema for configuring MySQL database connection parameters


**Properties**

|Name|Type|Description|Required|
|----|----|-----------|--------|
|**host**|`string`|DB host<br/>|yes|
|**port**|`integer`|DB port<br/>Minimum: `1`<br/>Maximum: `65535`<br/>|no|
|**database**|`string`|DB name<br/>|yes|
|**user**|`string`|DB user<br/>|yes|
|**password**|`string`|DB password<br/>|no|
|[**connect\_args**](#connect_args)|`object`|Additional arguments to use when connecting to the DB<br/>|no|
|[**query\_args**](#query_args)|`object`|Additional query string arguments to use when connecting to the DB<br/>|no|

**Example**

```yaml
hr:
type: mysql
host: localhost
port: 3306
database: hr
user: myuser
password: mypass
connect_args:
ssl_ca: /opt/ssl/ca.crt
ssl_cert: /opt/ssl/client.crt
ssl_key: /opt/ssl/client.key

```

<a name="connect_args"></a>
## connect\_args: object

Additional arguments to use when connecting to the DB


**Additional Properties:** allowed
<a name="query_args"></a>
## query\_args: object

Additional query string arguments to use when connecting to the DB


**Additional Properties:** allowed

55 changes: 55 additions & 0 deletions docs/reference/connection_types/oracle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
parent: Connection Types
grand_parent: Reference
---

# Oracle

Schema for configuring Oracle database connection parameters


**Properties**

|Name|Type|Description|Required|
|----|----|-----------|--------|
|**host**|`string`|DB host<br/>|yes|
|**port**|`integer`|DB port<br/>Minimum: `1`<br/>Maximum: `65535`<br/>|no|
|**driver**|`string`|Driver<br/>|no|
|**database**|`string`|DB name<br/>|yes|
|**user**|`string`|DB user<br/>|yes|
|**password**|`string`|DB password<br/>|no|
|**oracle\_thick\_mode**|`boolean`|Enable oracle's thick mode(requires installed Oracle Client)<br/>Default: `false`<br/>|no|
|**oracle\_thick\_mode\_lib\_dir**|`string`|Path to Oracle Client libraries<br/>|no|
|[**connect\_args**](#connect_args)|`object`|Additional arguments to use when connecting to the DB<br/>|no|
|[**query\_args**](#query_args)|`object`|Additional query string arguments to use when connecting to the DB<br/>|no|

**Example**

```yaml
hr:
type: oracle
host: localhost
port: 5432
database: orcl
user: scott
password: tiger
oracle_thick_mode: true
oracle_thick_mode_lib_dir: /opt/oracle/instantclient_21_8/

```

<a name="connect_args"></a>
## connect\_args: object

Additional arguments to use when connecting to the DB


**Additional Properties:** allowed
<a name="query_args"></a>
## query\_args: object

Additional query string arguments to use when connecting to the DB


**Additional Properties:** allowed

57 changes: 57 additions & 0 deletions docs/reference/connection_types/postgresql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
parent: Connection Types
grand_parent: Reference
---

# PostgreSQL

Schema for configuring PostgreSQL database connection parameters


**Properties**

|Name|Type|Description|Required|
|----|----|-----------|--------|
|**host**|`string`|DB host<br/>|yes|
|**port**|`integer`|DB port<br/>Minimum: `1`<br/>Maximum: `65535`<br/>|no|
|**database**|`string`|DB name<br/>|yes|
|**user**|`string`|DB user<br/>|yes|
|**password**|`string`|DB password<br/>|no|
|[**connect\_args**](#connect_args)|`object`|Additional arguments to use when connecting to the DB<br/>|no|
|[**query\_args**](#query_args)|`object`|Additional query string arguments to use when connecting to the DB<br/>|no|

**Example**

```yaml
hr:
type: postgresql
host: localhost
port: 5432
database: postgres
user: postgres
password: postgres
connect_args:
connect_timeout: 10
query_args:
sslmode: verify-ca
sslrootcert: /opt/ssl/ca.crt
sslcert: /opt/ssl/client.crt
sslkey: /opt/ssl/client.key

```

<a name="connect_args"></a>
## connect\_args: object

Additional arguments to use when connecting to the DB


**Additional Properties:** allowed
<a name="query_args"></a>
## query\_args: object

Additional query string arguments to use when connecting to the DB


**Additional Properties:** allowed

40 changes: 40 additions & 0 deletions docs/reference/connection_types/redis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
parent: Connection Types
grand_parent: Reference
---

# Redis

Schema for configuring Redis database connection parameters


**Properties**

|Name|Type|Description|Required|
|----|----|-----------|--------|
|**type**|`string`|DB type<br/>Enum: `"redis"`<br/>|yes|
|**host**|`string`|Redis DB host<br/>|yes|
|**port**|`integer`|Redis DB port<br/>Minimum: `1`<br/>Maximum: `65535`<br/>|yes|
|**user**|`string`|Redis DB user<br/>|no|
|**password**|`string`|Redis DB password<br/>|no|
|**key**<br/>(Private key file to authenticate with)|`string`||no|
|**key\_password**<br/>(Password for unlocking an encrypted private key)|`string`||no|
|**cert**<br/>(Client certificate file to authenticate with)|`string`||no|
|**cacert**<br/>(CA certificate file to verify with)|`string`||no|

**Additional Properties:** not allowed
**If property *key* is defined**, property/ies *cert* is/are required.
**If property *cert* is defined**, property/ies *key* is/are required.
**If property *key_password* is defined**, property/ies *key* is/are required.
**If property *user* is defined**, property/ies *password* is/are required.
**Example**

```yaml
cache:
type: redis
host: localhost
port: 6379

```


50 changes: 50 additions & 0 deletions docs/reference/connection_types/sqlserver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
parent: Connection Types
grand_parent: Reference
---

# SQL Server

Schema for configuring SQL Server database connection parameters


**Properties**

|Name|Type|Description|Required|
|----|----|-----------|--------|
|**host**|`string`|DB host<br/>|yes|
|**port**|`integer`|DB port<br/>Minimum: `1`<br/>Maximum: `65535`<br/>|no|
|**database**|`string`|DB name<br/>|yes|
|**user**|`string`|DB user<br/>|yes|
|**password**|`string`|DB password<br/>|no|
|[**connect\_args**](#connect_args)|`object`|Additional arguments to use when connecting to the DB<br/>|no|
|[**query\_args**](#query_args)|`object`|Additional query string arguments to use when connecting to the DB<br/>|no|

**Example**

```yaml
hr:
type: sqlserver
host: localhost
port: 1433
database: hr
user: myuser
password: mypass

```

<a name="connect_args"></a>
## connect\_args: object

Additional arguments to use when connecting to the DB


**Additional Properties:** allowed
<a name="query_args"></a>
## query\_args: object

Additional query string arguments to use when connecting to the DB


**Additional Properties:** allowed