strata-cli 0.1.12 → 0.1.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 060e97cfbb307efe69eff087983dc1d28e3e4008bd13f5529a7560e5d7e00f06
4
- data.tar.gz: 134dbf05ad0b5870433fcb3c9a90e50853ed0a9f97c3378a97d208b4f6866dae
3
+ metadata.gz: 7b0fdc6cf6a28080152c9b0237d54e206740477d196178a2e6d5aa5642720135
4
+ data.tar.gz: d049c71dd05982f8a52b786ae59ffdf590056dc3bdb5cadd7045227dbe9de867
5
5
  SHA512:
6
- metadata.gz: bf09f28b188e03929870b14515efb76d86f9aab034d048a3e2e5c49751f722718cf6a4d37a8c7d7e2966bd080aac758956df51951758a73b98a885003cbd5bb4
7
- data.tar.gz: ab72ddfa33b44cc8da63cb10c2920575030fa53a4216d8d75eb9e2a38f2eebdc3f36afd3264c6dc81c00b440c6df4eb029df86126e600d16455def0cf311efb5
6
+ metadata.gz: f7c7aa4945d149bff16578ca52f99a005b3c9d4c3b5897b52929bf9bfffb140883457f60d52552fa551faee5ef6d0472069c368125653bf784078378a7065dbe
7
+ data.tar.gz: 48a81467d16e8b489bdce4f177dd1b158ac09344c07d1944d804a679afc0ed47e52047b6a478781ba245c291a4d9bb8512f8159b1d09ecf41e1f537b5873e52b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.14] - 2026-07-17
4
+
5
+ ### Added
6
+
7
+ - **Tutorial command**: `strata tutorial` walks new users through a guided setup — initializes a project, configures a datasource, and deploys to a local Strata server running on port 8080.
8
+
9
+ ### Changed
10
+
11
+ - **Tutorial deployment**: Completion message now includes `--skip-audit` flag in the deployment instructions.
12
+ - **Tutorial server config**: Default server port set to 8080 (was 3000).
13
+
14
+ ## [0.1.13] - 2026-06-20
15
+
16
+ ### Changed
17
+
18
+ - **Documentation**: ClickHouse adapter docs in README, gemspec description, `datasource add` help text, and CHANGELOG notes for the 0.1.12 feature set.
19
+
20
+ ## [0.1.12] - 2026-06-20
21
+
22
+ ### Added
23
+
24
+ - **ClickHouse adapter**: `strata datasource add clickhouse` with connection prompts and optional password credentials.
25
+ - **Security policy scaffolding**: `strata create policy` to add policies to `security.yml`; new projects include a `security.yml` template.
26
+
27
+ ### Changed
28
+
29
+ - **dwh dependency**: Require `dwh` `~> 0.5.0` (ClickHouse adapter and dialect keyword/aggregate support).
30
+
31
+ ### Fixed
32
+
33
+ - **Datasource introspection**: Pass only `catalog` and `schema` qualifiers to DWH for `tables` and `meta` (avoids leaking CLI flags like `--agent` or `--pattern` to adapters).
34
+
3
35
  ## [0.1.11] - 2026-05-22
4
36
 
5
37
  ### Changed
data/README.md CHANGED
@@ -375,6 +375,17 @@ my_databricks:
375
375
  catalog: main
376
376
  schema: default
377
377
  auth_mode: oauth_m2m
378
+
379
+ my_clickhouse:
380
+ adapter: clickhouse
381
+ name: ClickHouse
382
+ protocol: http
383
+ host: localhost
384
+ port: 8123
385
+ database: default
386
+ username: default
387
+ tier: warm
388
+ query_timeout: 3600
378
389
  ```
379
390
 
380
391
  ### Databricks authentication
@@ -403,6 +414,7 @@ Use service principal credentials and run `strata ds auth my_databricks` to save
403
414
  - **Druid** - Apache Druid support
404
415
  - **Redshift** - Amazon Redshift support
405
416
  - **Databricks** - Databricks SQL warehouse support
417
+ - **ClickHouse** - ClickHouse HTTP/native SQL support
406
418
  - **SQLite** - SQLite database support
407
419
 
408
420
  ## Security
@@ -72,6 +72,8 @@ module Strata
72
72
 
73
73
  def reload!
74
74
  @data.clear
75
+ @config_file_path = nil
76
+ @project_config_file_path = nil
75
77
  load_config
76
78
  end
77
79
 
@@ -48,6 +48,8 @@ module Strata
48
48
  credentials["auth_mode"] = "oauth_m2m"
49
49
  credentials["oauth_client_id"] = @prompt.ask("OAuth Client ID:")
50
50
  credentials["oauth_client_secret"] = @prompt.ask("OAuth Client Secret:")
51
+ when "clickhouse"
52
+ credentials["password"] = @prompt.mask("Enter Password (leave blank if none):")
51
53
  else
52
54
  if required?
53
55
  unless %w[postgres mysql trino sqlserver].include?(adapter)
@@ -18,4 +18,4 @@ Examples:
18
18
 
19
19
  strata datasource add snowflake # Directly add Snowflake datasource
20
20
 
21
- Supported adapters: postgres, mysql, sqlserver, snowflake, athena, trino, duckdb, druid
21
+ Supported adapters: postgres, mysql, sqlserver, snowflake, athena, trino, duckdb, druid, clickhouse, databricks, redshift, sqlite
@@ -0,0 +1,13 @@
1
+ Sets up the Strata tutorial project locally by cloning the tutorial repo,
2
+ wiring it to your Strata instance, and preparing it for `strata deploy`.
3
+
4
+ The --api-key value is shown on the tutorial setup page
5
+ in your Strata instance. Copy-paste them directly from there.
6
+
7
+ After running this command, `cd` into the project directory and run
8
+ `strata deploy` to deploy the tutorial to your Strata instance.
9
+
10
+ Example:
11
+ strata tutorial -a your_api_key
12
+ cd tutorial
13
+ strata deploy
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "group"
4
+ require_relative "../helpers/project_helper"
5
+ require_relative "../output"
6
+ require "yaml"
7
+ require "fileutils"
8
+
9
+ module Strata
10
+ module CLI
11
+ module Generators
12
+ class Tutorial < Group
13
+ TUTORIAL_REPO = "https://github.com/stratasite/strata-tutorial-project"
14
+ DEFAULT_SERVER = "http://localhost:8080"
15
+ TUTORIAL_PROJECT = "strata-tutorial-project"
16
+
17
+ class_option :api_key, aliases: ["a"], type: :string, desc: "Strata API key"
18
+
19
+ desc "Sets up the Strata tutorial project locally."
20
+
21
+ def validate_options
22
+ raise Strata::CommandError, "--api-key (-a) is required." unless options[:api_key]
23
+ @uid = TUTORIAL_PROJECT
24
+ @project_id = 1
25
+ end
26
+
27
+ def clone_tutorial_repo
28
+ if File.directory?(@uid)
29
+ Output.print_status(:skip, "Directory '#{@uid}' already exists — re-using it", type: :info, context: self)
30
+ return
31
+ end
32
+ Output.print_status(:clone, "Cloning tutorial from #{TUTORIAL_REPO}", type: :success, context: self)
33
+ run "git clone #{TUTORIAL_REPO} #{@uid}", verbose: false, capture: true
34
+ raise Strata::CommandError, "Failed to clone tutorial repo." unless File.directory?(@uid)
35
+ end
36
+
37
+ def reinitialize_git
38
+ inside @uid do
39
+ FileUtils.rm_rf(".git")
40
+ run "git init -b main", verbose: false, capture: true
41
+ create_file ".gitignore", ".strata\n.strata_cli/\n", force: true
42
+ end
43
+ end
44
+
45
+ def write_strata_config
46
+ strata_path = File.join(@uid, ".strata")
47
+ File.write(strata_path, "api_key: #{options[:api_key]}\nserver: #{DEFAULT_SERVER}\n")
48
+ File.chmod(0o600, strata_path)
49
+ end
50
+
51
+ def update_project_yml
52
+ project_yml = File.join(@uid, "project.yml")
53
+ return unless File.exist?(project_yml)
54
+
55
+ Helpers::ProjectHelper.persist_project_id_to_yml(@project_id, project_yml_path: project_yml)
56
+ end
57
+
58
+ def initial_commit
59
+ inside @uid do
60
+ run "git add -A", verbose: false, capture: true
61
+ run 'git commit -m "Initial tutorial project setup"', verbose: false, capture: true
62
+ end
63
+ end
64
+
65
+ def completion_message
66
+ Output.print_success("\n✔ Tutorial project '#{@uid}' is ready!\n", context: self)
67
+ Output.print_info(" Next: cd #{@uid} && strata deploy --skip-audit\n", context: self)
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -8,6 +8,7 @@ module Strata
8
8
  module Guard
9
9
  ALLOWED_COMMANDS = %w[
10
10
  init
11
+ tutorial
11
12
  help
12
13
  adapters
13
14
  version
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "generators/project"
4
+ require_relative "generators/tutorial"
4
5
  require_relative "sub_commands/datasource"
5
6
  require_relative "sub_commands/deploy"
6
7
  require_relative "sub_commands/branch"
@@ -47,6 +48,13 @@ module Strata
47
48
  invoke Generators::Project, [project_name], options
48
49
  end
49
50
 
51
+ desc "tutorial", "Set up the Strata TPC-DS tutorial project"
52
+ long_desc_from_file "tutorial"
53
+ option :api_key, aliases: ["a"], type: :string, desc: "Strata API key"
54
+ def tutorial
55
+ invoke Generators::Tutorial, [], options
56
+ end
57
+
50
58
  desc "adapters", "Lists supported data warehouse adapters"
51
59
  def adapters
52
60
  out = " SUPPORTED ADAPTERS: \n\t#{DWH.adapters.keys.join("\n\t")}"
@@ -187,7 +187,7 @@ module Strata
187
187
  return unless ds_key
188
188
 
189
189
  adapter = create_adapter(ds_key)
190
- tables = adapter.tables(**options)
190
+ tables = adapter.tables(**adapter_qualifiers)
191
191
  tables = tables.select { it =~ /#{options[:pattern]}/ } if options[:pattern]
192
192
 
193
193
  if agent_mode?
@@ -214,7 +214,7 @@ module Strata
214
214
  method_option :schema, aliases: "s", type: :string, desc: "Change the schema from the configured one."
215
215
  def meta(ds_key, table_name)
216
216
  adapter = create_adapter(ds_key)
217
- md = adapter.metadata(table_name, **options.transform_keys(&:to_sym))
217
+ md = adapter.metadata(table_name, **adapter_qualifiers)
218
218
 
219
219
  if agent_mode?
220
220
  columns = md.columns.map do |column|
@@ -275,6 +275,10 @@ module Strata
275
275
  false
276
276
  end
277
277
 
278
+ def adapter_qualifiers
279
+ options.transform_keys(&:to_sym).slice(:catalog, :schema)
280
+ end
281
+
278
282
  def validate_file_path(file_path, project_path = Dir.pwd)
279
283
  expanded = File.expand_path(file_path, project_path)
280
284
  project_root = File.expand_path(project_path)
@@ -370,6 +374,14 @@ module Strata
370
374
  "schema" => "default",
371
375
  "auth_mode" => "oauth_m2m"
372
376
  }
377
+ when "clickhouse"
378
+ {
379
+ "protocol" => "http",
380
+ "host" => "localhost",
381
+ "port" => 8123,
382
+ "database" => "test_db",
383
+ "username" => "default"
384
+ }
373
385
  else
374
386
  {}
375
387
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strata
4
4
  module CLI
5
- VERSION = "0.1.12"
5
+ VERSION = "0.1.14"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strata-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ajo Abraham
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.4
19
+ version: 0.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.4
26
+ version: 0.5.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: aws-sdk-athena
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -224,7 +224,7 @@ description: |
224
224
  Comprehensive CLI tool for managing Strata Semantic Analytics projects. Create and initialize
225
225
  projects, manage datasource connections, build semantic table models with AI assistance, run
226
226
  audits and validations, and deploy projects to Strata servers. Supports multiple data warehouse
227
- adapters including PostgreSQL, MySQL, SQL Server, Snowflake, Athena, Trino, and more.
227
+ adapters including PostgreSQL, MySQL, SQL Server, Snowflake, Athena, Trino, ClickHouse, and more.
228
228
  email:
229
229
  - ajo@strata.site
230
230
  - allen@strata.site
@@ -264,6 +264,7 @@ files:
264
264
  - lib/strata/cli/descriptions/deploy/deploy.txt
265
265
  - lib/strata/cli/descriptions/deploy/status.txt
266
266
  - lib/strata/cli/descriptions/init.txt
267
+ - lib/strata/cli/descriptions/tutorial.txt
267
268
  - lib/strata/cli/error_reporter.rb
268
269
  - lib/strata/cli/generators/datasource.rb
269
270
  - lib/strata/cli/generators/group.rb
@@ -292,6 +293,7 @@ files:
292
293
  - lib/strata/cli/generators/templates/table.table_name.yml
293
294
  - lib/strata/cli/generators/templates/test.yml
294
295
  - lib/strata/cli/generators/test.rb
296
+ - lib/strata/cli/generators/tutorial.rb
295
297
  - lib/strata/cli/guard.rb
296
298
  - lib/strata/cli/helpers/command_context.rb
297
299
  - lib/strata/cli/helpers/datasource_helper.rb