outhad-integrations 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +43 -0
- data/.ruby-version +1 -0
- data/.vscode/settings.json +5 -0
- data/README.md +76 -0
- data/Rakefile +12 -0
- data/lib/outhad/integrations/config.rb +14 -0
- data/lib/outhad/integrations/core/base_connector.rb +79 -0
- data/lib/outhad/integrations/core/constants.rb +103 -0
- data/lib/outhad/integrations/core/destination_connector.rb +20 -0
- data/lib/outhad/integrations/core/fullrefresher.rb +19 -0
- data/lib/outhad/integrations/core/http_client.rb +17 -0
- data/lib/outhad/integrations/core/http_helper.rb +36 -0
- data/lib/outhad/integrations/core/query_builder.rb +33 -0
- data/lib/outhad/integrations/core/rate_limiter.rb +19 -0
- data/lib/outhad/integrations/core/source_connector.rb +66 -0
- data/lib/outhad/integrations/core/streaming_http_client.rb +21 -0
- data/lib/outhad/integrations/core/unstructured_source_connector.rb +52 -0
- data/lib/outhad/integrations/core/utils.rb +123 -0
- data/lib/outhad/integrations/core/vector_source_connector.rb +14 -0
- data/lib/outhad/integrations/destination/airtable/client.rb +157 -0
- data/lib/outhad/integrations/destination/airtable/config/catalog.json +6 -0
- data/lib/outhad/integrations/destination/airtable/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/airtable/config/spec.json +23 -0
- data/lib/outhad/integrations/destination/airtable/icon.svg +6 -0
- data/lib/outhad/integrations/destination/airtable/schema_helper.rb +141 -0
- data/lib/outhad/integrations/destination/ais_data_store/client.rb +130 -0
- data/lib/outhad/integrations/destination/ais_data_store/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/ais_data_store/config/spec.json +68 -0
- data/lib/outhad/integrations/destination/ais_data_store/icon.svg +4 -0
- data/lib/outhad/integrations/destination/amazon_s3/client.rb +92 -0
- data/lib/outhad/integrations/destination/amazon_s3/config/catalog.json +16 -0
- data/lib/outhad/integrations/destination/amazon_s3/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/amazon_s3/config/spec.json +56 -0
- data/lib/outhad/integrations/destination/amazon_s3/icon.svg +34 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/client.rb +147 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/config/spec.json +44 -0
- data/lib/outhad/integrations/destination/databricks_lakehouse/icon.svg +65 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/client.rb +125 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/config/catalog.json +42 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/config/spec.json +28 -0
- data/lib/outhad/integrations/destination/facebook_custom_audience/icon.svg +23 -0
- data/lib/outhad/integrations/destination/google_sheets/client.rb +240 -0
- data/lib/outhad/integrations/destination/google_sheets/config/catalog.json +6 -0
- data/lib/outhad/integrations/destination/google_sheets/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/google_sheets/config/spec.json +75 -0
- data/lib/outhad/integrations/destination/google_sheets/icon.svg +1 -0
- data/lib/outhad/integrations/destination/http/client.rb +106 -0
- data/lib/outhad/integrations/destination/http/config/catalog.json +16 -0
- data/lib/outhad/integrations/destination/http/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/http/config/spec.json +24 -0
- data/lib/outhad/integrations/destination/http/icon.svg +9 -0
- data/lib/outhad/integrations/destination/hubspot/client.rb +122 -0
- data/lib/outhad/integrations/destination/hubspot/config/catalog.json +351 -0
- data/lib/outhad/integrations/destination/hubspot/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/hubspot/config/spec.json +18 -0
- data/lib/outhad/integrations/destination/hubspot/icon.svg +5 -0
- data/lib/outhad/integrations/destination/iterable/client.rb +111 -0
- data/lib/outhad/integrations/destination/iterable/config/catalog.json +47 -0
- data/lib/outhad/integrations/destination/iterable/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/iterable/config/spec.json +19 -0
- data/lib/outhad/integrations/destination/iterable/icon.svg +71 -0
- data/lib/outhad/integrations/destination/klaviyo/client.rb +119 -0
- data/lib/outhad/integrations/destination/klaviyo/config/catalog.json +103 -0
- data/lib/outhad/integrations/destination/klaviyo/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/klaviyo/config/spec.json +24 -0
- data/lib/outhad/integrations/destination/klaviyo/icon.svg +6 -0
- data/lib/outhad/integrations/destination/mailchimp/client.rb +141 -0
- data/lib/outhad/integrations/destination/mailchimp/config/catalog.json +142 -0
- data/lib/outhad/integrations/destination/mailchimp/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/mailchimp/config/spec.json +28 -0
- data/lib/outhad/integrations/destination/mailchimp/icon.svg +4 -0
- data/lib/outhad/integrations/destination/maria_db/client.rb +114 -0
- data/lib/outhad/integrations/destination/maria_db/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/maria_db/config/spec.json +48 -0
- data/lib/outhad/integrations/destination/maria_db/icon.svg +15 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/client.rb +150 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/config/catalog.json +161 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/config/spec.json +35 -0
- data/lib/outhad/integrations/destination/microsoft_dynamics/icon.svg +2 -0
- data/lib/outhad/integrations/destination/microsoft_excel/client.rb +198 -0
- data/lib/outhad/integrations/destination/microsoft_excel/config/catalog.json +7 -0
- data/lib/outhad/integrations/destination/microsoft_excel/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/microsoft_excel/config/spec.json +19 -0
- data/lib/outhad/integrations/destination/microsoft_excel/icon.svg +18 -0
- data/lib/outhad/integrations/destination/microsoft_sql/client.rb +137 -0
- data/lib/outhad/integrations/destination/microsoft_sql/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/microsoft_sql/config/spec.json +68 -0
- data/lib/outhad/integrations/destination/microsoft_sql/icon.svg +22 -0
- data/lib/outhad/integrations/destination/odoo/client.rb +109 -0
- data/lib/outhad/integrations/destination/odoo/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/odoo/config/spec.json +39 -0
- data/lib/outhad/integrations/destination/odoo/icon.svg +21 -0
- data/lib/outhad/integrations/destination/oracle_db/client.rb +112 -0
- data/lib/outhad/integrations/destination/oracle_db/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/oracle_db/config/spec.json +47 -0
- data/lib/outhad/integrations/destination/oracle_db/icon.svg +4 -0
- data/lib/outhad/integrations/destination/pinecone_db/client.rb +154 -0
- data/lib/outhad/integrations/destination/pinecone_db/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/pinecone_db/config/spec.json +32 -0
- data/lib/outhad/integrations/destination/pinecone_db/icon.svg +1 -0
- data/lib/outhad/integrations/destination/postgresql/client.rb +130 -0
- data/lib/outhad/integrations/destination/postgresql/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/postgresql/config/spec.json +68 -0
- data/lib/outhad/integrations/destination/postgresql/icon.svg +20 -0
- data/lib/outhad/integrations/destination/qdrant/client.rb +184 -0
- data/lib/outhad/integrations/destination/qdrant/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/qdrant/config/spec.json +23 -0
- data/lib/outhad/integrations/destination/qdrant/icon.svg +1 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/client.rb +136 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/config/catalog.json +6 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/config/meta.json +16 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/config/spec.json +52 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/icon.svg +16 -0
- data/lib/outhad/integrations/destination/salesforce_consumer_goods_cloud/schema_helper.rb +132 -0
- data/lib/outhad/integrations/destination/salesforce_crm/client.rb +114 -0
- data/lib/outhad/integrations/destination/salesforce_crm/config/catalog.json +320 -0
- data/lib/outhad/integrations/destination/salesforce_crm/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/salesforce_crm/config/spec.json +46 -0
- data/lib/outhad/integrations/destination/salesforce_crm/icon.svg +16 -0
- data/lib/outhad/integrations/destination/sftp/client.rb +186 -0
- data/lib/outhad/integrations/destination/sftp/config/catalog.json +16 -0
- data/lib/outhad/integrations/destination/sftp/config/meta.json +16 -0
- data/lib/outhad/integrations/destination/sftp/config/spec.json +73 -0
- data/lib/outhad/integrations/destination/sftp/icon.svg +1 -0
- data/lib/outhad/integrations/destination/slack/client.rb +125 -0
- data/lib/outhad/integrations/destination/slack/config/catalog.json +22 -0
- data/lib/outhad/integrations/destination/slack/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/slack/config/spec.json +23 -0
- data/lib/outhad/integrations/destination/slack/icon.svg +26 -0
- data/lib/outhad/integrations/destination/stripe/client.rb +94 -0
- data/lib/outhad/integrations/destination/stripe/config/catalog.json +128 -0
- data/lib/outhad/integrations/destination/stripe/config/meta.json +15 -0
- data/lib/outhad/integrations/destination/stripe/config/spec.json +18 -0
- data/lib/outhad/integrations/destination/stripe/icon.svg +10 -0
- data/lib/outhad/integrations/destination/zendesk/client.rb +132 -0
- data/lib/outhad/integrations/destination/zendesk/config/catalog.json +110 -0
- data/lib/outhad/integrations/destination/zendesk/config/meta.json +18 -0
- data/lib/outhad/integrations/destination/zendesk/config/spec.json +32 -0
- data/lib/outhad/integrations/destination/zendesk/icon.svg +63 -0
- data/lib/outhad/integrations/protocol/protocol.json +189 -0
- data/lib/outhad/integrations/protocol/protocol.rb +228 -0
- data/lib/outhad/integrations/rollout.rb +66 -0
- data/lib/outhad/integrations/service.rb +55 -0
- data/lib/outhad/integrations/source/amazon_s3/client.rb +235 -0
- data/lib/outhad/integrations/source/amazon_s3/config/meta.json +16 -0
- data/lib/outhad/integrations/source/amazon_s3/config/spec.json +119 -0
- data/lib/outhad/integrations/source/amazon_s3/icon.svg +34 -0
- data/lib/outhad/integrations/source/anthropic/client.rb +135 -0
- data/lib/outhad/integrations/source/anthropic/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/anthropic/config/meta.json +16 -0
- data/lib/outhad/integrations/source/anthropic/config/spec.json +56 -0
- data/lib/outhad/integrations/source/anthropic/icon.svg +1 -0
- data/lib/outhad/integrations/source/aws_athena/client.rb +109 -0
- data/lib/outhad/integrations/source/aws_athena/config/meta.json +16 -0
- data/lib/outhad/integrations/source/aws_athena/config/spec.json +63 -0
- data/lib/outhad/integrations/source/aws_athena/icon.svg +22 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/client.rb +91 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/config/meta.json +16 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/config/spec.json +58 -0
- data/lib/outhad/integrations/source/aws_bedrock_model/icon.svg +1 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/client.rb +79 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/config/meta.json +16 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/config/spec.json +52 -0
- data/lib/outhad/integrations/source/aws_sagemaker_model/icon.svg +7 -0
- data/lib/outhad/integrations/source/bigquery/client.rb +98 -0
- data/lib/outhad/integrations/source/bigquery/config/meta.json +16 -0
- data/lib/outhad/integrations/source/bigquery/config/spec.json +83 -0
- data/lib/outhad/integrations/source/bigquery/icon.svg +1 -0
- data/lib/outhad/integrations/source/clickhouse/client.rb +102 -0
- data/lib/outhad/integrations/source/clickhouse/config/meta.json +16 -0
- data/lib/outhad/integrations/source/clickhouse/config/spec.json +42 -0
- data/lib/outhad/integrations/source/clickhouse/icon.svg +25 -0
- data/lib/outhad/integrations/source/databricks/client.rb +98 -0
- data/lib/outhad/integrations/source/databricks/config/meta.json +17 -0
- data/lib/outhad/integrations/source/databricks/config/spec.json +56 -0
- data/lib/outhad/integrations/source/databricks/icon.svg +19 -0
- data/lib/outhad/integrations/source/databrics_model/client.rb +89 -0
- data/lib/outhad/integrations/source/databrics_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/databrics_model/config/meta.json +17 -0
- data/lib/outhad/integrations/source/databrics_model/config/spec.json +63 -0
- data/lib/outhad/integrations/source/databrics_model/icon.svg +19 -0
- data/lib/outhad/integrations/source/firecrawl/client.rb +151 -0
- data/lib/outhad/integrations/source/firecrawl/config/catalog.json +29 -0
- data/lib/outhad/integrations/source/firecrawl/config/meta.json +17 -0
- data/lib/outhad/integrations/source/firecrawl/config/spec.json +31 -0
- data/lib/outhad/integrations/source/firecrawl/icon.svg +4 -0
- data/lib/outhad/integrations/source/generic_open_ai/client.rb +118 -0
- data/lib/outhad/integrations/source/generic_open_ai/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/generic_open_ai/config/meta.json +16 -0
- data/lib/outhad/integrations/source/generic_open_ai/config/spec.json +63 -0
- data/lib/outhad/integrations/source/generic_open_ai/icon.svg +6 -0
- data/lib/outhad/integrations/source/google_vertex_model/client.rb +83 -0
- data/lib/outhad/integrations/source/google_vertex_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/google_vertex_model/config/meta.json +17 -0
- data/lib/outhad/integrations/source/google_vertex_model/config/spec.json +105 -0
- data/lib/outhad/integrations/source/google_vertex_model/icon.svg +2 -0
- data/lib/outhad/integrations/source/http_model/client.rb +108 -0
- data/lib/outhad/integrations/source/http_model/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/http_model/config/meta.json +16 -0
- data/lib/outhad/integrations/source/http_model/config/spec.json +70 -0
- data/lib/outhad/integrations/source/http_model/icon.svg +9 -0
- data/lib/outhad/integrations/source/intuit_quick_books/client.rb +213 -0
- data/lib/outhad/integrations/source/intuit_quick_books/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/intuit_quick_books/config/meta.json +17 -0
- data/lib/outhad/integrations/source/intuit_quick_books/config/spec.json +44 -0
- data/lib/outhad/integrations/source/intuit_quick_books/icon.svg +1 -0
- data/lib/outhad/integrations/source/maria_db/client.rb +92 -0
- data/lib/outhad/integrations/source/maria_db/config/meta.json +16 -0
- data/lib/outhad/integrations/source/maria_db/config/spec.json +48 -0
- data/lib/outhad/integrations/source/maria_db/icon.svg +15 -0
- data/lib/outhad/integrations/source/odoo/client.rb +106 -0
- data/lib/outhad/integrations/source/odoo/config/meta.json +15 -0
- data/lib/outhad/integrations/source/odoo/config/spec.json +39 -0
- data/lib/outhad/integrations/source/odoo/icon.svg +21 -0
- data/lib/outhad/integrations/source/open_ai/client.rb +118 -0
- data/lib/outhad/integrations/source/open_ai/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/open_ai/config/meta.json +16 -0
- data/lib/outhad/integrations/source/open_ai/config/spec.json +56 -0
- data/lib/outhad/integrations/source/open_ai/icon.svg +1 -0
- data/lib/outhad/integrations/source/oracle_db/client.rb +127 -0
- data/lib/outhad/integrations/source/oracle_db/config/meta.json +16 -0
- data/lib/outhad/integrations/source/oracle_db/config/spec.json +47 -0
- data/lib/outhad/integrations/source/oracle_db/icon.svg +4 -0
- data/lib/outhad/integrations/source/pinecone_db/client.rb +73 -0
- data/lib/outhad/integrations/source/pinecone_db/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/pinecone_db/config/meta.json +16 -0
- data/lib/outhad/integrations/source/pinecone_db/config/spec.json +34 -0
- data/lib/outhad/integrations/source/pinecone_db/icon.svg +2 -0
- data/lib/outhad/integrations/source/postgresql/client.rb +112 -0
- data/lib/outhad/integrations/source/postgresql/config/meta.json +16 -0
- data/lib/outhad/integrations/source/postgresql/config/spec.json +86 -0
- data/lib/outhad/integrations/source/postgresql/icon.svg +20 -0
- data/lib/outhad/integrations/source/qdrant/client.rb +86 -0
- data/lib/outhad/integrations/source/qdrant/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/qdrant/config/meta.json +16 -0
- data/lib/outhad/integrations/source/qdrant/config/spec.json +29 -0
- data/lib/outhad/integrations/source/qdrant/icon.svg +1 -0
- data/lib/outhad/integrations/source/redshift/client.rb +109 -0
- data/lib/outhad/integrations/source/redshift/config/meta.json +16 -0
- data/lib/outhad/integrations/source/redshift/config/spec.json +71 -0
- data/lib/outhad/integrations/source/redshift/icon.svg +15 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/client.rb +133 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/config/meta.json +18 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/config/spec.json +53 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/icon.svg +16 -0
- data/lib/outhad/integrations/source/salesforce_consumer_goods_cloud/schema_helper.rb +130 -0
- data/lib/outhad/integrations/source/sftp/client.rb +133 -0
- data/lib/outhad/integrations/source/sftp/config/meta.json +16 -0
- data/lib/outhad/integrations/source/sftp/config/spec.json +59 -0
- data/lib/outhad/integrations/source/sftp/icon.svg +1 -0
- data/lib/outhad/integrations/source/snowflake/client.rb +92 -0
- data/lib/outhad/integrations/source/snowflake/config/meta.json +16 -0
- data/lib/outhad/integrations/source/snowflake/config/spec.json +82 -0
- data/lib/outhad/integrations/source/snowflake/icon.svg +10 -0
- data/lib/outhad/integrations/source/watsonx_ai/client.rb +194 -0
- data/lib/outhad/integrations/source/watsonx_ai/config/catalog.json +6 -0
- data/lib/outhad/integrations/source/watsonx_ai/config/meta.json +16 -0
- data/lib/outhad/integrations/source/watsonx_ai/config/spec.json +74 -0
- data/lib/outhad/integrations/source/watsonx_ai/icon.svg +1 -0
- data/lib/outhad/integrations/source/watsonx_data/client.rb +146 -0
- data/lib/outhad/integrations/source/watsonx_data/config/meta.json +17 -0
- data/lib/outhad/integrations/source/watsonx_data/config/spec.json +72 -0
- data/lib/outhad/integrations/source/watsonx_data/icon.svg +1 -0
- data/lib/outhad/integrations.rb +129 -0
- data/outhad-integrations.gemspec +79 -0
- data/sig/outhad/integrations.rbs +6 -0
- metadata +866 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Outhad::Integrations::Source
|
4
|
+
module PineconeDB
|
5
|
+
include Outhad::Integrations::Core
|
6
|
+
class Client < VectorSourceConnector
|
7
|
+
def check_connection(connection_config)
|
8
|
+
connection_config = connection_config.with_indifferent_access
|
9
|
+
pinecone = create_connection(connection_config)
|
10
|
+
result = pinecone.describe_index(@index_name)
|
11
|
+
if success?(result)
|
12
|
+
success_status
|
13
|
+
else
|
14
|
+
failure_status(nil)
|
15
|
+
end
|
16
|
+
rescue StandardError => e
|
17
|
+
handle_exception(e, { context: "PINECONE:CHECK_CONNECTION:EXCEPTION", type: "error" })
|
18
|
+
failure_status(e)
|
19
|
+
end
|
20
|
+
|
21
|
+
def discover(_connection_config = nil)
|
22
|
+
catalog_json = read_json(CATALOG_SPEC_PATH)
|
23
|
+
catalog = build_catalog(catalog_json)
|
24
|
+
catalog.to_outhad_message
|
25
|
+
rescue StandardError => e
|
26
|
+
handle_exception(e, {
|
27
|
+
context: "PINECONE:DISCOVER:EXCEPTION",
|
28
|
+
type: "error"
|
29
|
+
})
|
30
|
+
end
|
31
|
+
|
32
|
+
def search(vector_search_config)
|
33
|
+
connection_config = vector_search_config.source.connection_specification
|
34
|
+
connection_config = connection_config.with_indifferent_access
|
35
|
+
connection = create_connection(connection_config)
|
36
|
+
pinecone_index = connection.index(@index_name)
|
37
|
+
response = pinecone_index.query(vector: vector_search_config[:vector],
|
38
|
+
namespace: @namespace,
|
39
|
+
top_k: vector_search_config[:limit],
|
40
|
+
include_values: true,
|
41
|
+
include_metadata: true)
|
42
|
+
result = JSON.parse(response.body).with_indifferent_access
|
43
|
+
records = result["matches"]
|
44
|
+
records.map do |row|
|
45
|
+
RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_outhad_message
|
46
|
+
end
|
47
|
+
rescue StandardError => e
|
48
|
+
handle_exception(e, {
|
49
|
+
context: "PINECONE:SEARCH:EXCEPTION",
|
50
|
+
type: "error"
|
51
|
+
})
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def create_connection(connection_config)
|
57
|
+
initialize_client(connection_config)
|
58
|
+
Pinecone.configure do |config|
|
59
|
+
config.api_key = @api_key
|
60
|
+
config.environment = @region
|
61
|
+
end
|
62
|
+
Pinecone::Client.new
|
63
|
+
end
|
64
|
+
|
65
|
+
def initialize_client(connection_config)
|
66
|
+
@api_key = connection_config["api_key"]
|
67
|
+
@region = connection_config["region"]
|
68
|
+
@index_name = connection_config["index_name"]
|
69
|
+
@namespace = connection_config["namespace"]
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "PineconeDB",
|
4
|
+
"title": "Pinecone DB",
|
5
|
+
"connector_type": "source",
|
6
|
+
"category": "Database",
|
7
|
+
"sub_category": "Vector Database",
|
8
|
+
"documentation_url": "https://docs.squared.ai/activation/vector_search/pinecone_db",
|
9
|
+
"github_issue_label": "source-pinecone-db",
|
10
|
+
"icon": "icon.svg",
|
11
|
+
"license": "MIT",
|
12
|
+
"release_stage": "alpha",
|
13
|
+
"support_level": "community",
|
14
|
+
"tags": ["language:ruby", "outhad"]
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"documentation_url": "https://docs.squared.ai/activation/vector_search/pinecone_db",
|
3
|
+
"stream_type": "user_defined",
|
4
|
+
"connector_query_type": "vector_search",
|
5
|
+
"connection_specification": {
|
6
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
7
|
+
"title": "Pinecone DB",
|
8
|
+
"type": "object",
|
9
|
+
"required": ["api_key", "region", "index_name", "namespace"],
|
10
|
+
"properties": {
|
11
|
+
"api_key": {
|
12
|
+
"type": "string",
|
13
|
+
"outhad_secret": true,
|
14
|
+
"title": "API Key",
|
15
|
+
"order": 0
|
16
|
+
},
|
17
|
+
"region": {
|
18
|
+
"type": "string",
|
19
|
+
"title": "Region",
|
20
|
+
"order": 1
|
21
|
+
},
|
22
|
+
"index_name": {
|
23
|
+
"type": "string",
|
24
|
+
"title": "Index Name",
|
25
|
+
"order": 2
|
26
|
+
},
|
27
|
+
"namespace": {
|
28
|
+
"type": "string",
|
29
|
+
"title": "Namespace",
|
30
|
+
"order": 3
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
2
|
+
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg"><title>Dynamics 365 icon</title><path d="M4.59 7.41l4.94 3.54L4.59 24zm0-7.41v6.36l9.53 5.29 4.59-3.52zm0 24l14.82-8.47v-6.7Z"/></svg>
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pg"
|
4
|
+
|
5
|
+
module Outhad::Integrations::Source
|
6
|
+
module Postgresql
|
7
|
+
include Outhad::Integrations::Core
|
8
|
+
class Client < SourceConnector
|
9
|
+
def check_connection(connection_config)
|
10
|
+
connection_config = connection_config.with_indifferent_access
|
11
|
+
create_connection(connection_config)
|
12
|
+
ConnectionStatus.new(
|
13
|
+
status: ConnectionStatusType["succeeded"]
|
14
|
+
).to_outhad_message
|
15
|
+
rescue PG::Error => e
|
16
|
+
ConnectionStatus.new(
|
17
|
+
status: ConnectionStatusType["failed"], message: e.message
|
18
|
+
).to_outhad_message
|
19
|
+
end
|
20
|
+
|
21
|
+
def discover(connection_config)
|
22
|
+
connection_config = connection_config.with_indifferent_access
|
23
|
+
query = "SELECT table_name, column_name,
|
24
|
+
CASE WHEN data_type = 'USER-DEFINED' THEN udt_name ELSE data_type END
|
25
|
+
AS data_type,
|
26
|
+
is_nullable
|
27
|
+
FROM information_schema.columns
|
28
|
+
WHERE table_schema = '#{connection_config[:schema]}' AND table_catalog = '#{connection_config[:database]}'
|
29
|
+
ORDER BY table_name, ordinal_position;"
|
30
|
+
|
31
|
+
db = create_connection(connection_config)
|
32
|
+
records = db.exec(query) do |result|
|
33
|
+
result.map do |row|
|
34
|
+
row
|
35
|
+
end
|
36
|
+
end
|
37
|
+
catalog = Catalog.new(streams: create_streams(records))
|
38
|
+
catalog.to_outhad_message
|
39
|
+
rescue StandardError => e
|
40
|
+
handle_exception(e, {
|
41
|
+
context: "POSTGRESQL:DISCOVER:EXCEPTION",
|
42
|
+
type: "error"
|
43
|
+
})
|
44
|
+
ensure
|
45
|
+
db&.close
|
46
|
+
end
|
47
|
+
|
48
|
+
def read(sync_config)
|
49
|
+
connection_config = sync_config.source.connection_specification
|
50
|
+
connection_config = connection_config.with_indifferent_access
|
51
|
+
query = sync_config.model.query
|
52
|
+
query = batched_query(query, sync_config.limit, sync_config.offset) unless sync_config.limit.nil? && sync_config.offset.nil?
|
53
|
+
|
54
|
+
db = create_connection(connection_config)
|
55
|
+
|
56
|
+
query(db, query)
|
57
|
+
rescue StandardError => e
|
58
|
+
handle_exception(e, {
|
59
|
+
context: "POSTGRESQL:READ:EXCEPTION",
|
60
|
+
type: "error",
|
61
|
+
sync_id: sync_config.sync_id,
|
62
|
+
sync_run_id: sync_config.sync_run_id
|
63
|
+
})
|
64
|
+
ensure
|
65
|
+
db&.close
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def query(connection, query)
|
71
|
+
connection.exec(query) do |result|
|
72
|
+
result.map do |row|
|
73
|
+
RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_outhad_message
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def create_connection(connection_config)
|
79
|
+
raise "Unsupported Auth type" unless connection_config[:credentials][:auth_type] == "username/password"
|
80
|
+
|
81
|
+
PG.connect(
|
82
|
+
host: connection_config[:host],
|
83
|
+
dbname: connection_config[:database],
|
84
|
+
user: connection_config[:credentials][:username],
|
85
|
+
password: connection_config[:credentials][:password],
|
86
|
+
port: connection_config[:port]
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
def create_streams(records)
|
91
|
+
group_by_table(records).map do |r|
|
92
|
+
Outhad::Integrations::Protocol::Stream.new(name: r[:tablename], action: StreamAction["fetch"], json_schema: convert_to_json_schema(r[:columns]))
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def group_by_table(records)
|
97
|
+
records.group_by { |entry| entry["table_name"] }.map do |table_name, columns|
|
98
|
+
{
|
99
|
+
tablename: table_name,
|
100
|
+
columns: columns.map do |column|
|
101
|
+
{
|
102
|
+
column_name: column["column_name"],
|
103
|
+
type: column["data_type"],
|
104
|
+
optional: column["is_nullable"] == "YES"
|
105
|
+
}
|
106
|
+
end
|
107
|
+
}
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "Postgresql",
|
4
|
+
"title": "PostgreSQL",
|
5
|
+
"connector_type": "source",
|
6
|
+
"category": "Data Warehouse",
|
7
|
+
"sub_category": "Relational Database",
|
8
|
+
"documentation_url": "https://docs.squared.ai/guides/sources/data-sources/postgresql",
|
9
|
+
"github_issue_label": "source-postgresql",
|
10
|
+
"icon": "icon.svg",
|
11
|
+
"license": "MIT",
|
12
|
+
"release_stage": "alpha",
|
13
|
+
"support_level": "community",
|
14
|
+
"tags": ["language:ruby", "outhad"]
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
{
|
2
|
+
"documentation_url": "https://docs.squared.ai/guides/sources/data-sources/postgresql",
|
3
|
+
"stream_type": "dynamic",
|
4
|
+
"connector_query_type": "raw_sql",
|
5
|
+
"connection_specification": {
|
6
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
7
|
+
"title": "Postgresql",
|
8
|
+
"type": "object",
|
9
|
+
"required": ["data_type", "host", "port", "database", "schema"],
|
10
|
+
"properties": {
|
11
|
+
"data_type": {
|
12
|
+
"description": "Type of data in the database",
|
13
|
+
"type": "string",
|
14
|
+
"title": "Data Format Type",
|
15
|
+
"oneOf": [
|
16
|
+
{
|
17
|
+
"const": "structured",
|
18
|
+
"title": "Tables & Records (Structured)"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"const": "vector",
|
22
|
+
"title": "Tables & Records containing Vector fields"
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"default": "structured",
|
26
|
+
"order": 0
|
27
|
+
},
|
28
|
+
"credentials": {
|
29
|
+
"title": "",
|
30
|
+
"type": "object",
|
31
|
+
"required": ["auth_type", "username", "password"],
|
32
|
+
"properties": {
|
33
|
+
"auth_type": {
|
34
|
+
"type": "string",
|
35
|
+
"default": "username/password",
|
36
|
+
"order": 0,
|
37
|
+
"readOnly": true
|
38
|
+
},
|
39
|
+
"username": {
|
40
|
+
"description": "Username refers to your individual PostgreSQL login credentials. At a minimum, the user associated with these credentials must be granted read access to the data intended for synchronization.",
|
41
|
+
"examples": ["POSTGRESQL_USER"],
|
42
|
+
"type": "string",
|
43
|
+
"title": "Username",
|
44
|
+
"order": 1
|
45
|
+
},
|
46
|
+
"password": {
|
47
|
+
"description": "This field requires the password associated with the user account specified in the preceding section.",
|
48
|
+
"type": "string",
|
49
|
+
"outhad_secret": true,
|
50
|
+
"title": "Password",
|
51
|
+
"order": 2
|
52
|
+
}
|
53
|
+
},
|
54
|
+
"order": 1
|
55
|
+
},
|
56
|
+
"host": {
|
57
|
+
"description": "The hostname or IP address of your PostgreSQL server.",
|
58
|
+
"examples": ["127.0.0.1"],
|
59
|
+
"type": "string",
|
60
|
+
"title": "Host",
|
61
|
+
"order": 2
|
62
|
+
},
|
63
|
+
"port": {
|
64
|
+
"description": "The port number for your PostgreSQL server, which defaults to 5432, may vary based on your configuration. ",
|
65
|
+
"examples": ["5432"],
|
66
|
+
"type": "string",
|
67
|
+
"title": "Port",
|
68
|
+
"order": 3
|
69
|
+
},
|
70
|
+
"database": {
|
71
|
+
"description": "The specific PostgreSQL database to connect to.",
|
72
|
+
"examples": ["POSTGRESQL_DB"],
|
73
|
+
"type": "string",
|
74
|
+
"title": "Database",
|
75
|
+
"order": 4
|
76
|
+
},
|
77
|
+
"schema": {
|
78
|
+
"description": "The schema within the PostgreSQL database.",
|
79
|
+
"examples": ["POSTGRESQL_SCHEMA"],
|
80
|
+
"type": "string",
|
81
|
+
"title": "Schema",
|
82
|
+
"order": 5
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="432.071pt" height="445.383pt" viewBox="0 0 432.071 445.383" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
4
|
+
<g id="orginal" style="fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;">
|
5
|
+
</g>
|
6
|
+
<g id="Layer_x0020_3" style="fill-rule:nonzero;clip-rule:nonzero;fill:none;stroke:#FFFFFF;stroke-width:12.4651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;">
|
7
|
+
<path style="fill:#000000;stroke:#000000;stroke-width:37.3953;stroke-linecap:butt;stroke-linejoin:miter;" d="M323.205,324.227c2.833-23.601,1.984-27.062,19.563-23.239l4.463,0.392c13.517,0.615,31.199-2.174,41.587-7c22.362-10.376,35.622-27.7,13.572-23.148c-50.297,10.376-53.755-6.655-53.755-6.655c53.111-78.803,75.313-178.836,56.149-203.322 C352.514-5.534,262.036,26.049,260.522,26.869l-0.482,0.089c-9.938-2.062-21.06-3.294-33.554-3.496c-22.761-0.374-40.032,5.967-53.133,15.904c0,0-161.408-66.498-153.899,83.628c1.597,31.936,45.777,241.655,98.47,178.31 c19.259-23.163,37.871-42.748,37.871-42.748c9.242,6.14,20.307,9.272,31.912,8.147l0.897-0.765c-0.281,2.876-0.157,5.689,0.359,9.019c-13.572,15.167-9.584,17.83-36.723,23.416c-27.457,5.659-11.326,15.734-0.797,18.367c12.768,3.193,42.305,7.716,62.268-20.224 l-0.795,3.188c5.325,4.26,4.965,30.619,5.72,49.452c0.756,18.834,2.017,36.409,5.856,46.771c3.839,10.36,8.369,37.05,44.036,29.406c29.809-6.388,52.6-15.582,54.677-101.107"/>
|
8
|
+
<path style="fill:#336791;stroke:none;" d="M402.395,271.23c-50.302,10.376-53.76-6.655-53.76-6.655c53.111-78.808,75.313-178.843,56.153-203.326c-52.27-66.785-142.752-35.2-144.262-34.38l-0.486,0.087c-9.938-2.063-21.06-3.292-33.56-3.496c-22.761-0.373-40.026,5.967-53.127,15.902 c0,0-161.411-66.495-153.904,83.63c1.597,31.938,45.776,241.657,98.471,178.312c19.26-23.163,37.869-42.748,37.869-42.748c9.243,6.14,20.308,9.272,31.908,8.147l0.901-0.765c-0.28,2.876-0.152,5.689,0.361,9.019c-13.575,15.167-9.586,17.83-36.723,23.416 c-27.459,5.659-11.328,15.734-0.796,18.367c12.768,3.193,42.307,7.716,62.266-20.224l-0.796,3.188c5.319,4.26,9.054,27.711,8.428,48.969c-0.626,21.259-1.044,35.854,3.147,47.254c4.191,11.4,8.368,37.05,44.042,29.406c29.809-6.388,45.256-22.942,47.405-50.555 c1.525-19.631,4.976-16.729,5.194-34.28l2.768-8.309c3.192-26.611,0.507-35.196,18.872-31.203l4.463,0.392c13.517,0.615,31.208-2.174,41.591-7c22.358-10.376,35.618-27.7,13.573-23.148z"/>
|
9
|
+
<path d="M215.866,286.484c-1.385,49.516,0.348,99.377,5.193,111.495c4.848,12.118,15.223,35.688,50.9,28.045c29.806-6.39,40.651-18.756,45.357-46.051c3.466-20.082,10.148-75.854,11.005-87.281"/>
|
10
|
+
<path d="M173.104,38.256c0,0-161.521-66.016-154.012,84.109c1.597,31.938,45.779,241.664,98.473,178.316c19.256-23.166,36.671-41.335,36.671-41.335"/>
|
11
|
+
<path d="M260.349,26.207c-5.591,1.753,89.848-34.889,144.087,34.417c19.159,24.484-3.043,124.519-56.153,203.329"/>
|
12
|
+
<path style="stroke-linejoin:bevel;" d="M348.282,263.953c0,0,3.461,17.036,53.764,6.653c22.04-4.552,8.776,12.774-13.577,23.155c-18.345,8.514-59.474,10.696-60.146-1.069c-1.729-30.355,21.647-21.133,19.96-28.739c-1.525-6.85-11.979-13.573-18.894-30.338 c-6.037-14.633-82.796-126.849,21.287-110.183c3.813-0.789-27.146-99.002-124.553-100.599c-97.385-1.597-94.19,119.762-94.19,119.762"/>
|
13
|
+
<path d="M188.604,274.334c-13.577,15.166-9.584,17.829-36.723,23.417c-27.459,5.66-11.326,15.733-0.797,18.365c12.768,3.195,42.307,7.718,62.266-20.229c6.078-8.509-0.036-22.086-8.385-25.547c-4.034-1.671-9.428-3.765-16.361,3.994z"/>
|
14
|
+
<path d="M187.715,274.069c-1.368-8.917,2.93-19.528,7.536-31.942c6.922-18.626,22.893-37.255,10.117-96.339c-9.523-44.029-73.396-9.163-73.436-3.193c-0.039,5.968,2.889,30.26-1.067,58.548c-5.162,36.913,23.488,68.132,56.479,64.938"/>
|
15
|
+
<path style="fill:#FFFFFF;stroke-width:4.155;stroke-linecap:butt;stroke-linejoin:miter;" d="M172.517,141.7c-0.288,2.039,3.733,7.48,8.976,8.207c5.234,0.73,9.714-3.522,9.998-5.559c0.284-2.039-3.732-4.285-8.977-5.015c-5.237-0.731-9.719,0.333-9.996,2.367z"/>
|
16
|
+
<path style="fill:#FFFFFF;stroke-width:2.0775;stroke-linecap:butt;stroke-linejoin:miter;" d="M331.941,137.543c0.284,2.039-3.732,7.48-8.976,8.207c-5.238,0.73-9.718-3.522-10.005-5.559c-0.277-2.039,3.74-4.285,8.979-5.015c5.239-0.73,9.718,0.333,10.002,2.368z"/>
|
17
|
+
<path d="M350.676,123.432c0.863,15.994-3.445,26.888-3.988,43.914c-0.804,24.748,11.799,53.074-7.191,81.435"/>
|
18
|
+
<path style="stroke-width:3;" d="M0,60.232"/>
|
19
|
+
</g>
|
20
|
+
</svg>
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Outhad::Integrations::Source
|
4
|
+
module Qdrant
|
5
|
+
include Outhad::Integrations::Core
|
6
|
+
class Client < VectorSourceConnector
|
7
|
+
def check_connection(connection_config)
|
8
|
+
connection_config = connection_config.with_indifferent_access
|
9
|
+
create_connection(connection_config)
|
10
|
+
response = Outhad::Integrations::Core::HttpClient.request(
|
11
|
+
@host,
|
12
|
+
HTTP_GET,
|
13
|
+
headers: auth_headers(@api_key)
|
14
|
+
)
|
15
|
+
if success?(response)
|
16
|
+
success_status
|
17
|
+
else
|
18
|
+
failure_status(nil)
|
19
|
+
end
|
20
|
+
rescue StandardError => e
|
21
|
+
handle_exception(e, {
|
22
|
+
context: "QDRANT:CHECK_CONNECTION:EXCEPTION",
|
23
|
+
type: "error"
|
24
|
+
})
|
25
|
+
failure_status(e)
|
26
|
+
end
|
27
|
+
|
28
|
+
def discover(_connection_config = nil)
|
29
|
+
catalog_json = read_json(CATALOG_SPEC_PATH)
|
30
|
+
catalog = build_catalog(catalog_json)
|
31
|
+
catalog.to_outhad_message
|
32
|
+
rescue StandardError => e
|
33
|
+
handle_exception(e, {
|
34
|
+
context: "QDRANT:DISCOVER:EXCEPTION",
|
35
|
+
type: "error"
|
36
|
+
})
|
37
|
+
end
|
38
|
+
|
39
|
+
def search(vector_search_config)
|
40
|
+
connection_config = vector_search_config.source.connection_specification
|
41
|
+
connection_config = connection_config.with_indifferent_access
|
42
|
+
create_connection(connection_config)
|
43
|
+
url = build_url(QDRANT_SEARCH_URL)
|
44
|
+
|
45
|
+
body = {
|
46
|
+
vector: vector_search_config[:vector],
|
47
|
+
top: vector_search_config[:limit]
|
48
|
+
}
|
49
|
+
|
50
|
+
response = Outhad::Integrations::Core::HttpClient.request(
|
51
|
+
url,
|
52
|
+
HTTP_POST,
|
53
|
+
headers: {
|
54
|
+
"Content-Type" => "application/json",
|
55
|
+
"api-key" => @api_key
|
56
|
+
},
|
57
|
+
payload: body
|
58
|
+
)
|
59
|
+
|
60
|
+
response = JSON.parse(response.body).with_indifferent_access
|
61
|
+
records = response[:result] || []
|
62
|
+
|
63
|
+
records.map do |row|
|
64
|
+
RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_outhad_message
|
65
|
+
end
|
66
|
+
rescue StandardError => e
|
67
|
+
handle_exception(e, {
|
68
|
+
context: "QDRANT:SEARCH:EXCEPTION",
|
69
|
+
type: "error"
|
70
|
+
})
|
71
|
+
end
|
72
|
+
|
73
|
+
private
|
74
|
+
|
75
|
+
def create_connection(connection_config)
|
76
|
+
@api_key = connection_config[:api_key]
|
77
|
+
@host = connection_config[:host]
|
78
|
+
@collection_name = connection_config[:collection_name]
|
79
|
+
end
|
80
|
+
|
81
|
+
def build_url(url)
|
82
|
+
format(url, host: @host, collection_name: @collection_name)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "Qdrant",
|
4
|
+
"title": "Qdrant",
|
5
|
+
"connector_type": "source",
|
6
|
+
"category": "Database",
|
7
|
+
"sub_category": "Vector Database",
|
8
|
+
"documentation_url": "https://docs.squared.ai/activation/vector_search/qdrant",
|
9
|
+
"github_issue_label": "source-qdrant",
|
10
|
+
"icon": "icon.svg",
|
11
|
+
"license": "MIT",
|
12
|
+
"release_stage": "alpha",
|
13
|
+
"support_level": "community",
|
14
|
+
"tags": ["language:ruby", "outhad"]
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
{
|
2
|
+
"documentation_url": "https://docs.squared.ai/activation/vector_search/qdrant",
|
3
|
+
"stream_type": "user_defined",
|
4
|
+
"connector_query_type": "vector_search",
|
5
|
+
"connection_specification": {
|
6
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
7
|
+
"title": "Qdrant",
|
8
|
+
"type": "object",
|
9
|
+
"required": ["host", "api_key", "collection_name"],
|
10
|
+
"properties": {
|
11
|
+
"host": {
|
12
|
+
"type": "string",
|
13
|
+
"title": "Host",
|
14
|
+
"order": 0
|
15
|
+
},
|
16
|
+
"api_key": {
|
17
|
+
"type": "string",
|
18
|
+
"outhad_secret": true,
|
19
|
+
"title": "API Key",
|
20
|
+
"order": 1
|
21
|
+
},
|
22
|
+
"collection_name": {
|
23
|
+
"type": "string",
|
24
|
+
"title": "Collection Name",
|
25
|
+
"order": 2
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 451.84 152.4" width="451.84" height="152.4" fill="none"><g fill="#dc244c"><path d="M212.69 116c0 5.523-4.477 10.001-10 10.001h-6.836v-7.808h-.244c-.732 1.057-1.708 2.155-2.928 3.293-1.139 1.058-2.521 2.034-4.148 2.929-1.545.894-3.294 1.626-5.246 2.196a20.015 20.015 0 0 1-5.856.853c-4.392 0-8.377-.732-11.956-2.196-3.579-1.545-6.669-3.66-9.272-6.344-2.521-2.765-4.473-6.018-5.856-9.759-1.383-3.742-2.074-7.849-2.074-12.322 0-4.148.61-8.093 1.83-11.835 1.301-3.822 3.091-7.198 5.368-10.126a26.176 26.176 0 0 1 8.54-6.954c3.335-1.789 7.117-2.683 11.346-2.683 3.823 0 7.361.61 10.614 1.83 3.335 1.138 6.059 3.13 8.174 5.978h.244V43.769c0-5.523 4.477-10 10-10h8.3zm-16.836-19.646c0-4.473-1.301-8.092-3.904-10.858-2.521-2.765-6.1-4.148-10.736-4.148s-8.255 1.383-10.858 4.148c-2.521 2.766-3.782 6.385-3.782 10.858 0 4.474 1.261 8.093 3.782 10.858 2.603 2.766 6.222 4.149 10.858 4.149s8.215-1.383 10.736-4.149c2.603-2.765 3.904-6.384 3.904-10.858zM224.53 76.708c0-5.522 4.477-10 10-10h8.3v9.516h.244c1.952-3.66 4.27-6.384 6.954-8.174 2.684-1.87 6.059-2.805 10.126-2.805 1.057 0 2.114.04 3.172.121 1.057.082 2.033.245 2.928.489v16.713a22.4 22.4 0 0 0-3.904-.854 19.895 19.895 0 0 0-3.904-.367c-3.498 0-6.263.489-8.296 1.465-2.034.975-3.62 2.358-4.758 4.147-1.058 1.708-1.749 3.782-2.074 6.222-.326 2.441-.488 5.124-.488 8.052V116c0 5.524-4.477 10.002-10 10.002h-8.3zM310.64 118.56h-.244c-2.033 3.172-4.758 5.449-8.174 6.832-3.334 1.382-6.872 2.073-10.614 2.073-2.765 0-5.449-.406-8.052-1.219-2.521-.732-4.758-1.871-6.71-3.416-1.952-1.546-3.497-3.457-4.636-5.735-1.138-2.277-1.708-4.92-1.708-7.929 0-3.416.61-6.304 1.83-8.662 1.302-2.359 3.01-4.311 5.124-5.856 2.196-1.546 4.677-2.725 7.442-3.538a50.076 50.076 0 0 1 8.54-1.953c3.01-.406 5.978-.65 8.906-.732 3.01-.081 5.775-.121 8.296-.121 0-3.254-1.179-5.816-3.538-7.687-2.277-1.952-5.002-2.928-8.174-2.928-3.009 0-5.774.651-8.296 1.952-2.44 1.221-4.636 2.929-6.588 5.124l-9.76-10.004c3.416-3.171 7.402-5.53 11.956-7.075a41.766 41.766 0 0 1 14.152-2.44c5.368 0 9.76.69 13.176 2.073 3.498 1.302 6.263 3.254 8.296 5.856 2.115 2.603 3.579 5.816 4.392 9.638.814 3.742 1.22 8.093 1.22 13.054v20.135c0 5.522-4.477 10-10 10h-6.836zm-4.514-18.545c-1.382 0-3.131.082-5.246.244a24.865 24.865 0 0 0-5.978.976c-1.87.57-3.497 1.424-4.88 2.562-1.301 1.139-1.952 2.725-1.952 4.759 0 2.196.936 3.822 2.806 4.879 1.871 1.058 3.823 1.586 5.856 1.586 1.79 0 3.498-.244 5.124-.732 1.708-.488 3.213-1.179 4.514-2.074a9.45 9.45 0 0 0 3.05-3.416c.814-1.382 1.22-3.009 1.22-4.879v-3.905zM340.18 76.708c0-5.522 4.477-10 10-10h7.568v8.052h.244c.569-1.138 1.382-2.277 2.44-3.416 1.057-1.138 2.318-2.155 3.782-3.05s3.131-1.626 5.002-2.195c1.87-.57 3.904-.854 6.1-.854 4.636 0 8.377.732 11.224 2.196 2.846 1.382 5.042 3.334 6.588 5.855 1.626 2.522 2.724 5.49 3.294 8.906.569 3.416.854 7.117.854 11.103V116c0 5.523-4.477 10.001-10 10.001h-8.3V96.964a58.2 58.2 0 0 0-.244-5.246c-.082-1.87-.448-3.578-1.098-5.123a8.154 8.154 0 0 0-2.806-3.783c-1.22-.976-3.01-1.464-5.368-1.464-2.359 0-4.27.448-5.734 1.342a8.629 8.629 0 0 0-3.416 3.416c-.732 1.383-1.22 2.969-1.464 4.758a41.535 41.535 0 0 0-.366 5.612V116c0 5.523-4.477 10.001-10 10.001h-8.3zM451.84 71.348c0 5.522-4.477 10-10 10h-6.104v19.764c0 1.627.082 3.132.244 4.514.163 1.301.529 2.44 1.098 3.415.57.977 1.424 1.75 2.562 2.32 1.22.487 2.806.73 4.758.73.976 0 2.237-.08 3.782-.243 1.627-.245 2.847-.732 3.66-1.464v8.725c0 3.915-2.452 7.557-6.344 7.989a58.528 58.528 0 0 1-6.466.366c-3.09 0-5.937-.325-8.54-.976-2.602-.65-4.88-1.667-6.832-3.05-1.952-1.463-3.497-3.334-4.636-5.612-1.057-2.277-1.586-5.042-1.586-8.295V81.347h-11.712v-4.64c0-5.522 4.478-9.999 10-9.999h1.712V59.14c0-5.523 4.478-10 10-10h8.3v17.568h16.104z"/></g><g fill-rule="evenodd" clip-rule="evenodd"><path fill="#24386c" d="m103.79 140.09-3.039-83.784-5.503-22.089 36.734 3.889v101.35l-22.44 12.95z"/><path fill="#7589be" d="m131.98 38.1-22.44 12.96-46.308-10.158L9.029 62.971-.001 38.1l32.99-19.05 33-19.05 32.99 19.05z"/><path fill="#b2bfe8" d="m0 38.1 22.44 12.96 13.008 38.686 43.921 35.142L65.991 152.4l-33-19.051L0 114.299v-76.2"/><path fill="#24386c" d="m80.868 104.56-14.877 21.932v25.91l21.11-12.18 10.877-16.242"/><path fill="#7589be" d="M66 100.59 44.881 64.025l4.549-12.119 17.293-8.384L87.1 64.026z"/><path fill="#b2bfe8" d="m44.881 64.022 21.11 12.18v24.38l-19.524.84-11.81-15.08 10.224-22.32"/><path fill="#24386c" d="m65.991 76.2 21.11-12.179 14.367 23.922-17.386 14.365-18.091-1.727z"/><path fill="#dc244c" d="m87.101 140.22 22.44 12.181V51.061l-21.78-12.57-21.77-12.57-21.78 12.57-21.77 12.57v50.289l21.77 12.57 21.78 12.571 21.11-12.191zm0-51.83-21.11 12.19-21.11-12.19V64.02l21.11-12.19 21.11 12.19v24.37"/></g><path fill="url(#a)" d="M66 126.5v-25.914L45 88.5v25.871z"/><defs><linearGradient id="a" x1="62.128" x2="41.202" y1="105.54" y2="105.54" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#FF3364"/><stop offset="1" stop-color="#C91540" stop-opacity="0"/></linearGradient></defs></svg>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "pg"
|
4
|
+
|
5
|
+
module Outhad::Integrations::Source
|
6
|
+
module Redshift
|
7
|
+
include Outhad::Integrations::Core
|
8
|
+
class Client < SourceConnector
|
9
|
+
def check_connection(connection_config)
|
10
|
+
connection_config = connection_config.with_indifferent_access
|
11
|
+
create_connection(connection_config)
|
12
|
+
ConnectionStatus.new(
|
13
|
+
status: ConnectionStatusType["succeeded"]
|
14
|
+
).to_outhad_message
|
15
|
+
rescue PG::Error => e
|
16
|
+
ConnectionStatus.new(
|
17
|
+
status: ConnectionStatusType["failed"], message: e.message
|
18
|
+
).to_outhad_message
|
19
|
+
end
|
20
|
+
|
21
|
+
def discover(connection_config)
|
22
|
+
connection_config = connection_config.with_indifferent_access
|
23
|
+
query = "SELECT table_name, column_name, data_type, is_nullable
|
24
|
+
FROM information_schema.columns
|
25
|
+
WHERE table_schema = '#{connection_config[:schema]}' AND table_catalog = '#{connection_config[:database]}'
|
26
|
+
ORDER BY table_name, ordinal_position;"
|
27
|
+
|
28
|
+
db = create_connection(connection_config)
|
29
|
+
records = db.exec(query) do |result|
|
30
|
+
result.map do |row|
|
31
|
+
row
|
32
|
+
end
|
33
|
+
end
|
34
|
+
catalog = Catalog.new(streams: create_streams(records))
|
35
|
+
catalog.to_outhad_message
|
36
|
+
rescue StandardError => e
|
37
|
+
handle_exception(e, {
|
38
|
+
context: "REDSHIFT:DISCOVER:EXCEPTION",
|
39
|
+
type: "error"
|
40
|
+
})
|
41
|
+
ensure
|
42
|
+
db&.close
|
43
|
+
end
|
44
|
+
|
45
|
+
def read(sync_config)
|
46
|
+
connection_config = sync_config.source.connection_specification
|
47
|
+
connection_config = connection_config.with_indifferent_access
|
48
|
+
query = sync_config.model.query
|
49
|
+
query = batched_query(query, sync_config.limit, sync_config.offset) unless sync_config.limit.nil? && sync_config.offset.nil?
|
50
|
+
|
51
|
+
db = create_connection(connection_config)
|
52
|
+
|
53
|
+
query(db, query)
|
54
|
+
rescue StandardError => e
|
55
|
+
handle_exception(e, {
|
56
|
+
context: "REDSHIFT:READ:EXCEPTION",
|
57
|
+
type: "error",
|
58
|
+
sync_id: sync_config.sync_id,
|
59
|
+
sync_run_id: sync_config.sync_run_id
|
60
|
+
})
|
61
|
+
ensure
|
62
|
+
db&.close
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def query(connection, query)
|
68
|
+
connection.exec(query) do |result|
|
69
|
+
result.map do |row|
|
70
|
+
RecordMessage.new(data: row, emitted_at: Time.now.to_i).to_outhad_message
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def create_connection(connection_config)
|
76
|
+
raise "Unsupported Auth type" unless connection_config[:credentials][:auth_type] == "username/password"
|
77
|
+
|
78
|
+
PG.connect(
|
79
|
+
host: connection_config[:host],
|
80
|
+
dbname: connection_config[:database],
|
81
|
+
user: connection_config[:credentials][:username],
|
82
|
+
password: connection_config[:credentials][:password],
|
83
|
+
port: connection_config[:port]
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
def create_streams(records)
|
88
|
+
group_by_table(records).map do |r|
|
89
|
+
Outhad::Integrations::Protocol::Stream.new(name: r[:tablename], action: StreamAction["fetch"], json_schema: convert_to_json_schema(r[:columns]))
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def group_by_table(records)
|
94
|
+
records.group_by { |entry| entry["table_name"] }.map do |table_name, columns|
|
95
|
+
{
|
96
|
+
tablename: table_name,
|
97
|
+
columns: columns.map do |column|
|
98
|
+
{
|
99
|
+
column_name: column["column_name"],
|
100
|
+
type: column["data_type"],
|
101
|
+
optional: column["is_nullable"] == "YES"
|
102
|
+
}
|
103
|
+
end
|
104
|
+
}
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"data": {
|
3
|
+
"name": "Redshift",
|
4
|
+
"title": "Amazon Redshift",
|
5
|
+
"connector_type": "source",
|
6
|
+
"category": "Data Warehouse",
|
7
|
+
"sub_category": "Relational Database",
|
8
|
+
"documentation_url": "https://docs.squared.ai/guides/sources/data-sources/redshift",
|
9
|
+
"github_issue_label": "source-redshift",
|
10
|
+
"icon": "icon.svg",
|
11
|
+
"license": "MIT",
|
12
|
+
"release_stage": "alpha",
|
13
|
+
"support_level": "community",
|
14
|
+
"tags": ["language:ruby", "outhad"]
|
15
|
+
}
|
16
|
+
}
|