Skip to content

Commit

Permalink
fix(extensions): schema for db ctx provider (#1534)
Browse files Browse the repository at this point in the history
* fix(extensions): schema for db ctx provider

* fix: invalid enum
  • Loading branch information
Patrick-Erichsen authored Jun 20, 2024
1 parent 5876649 commit 6fdad55
Show file tree
Hide file tree
Showing 4 changed files with 230 additions and 195 deletions.
101 changes: 55 additions & 46 deletions docs/static/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,8 @@
"code",
"system",
"currentFile",
"url"
"url",
"database"
],
"markdownEnumDescriptions": [
"Reference the contents of the current changes as given by `git diff`",
Expand All @@ -1341,7 +1342,8 @@
"Reference specific functions and classes from throughout your codebase",
"Reference your operating system and cpu",
"Reference the contents of the currently active file",
"Reference the contents of a page at a URL"
"Reference the contents of a page at a URL",
"Reference table schemas"
],
"type": "string"
},
Expand Down Expand Up @@ -1457,56 +1459,63 @@
}
},
"then": {
"connections": {
"type": "array",
"description": "A list of database connections",
"items": {
"type": "object",
"properties": {
"params": {
"properties": {
"name": {
"type": "string",
"description": "A unique name for this database connection"
},
"connection_type": {
"type": "string",
"description": "The type of database (e.g., 'postgres', 'mysql')",
"enum": ["postgres", "mysql", "sqlite"]
},
"connection": {
"type": "object",
"properties": {
"user": {
"type": "string",
"description": "The database user name"
},
"host": {
"type": "string",
"description": "The host address of the database server"
},
"database": {
"type": "string",
"description": "The name of the database to connect to"
},
"password": {
"type": "string",
"description": "The password for the database user"
},
"port": {
"type": "integer",
"description": "The port number to connect to at the host"
"connections": {
"type": "array",
"description": "A list of database connections",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A unique name for this database connection"
},
"connection_type": {
"type": "string",
"description": "The type of database (e.g., 'postgres', 'mysql')",
"enum": ["postgres", "mysql", "sqlite"]
},
"connection": {
"type": "object",
"properties": {
"user": {
"type": "string",
"description": "The database user name"
},
"host": {
"type": "string",
"description": "The host address of the database server"
},
"database": {
"type": "string",
"description": "The name of the database to connect to"
},
"password": {
"type": "string",
"description": "The password for the database user"
},
"port": {
"type": "integer",
"description": "The port number to connect to at the host"
},
"filename": {
"type": "string",
"description": "File location for simple file DB's"
}
},
"required": []
}
},
"filename": {
"type": "string",
"description": "File location for simple file DB's"
}
},
"required": []
"required": ["name", "connection_type", "connection"]
}
}
},
"required": ["name", "type", "connection"]
"required": ["connections"]
}
},
"required": ["connections"]
"required": ["params"]
}
},
{
Expand Down
101 changes: 55 additions & 46 deletions extensions/intellij/src/main/resources/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,8 @@
"code",
"system",
"currentFile",
"url"
"url",
"database"
],
"markdownEnumDescriptions": [
"Reference the contents of the current changes as given by `git diff`",
Expand All @@ -1341,7 +1342,8 @@
"Reference specific functions and classes from throughout your codebase",
"Reference your operating system and cpu",
"Reference the contents of the currently active file",
"Reference the contents of a page at a URL"
"Reference the contents of a page at a URL",
"Reference table schemas"
],
"type": "string"
},
Expand Down Expand Up @@ -1457,56 +1459,63 @@
}
},
"then": {
"connections": {
"type": "array",
"description": "A list of database connections",
"items": {
"type": "object",
"properties": {
"params": {
"properties": {
"name": {
"type": "string",
"description": "A unique name for this database connection"
},
"connection_type": {
"type": "string",
"description": "The type of database (e.g., 'postgres', 'mysql')",
"enum": ["postgres", "mysql", "sqlite"]
},
"connection": {
"type": "object",
"properties": {
"user": {
"type": "string",
"description": "The database user name"
},
"host": {
"type": "string",
"description": "The host address of the database server"
},
"database": {
"type": "string",
"description": "The name of the database to connect to"
},
"password": {
"type": "string",
"description": "The password for the database user"
},
"port": {
"type": "integer",
"description": "The port number to connect to at the host"
"connections": {
"type": "array",
"description": "A list of database connections",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A unique name for this database connection"
},
"connection_type": {
"type": "string",
"description": "The type of database (e.g., 'postgres', 'mysql')",
"enum": ["postgres", "mysql", "sqlite"]
},
"connection": {
"type": "object",
"properties": {
"user": {
"type": "string",
"description": "The database user name"
},
"host": {
"type": "string",
"description": "The host address of the database server"
},
"database": {
"type": "string",
"description": "The name of the database to connect to"
},
"password": {
"type": "string",
"description": "The password for the database user"
},
"port": {
"type": "integer",
"description": "The port number to connect to at the host"
},
"filename": {
"type": "string",
"description": "File location for simple file DB's"
}
},
"required": []
}
},
"filename": {
"type": "string",
"description": "File location for simple file DB's"
}
},
"required": []
"required": ["name", "connection_type", "connection"]
}
}
},
"required": ["name", "type", "connection"]
"required": ["connections"]
}
},
"required": ["connections"]
"required": ["params"]
}
},
{
Expand Down
Loading

0 comments on commit 6fdad55

Please sign in to comment.