Skip to content

Commit

Permalink
[destination-typesense] Connect to typesense with HA airbytehq#42866 (a…
Browse files Browse the repository at this point in the history
…irbytehq#42868)

Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
  • Loading branch information
3 people authored Aug 5, 2024
1 parent e6a98e1 commit 487e0ad
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@


def get_client(config: Mapping[str, Any]) -> Client:
node = {"host": config.get("host"), "port": config.get("port") or "8108", "protocol": config.get("protocol") or "https"}
hosts = config.get("host").split(",")
path = config.get("path")
if path:
node["path"] = path
client = Client({"api_key": config.get("api_key"), "nodes": [node], "connection_timeout_seconds": 3600})
nodes = []
for host in hosts:
node = {"host": host, "port": config.get("port") or "8108", "protocol": config.get("protocol") or "https"}
if path:
node["path"] = path
nodes.append(node)
client = Client({"api_key": config.get("api_key"), "nodes": nodes, "connection_timeout_seconds": 3600})

return client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"host": {
"title": "Host",
"type": "string",
"description": "Hostname of the Typesense instance without protocol.",
"description": "Hostname of the Typesense instance without protocol. Accept multiple hosts separated by comma.",
"order": 1
},
"port": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: database
connectorType: destination
definitionId: 36be8dc6-9851-49af-b776-9d4c30e4ab6a
dockerImageTag: 0.1.16
dockerImageTag: 0.1.17
dockerRepository: airbyte/destination-typesense
connectorBuildOptions:
baseImage: docker.io/airbyte/python-connector-base:2.0.0@sha256:c44839ba84406116e8ba68722a0f30e8f6e7056c726f447681bb9e9ece8bd916
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "0.1.16"
version = "0.1.17"
name = "destination-typesense"
description = "Destination Implementation for Typesense."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand Down
5 changes: 5 additions & 0 deletions docs/integrations/destinations/typesense.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ To use the Typesense destination, you'll need an existing Typesense instance. Yo

The setup only requires two fields. First is the `host` which is the address at which Typesense can be reached. The second piece of information is the API key.

### Typesense with High Availability

To connect a Typesense with HA, you can type multiple hosts on the host field using a comma separator.

## Changelog

<details>
<summary>Expand to review</summary>

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :---------------------------- |
| 0.1.17 | 2024-08-01 | [42868](https://github.com/airbytehq/airbyte/pull/42868) | Allows you to specify multiple hosts, separated by commas, to connect to Typesense with HA. |
| 0.1.16 | 2024-08-03 | [43282](https://github.com/airbytehq/airbyte/pull/43282) | Update dependencies |
| 0.1.15 | 2024-07-27 | [42606](https://github.com/airbytehq/airbyte/pull/42606) | Update dependencies |
| 0.1.14 | 2024-07-20 | [42146](https://github.com/airbytehq/airbyte/pull/42146) | Update dependencies |
Expand Down

0 comments on commit 487e0ad

Please sign in to comment.