Skip to content

Adding more examples#180

Merged
alex-clickhouse merged 6 commits intomainfrom
yet-further-examples
Jan 21, 2026
Merged

Adding more examples#180
alex-clickhouse merged 6 commits intomainfrom
yet-further-examples

Conversation

@alex-clickhouse
Copy link
Copy Markdown
Collaborator

@alex-clickhouse alex-clickhouse commented Jan 21, 2026

Note

Introduces several new example categories and integrates them into the runner, plus expands insertion patterns and supporting docs/deps.

  • Advanced: Adds RetriesAndDeduplication (Polly + ReplacingMergeTree dedup) and Compression (UseCompression behavior)
  • Data Types: New SimpleTypes example (ints, floats, decimals via ClickHouseDecimal, bool)
  • ORM Integration: New DapperExample (incl. Dapper.Contrib caveats) and Linq2DbExample (LINQ queries, BulkCopy)
  • Troubleshooting: Adds OpenTelemetryTracing collecting driver spans via ActivitySource with console exporter
  • Testing: Adds Testcontainers example to spin up ephemeral ClickHouse for integration tests
  • Inserts: Enhances SimpleDataInsert (command reuse, ExecuteStatementAsync, EXCEPT clause with DEFAULTs); minor spacing fixes in other insert examples; adds raw stream CSV/JSON insert demo wiring
  • Program/README: Wires new examples into Program.cs execution order and documents them in README.md
  • Project: Updates ClickHouse.Driver.Examples.csproj with new package references (Dapper, Dapper.Contrib, linq2db, OpenTelemetry.Exporter.Console, Polly, Testcontainers.ClickHouse) and includes sample CSV as content

Written by Cursor Bugbot for commit cb624eb. This will update automatically on new commits. Configure here.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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 significantly expands the examples project by adding seven new examples covering ORMs (Dapper, linq2db), advanced features (retries/deduplication, compression), data types, troubleshooting (OpenTelemetry), and testing (Testcontainers). It also refactors the existing Insert_001_SimpleDataInsert example into structured methods and adds documentation improvements.

Changes:

  • Seven new example files demonstrating ORM integration, OpenTelemetry tracing, Testcontainers, retries with Polly, compression settings, and simple data types
  • Refactoring of Insert_001_SimpleDataInsert.cs to use structured methods with an additional EXCEPT clause example
  • Updates to supporting files (Program.cs, README.md, .csproj) to integrate the new examples

Reviewed changes

Copilot reviewed 11 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
examples/Troubleshooting_003_OpenTelemetryTracing.cs New example demonstrating OpenTelemetry integration with the driver's ActivitySource
examples/Testing_001_Testcontainers.cs New example showing how to use Testcontainers for integration testing
examples/README.md Documentation updates listing all new examples and organizing them into sections
examples/Program.cs Integration of new examples into the main execution flow with proper sectioning
examples/ORM_002_Linq2Db.cs New example demonstrating linq2db ORM integration including LINQ queries and BulkCopy
examples/ORM_001_Dapper.cs New example showing Dapper ORM usage with custom type handlers for ClickHouse types
examples/Insert_001_SimpleDataInsert.cs Refactored into structured methods with new EXCEPT clause example
examples/DataTypes_001_SimpleTypes.cs New example covering simple/scalar data types (integers, floats, decimals, booleans)
examples/ClickHouse.Driver.Examples.csproj Added package references for new dependencies (Dapper, linq2db, OpenTelemetry, Polly, Testcontainers)
examples/Advanced_011_Compression.cs New example explaining the UseCompression setting and when to modify it
examples/Advanced_010_RetriesAndDeduplication.cs New example demonstrating retry patterns with Polly and ReplacingMergeTree for exactly-once semantics

Comment thread examples/Troubleshooting_003_OpenTelemetryTracing.cs
Comment thread examples/Testing_001_Testcontainers.cs
Comment thread examples/ORM_002_Linq2Db.cs
Comment thread examples/Insert_001_SimpleDataInsert.cs
Comment thread examples/DataTypes_001_SimpleTypes.cs
Comment thread examples/DataTypes_001_SimpleTypes.cs
Comment thread examples/Advanced_011_Compression.cs
Comment thread examples/Advanced_010_RetriesAndDeduplication.cs Outdated
Comment thread examples/ORM_001_Dapper.cs Outdated
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@@ -0,0 +1,152 @@
using System.Net;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused import in simple types example file

Low Severity

The using System.Net; import is not used anywhere in this file. The file demonstrates simple/scalar data types (integers, floats, decimals, booleans) and none of these require types from System.Net. IP address handling is covered in DataTypes_003_ComplexTypes.cs where this import would be appropriate.

Fix in Cursor Fix in Web

@alex-clickhouse alex-clickhouse merged commit caba8cb into main Jan 21, 2026
18 checks passed
@alex-clickhouse alex-clickhouse deleted the yet-further-examples branch January 23, 2026 13:55
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.

3 participants