Skip to content

Additional examples#145

Merged
alex-clickhouse merged 5 commits intomainfrom
additional-examples
Dec 23, 2025
Merged

Additional examples#145
alex-clickhouse merged 5 commits intomainfrom
additional-examples

Conversation

@alex-clickhouse
Copy link
Copy Markdown
Collaborator

  • Select to file
  • Query cancelation
  • Readonly users
  • Insert from select
  • Insert with ephemeral

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds five new example files demonstrating important ClickHouse.Driver capabilities: exporting query results to files, query cancellation, read-only user limitations, INSERT FROM SELECT patterns, and EPHEMERAL columns. These examples enhance the documentation by covering common use cases for data export, ETL operations, user permission management, and cancellation handling.

Key Changes

  • Added examples for exporting query results to different formats (JSONEachRow, Parquet)
  • Added query cancellation examples using CancellationToken
  • Added comprehensive read-only user limitation examples
  • Added INSERT FROM SELECT examples for ETL and data transformation scenarios
  • Added EPHEMERAL column examples for input data transformation

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
examples/Select_004_ExportToFile.cs Demonstrates ExecuteRawResultAsync for exporting query results to JSONEachRow and Parquet formats
examples/README.md Updated documentation index with references to the new example files
examples/Program.cs Added invocations for the new example classes in the example runner
examples/Insert_006_EphemeralColumns.cs Demonstrates using EPHEMERAL columns to derive multiple stored columns from temporary input values
examples/Insert_005_InsertFromSelect.cs Demonstrates INSERT FROM SELECT for data copying, transformation, and aggregation
examples/Advanced_009_ReadOnlyUsers.cs Demonstrates behavior and limitations of READONLY = 1 users including blocked operations
examples/Advanced_008_QueryCancellation.cs Demonstrates cancelling queries using CancellationToken with timeout and manual cancellation scenarios

Comment thread examples/Select_004_ExportToFile.cs
Comment thread examples/Advanced_009_ReadOnlyUsers.cs
Comment on lines +30 to +31
var readOnlyUsername = $"clickhouse_cs_readonly_user_{guid}";
var readOnlyPassword = $"{guid}_pwd";
Copy link

Copilot AI Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Password is predictable from username since both use the same GUID. In production scenarios, passwords should be cryptographically random and independent from usernames.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@alex-clickhouse alex-clickhouse merged commit 7d39a57 into main Dec 23, 2025
16 checks passed
@alex-clickhouse alex-clickhouse deleted the additional-examples branch January 12, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants