Skip to content

Conversation

@amotl
Copy link
Member

@amotl amotl commented Oct 17, 2025

@amotl amotl added the cross linking Linking to different locations of the documentation. label Oct 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2025

Warning

Rate limit exceeded

@amotl has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 56 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 044df39 and acba932.

⛔ Files ignored due to path filters (1)
  • docs/_assets/icon/zig-logo.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • docs/conf.py
  • docs/connect/index.md
  • docs/connect/zig/index.md

Walkthrough

Adds documentation for a Zig CrateDB driver: a new driver page with examples and build snippets, updates the main Connect drivers index to include a Zig card and navigation entry, and appends an OpenTelemetry URL to docs linkcheck_ignore.

Changes

Cohort / File(s) Summary
Zig driver docs
docs/connect/zig/index.md, docs/connect/index.md
New Zig driver page with build and usage examples; main drivers index updated with a Zig grid-item-card and added toctree entry.
Docs config
docs/conf.py
Added https://opentelemetry.io/ to linkcheck_ignore (read-timeout comment).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

cross linking

Suggested reviewers

  • seut
  • matriv

Poem

🐰 I hopped through docs with a twinkling jig,
Wrote a Zig card and a tiny big gig.
Build scripts in burrows, examples so neat,
CrateDB meets Zig — a carrot-y treat! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Driver: Add page about Zig' directly matches the main change: adding a new Zig driver documentation page with integration into the drivers index.
Description check ✅ Passed The description is related to the changeset, confirming the addition of a Zig documentation page and providing a preview link.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zig

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as duplicate.

@amotl amotl added new content New content being added. and removed cross linking Linking to different locations of the documentation. labels Oct 18, 2025
@amotl amotl force-pushed the zig branch 3 times, most recently from 4722c90 to 12be5ca Compare October 18, 2025 22:23
Copy link
Member

@kneth kneth left a comment

Choose a reason for hiding this comment

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

@amotl amotl requested review from matriv and seut and removed request for surister January 21, 2026 07:33
@amotl
Copy link
Member Author

amotl commented Jan 21, 2026

I think it's nice to have a dedicated page about Zig, so that all downstream entities (humans and machines) can easily learn how to connect to CrateDB using the PostgreSQL interface, and use a ready-to-run example to exercise it right away.

In the long run, this will also improve network effects, because CrateDB gains a dedicated representation within the corresponding search- and vectorspaces.

Currently, relevant search keywords like cratedb zig will not yield concise results, but this will improve a few days after merging this patch.

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

left a couple of comments, thx!

const exe = b.addExecutable(.{
.name = "example",
.root_module = b.createModule(.{
.root_source_file = b.path("example.zig"),
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this file: example.zig? I don't think it's explained.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is the program right below the build script.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should clarify this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tried with acba932, thanks.

:::{rubric} CrateDB Cloud
:::

For connecting to CrateDB Cloud, use the `sslmode=require` parameter,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For connecting to CrateDB Cloud, use the `sslmode=require` parameter,
For connecting to a CrateDB node with ssl enabled (e.g.: CrateDB Cloud), use the `sslmode=require` parameter,

Maybe this wording is better to reveal more generic usage?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, we even renamed the headline on previous patches. 044df39 does the same here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@docs/connect/zig/index.md`:
- Around line 43-44: Add a one-line clarification after the `example.zig`
filename stating that `example.zig` is the program produced by running
`build.zig`; reference both filenames (`example.zig`, `build.zig`) so readers
understand that `build.zig` builds the `example.zig` executable.
- Around line 55-56: Update the example connection URI to use the default empty
local password: change the const uri assignment that calls std.Uri.parse
(currently "postgresql://crate:crate@localhost/?sslmode=disable") to omit the
password so the URI becomes "postgresql://crate@localhost/?sslmode=disable"
before calling pg.Pool.initUri with allocator and pool.
🧹 Nitpick comments (2)
docs/connect/zig/index.md (2)

23-31: Honor the selected target in the build example.

Using b.graph.host ignores b.standardTargetOptions, so cross-compiles won’t follow the user-selected target. Consider wiring .target = target instead.

♻️ Proposed fix
-        .root_module = b.createModule(.{
-            .root_source_file = b.path("example.zig"),
-            .target = b.graph.host,
-        })
+        .root_module = b.createModule(.{
+            .root_source_file = b.path("example.zig"),
+            .target = target,
+        })

73-75: Pin pg.zig to a tag/commit instead of #master.

Using #master is non-reproducible and may break as upstream changes. Prefer a release tag or commit hash.

♻️ Example pin
-zig fetch --save git+https://github.com/karlseguin/pg.zig#master
+zig fetch --save git+https://github.com/karlseguin/pg.zig#vX.Y.Z

Comment on lines +55 to +60
const uri = try std.Uri.parse("postgresql://crate:crate@localhost/?sslmode=disable");
var pool = try pg.Pool.initUri(allocator, uri, .{.size=5, .timeout=5_000});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use default credentials in the local URI.

The example uses a non-default password (crate), which breaks the out-of-the-box local setup where password is empty. Please align with default connection parameters. Based on learnings, ...

✅ Proposed fix
-    const uri = try std.Uri.parse("postgresql://crate:crate@localhost/?sslmode=disable");
+    const uri = try std.Uri.parse("postgresql://crate@localhost/?sslmode=disable");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const uri = try std.Uri.parse("postgresql://crate:crate@localhost/?sslmode=disable");
var pool = try pg.Pool.initUri(allocator, uri, .{.size=5, .timeout=5_000});
const uri = try std.Uri.parse("postgresql://crate@localhost/?sslmode=disable");
var pool = try pg.Pool.initUri(allocator, uri, .{.size=5, .timeout=5_000});
🤖 Prompt for AI Agents
In `@docs/connect/zig/index.md` around lines 55 - 56, Update the example
connection URI to use the default empty local password: change the const uri
assignment that calls std.Uri.parse (currently
"postgresql://crate:crate@localhost/?sslmode=disable") to omit the password so
the URI becomes "postgresql://crate@localhost/?sslmode=disable" before calling
pg.Pool.initUri with allocator and pool.

b.installArtifact(exe);
}
```
`example.zig`
Copy link
Contributor

Choose a reason for hiding this comment

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

I would define this first, and then the above code which uses it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I've added acba932.

@amotl amotl merged commit 3b26497 into main Jan 21, 2026
3 checks passed
@amotl amotl deleted the zig branch January 21, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new content New content being added.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants