Business intelligence made simple
Added support for trino-client gem [skip ci]
Andrew Kanea5d21b7f9499
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4f0c4bdb..50193200 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,5 +1,6 @@## 3.2.0 (unreleased)+- Added support for `trino-client` gem- Added support for `neo4j-ruby-driver` gem- Fixes types for SQLite- Fixed table preview and schema page for SQLitediff --git a/Gemfile b/Gemfileindex 3c8d0187..9c4b7a2a 100644--- a/Gemfile+++ b/Gemfile@@ -31,6 +31,7 @@ gem "propshaft"# gem "restforce"# gem "tiny_tds"# gem "trilogy"+# gem "trino-client"# gem "activerecord-sqlserver-adapter"# anomaly detection and forecastingdiff --git a/README.md b/README.mdindex 3d2d4a90..6962a274 100644--- a/README.md+++ b/README.md@@ -585,7 +585,7 @@ data_sources:- [OpenSearch](#opensearch)- [Oracle](#oracle)- [PostgreSQL](#postgresql-1)-- [Presto](#presto)+- [Presto and Trino](#presto-and-trino)- [Salesforce](#salesforce)- [Snowflake](#snowflake)- [Socrata Open Data API (SODA)](#socrata-open-data-api-soda)@@ -855,17 +855,19 @@ data_sources:Use a [read-only user](#postgresql).-### Presto+### Presto and Trino-Add [presto-client](https://github.com/treasure-data/presto-client-ruby) to your Gemfile and set:+Add [presto-client](https://github.com/treasure-data/trino-client-ruby/tree/v0.6.5) or [trino-client](https://github.com/treasure-data/trino-client-ruby) to your Gemfile and set:```ymldata_sources:my_source:url: presto://user@hostname:8080/catalog+ # or+ url: trino://user@hostname:8080/catalog```-Use a [read-only user](https://prestodb.io/docs/current/security/built-in-system-access-control.html).+Use a read-only user for [Presto](https://prestodb.io/docs/current/security/built-in-system-access-control.html) or [Trino](https://trino.io/docs/current/security/built-in-system-access-control.html).### Salesforcediff --git a/lib/blazer/adapters.rb b/lib/blazer/adapters.rbindex eed81a49..338d4bcc 100644--- a/lib/blazer/adapters.rb+++ b/lib/blazer/adapters.rb@@ -15,3 +15,4 @@ Blazer.register_adapter "soda", Blazer::Adapters::SodaAdapterBlazer.register_adapter "spark", Blazer::Adapters::SparkAdapterBlazer.register_adapter "sql", Blazer::Adapters::SqlAdapterBlazer.register_adapter "snowflake", Blazer::Adapters::SnowflakeAdapter+Blazer.register_adapter "trino", Blazer::Adapters::PrestoAdapterdiff --git a/lib/blazer/adapters/presto_adapter.rb b/lib/blazer/adapters/presto_adapter.rbindex d94824f0..8d0a625d 100644--- a/lib/blazer/adapters/presto_adapter.rb+++ b/lib/blazer/adapters/presto_adapter.rb@@ -40,7 +40,8 @@ module Blazer@client ||= beginuri = URI.parse(settings["url"])query = uri.query ? CGI.parse(uri.query) : {}- Presto::Client.new(+ cls = uri.scheme == "trino" ? Trino::Client : Presto::Client+ cls.new(server: "#{uri.host}:#{uri.port}",catalog: uri.path.to_s.delete_prefix("/"),schema: query["schema"] || "public",diff --git a/lib/blazer/data_source.rb b/lib/blazer/data_source.rbindex 19b45f75..51b78c4a 100644--- a/lib/blazer/data_source.rb+++ b/lib/blazer/data_source.rb@@ -256,7 +256,7 @@ module Blazerdef detect_adapterscheme = settings["url"].to_s.split("://").firstcase scheme- when "presto", "cassandra", "ignite"+ when "presto", "trino", "cassandra", "ignite"schemeelse"sql"diff --git a/test/support/adapters.yml b/test/support/adapters.ymlindex d42b214d..7e258320 100644--- a/test/support/adapters.yml+++ b/test/support/adapters.yml@@ -50,7 +50,7 @@ data_sources:url: postgres://localhost/blazer_testpresto:- url: presto://user@localhost:8080/jmx+ url: trino://user@localhost:8080/jmxredshift:url: redshift://localhost:5439/blazer_test