Skip to content

Comments

Features: Add details to FDW page#548

Draft
bmunkholm wants to merge 12 commits intomainfrom
bm/fdw
Draft

Features: Add details to FDW page#548
bmunkholm wants to merge 12 commits intomainfrom
bm/fdw

Conversation

@bmunkholm
Copy link
Contributor

@bmunkholm bmunkholm commented Feb 12, 2026

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Rewrites and reorganizes the FDW documentation into Prerequisites, Set up, Usage, and Drop server; adds explicit limitations and security notes (localhost/HBA/fdw.allow_local), step-by-step SQL examples for server/user mappings/foreign tables, explain output examples, and expanded cleanup/reference guidance. (47 words)

Changes

Cohort / File(s) Summary
Foreign Data Wrapper docs
docs/feature/fdw/index.md
Complete restructure and expansion: new flow (Prerequisites → Set up → Usage → Drop server); added limitations and security notes (localhost access, HBA, fdw.allow_local); replaced synopsis with step-by-step SQL examples for server creation, user mappings, foreign tables; added explain examples; clarified drop/cleanup semantics and updated references.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I nibbled through headings, lined each SQL row,
Prereqs, mappings, cleanups now in a row.
Notes on locks and localhost kept neat,
Docs hop forward on careful feet —
A tiny rabbit’s guide to make reading sprout 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Features: Add details to FDW page' is related to the changeset, which involves a massive reorganization and expansion of the FDW documentation page with new structural sections, examples, and detailed content.
Description check ✅ Passed The description is related to the changeset, explaining that the FDW page was updated with content from a prior GitBook version and references the issue being fixed, matching the documentation expansion seen in the changes.
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 bm/fdw

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.

Copy link
Member

@amotl amotl left a comment

Choose a reason for hiding this comment

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

Moved an updated FDW page we had in gitbook to the Ingestion section with minor updates.

Thank you for any updates. However, please don't relocate: FDW has far more applications than just "ingestion". If you want to have it mentioned more prominently in this section, please tease and cross-link accordingly.

@bmunkholm
Copy link
Contributor Author

However, please don't relocate: FDW has far more applications than just "ingestion". If you want to have it mentioned more prominently in this section, please tease and cross-link accordingly.

Fair enough, we can get back to that part later.

@bmunkholm bmunkholm changed the title Add details to FDW page and relocate to Ingestion. Add details to FDW page. Feb 12, 2026
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: 1

🤖 Fix all issues with AI agents
In `@docs/feature/fdw/index.md`:
- Around line 69-92: The SQL example uses remote_readings but the foreign table
was created as doc.remote_readings; update the query example to use the
fully-qualified table name doc.remote_readings (or add a short note that the doc
schema must be in the search_path) so the example will work as-is; locate the
example query block that references remote_readings and replace it with
doc.remote_readings (or add the search_path note directly above the query).
🧹 Nitpick comments (1)
docs/feature/fdw/index.md (1)

57-62: Consider a short note about credentials handling.

The example inlines password '*****'. For docs, it may be worth noting whether secrets should be managed via secure settings or tooling to avoid embedding credentials in plain text.

@bmunkholm bmunkholm requested a review from amotl February 12, 2026 14:17
@bmunkholm bmunkholm enabled auto-merge (squash) February 12, 2026 14:18
Copy link
Member

@amotl amotl left a comment

Choose a reason for hiding this comment

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

Hi. Thanks for the update. I've added a few suggestions to address at your disposal. Also, let's have @seut and @matriv review relevant ingredients: Maybe they also have suggestions how to improve.

@amotl amotl requested review from matriv and seut February 12, 2026 14:51
@amotl amotl changed the title Add details to FDW page. Features: Add details to FDW page Feb 12, 2026
bmunkholm and others added 3 commits February 12, 2026 15:56
Co-authored-by: Andreas Motl <andreas.motl@crate.io>
Co-authored-by: Andreas Motl <andreas.motl@crate.io>
Co-authored-by: Andreas Motl <andreas.motl@crate.io>
@amotl amotl added the sanding-1200 Fine sanding. label Feb 12, 2026
@bmunkholm bmunkholm requested a review from amotl February 12, 2026 16:29
@bmunkholm bmunkholm disabled auto-merge February 12, 2026 16:30
@bmunkholm
Copy link
Contributor Author

(What an insane amount of timeouts we have in the build (https://github.com/crate/cratedb-guide/actions/runs/21951807340/job/63404431908?pr=548).

Copy link
Member

@amotl amotl left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all the suggestions. I have no objections, so acknowledging, but maybe @seut or @matriv can find something more to fix or improve.

@amotl
Copy link
Member

amotl commented Feb 12, 2026

What an insane amount of timeouts we have in the build.

Oh. Either it's bad Internet weather today, or SREs are ramping up countermeasures against rogue web crawlers. This will certainly make legitimate link checkers have bad times going forward.

@bmunkholm
Copy link
Contributor Author

bmunkholm commented Feb 12, 2026

Thanks for addressing all the suggestions. I have no objections, so acknowledging, but maybe @seut or @matriv can find something more to fix or improve.

I'll give them some time then. Thanks for all the feedback!

(Build errors are once again about rate-limiting in the link-checks. Addressed in theme.)

:::{rubric} System Tables
### Set firewall rules

Ensure outbound firewall rules allow CrateDB → remote DB traffic before
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to mention which TCP port (5432) needs to be open?

Copy link
Contributor

Choose a reason for hiding this comment

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

we could as an example, but 5432 is not strict, just the default port.

Copy link
Member

@seut seut left a comment

Choose a reason for hiding this comment

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

I wonder what value this content will bring as it seems to be roughly a 1:1 copy of the FDW reference documentation. Without adding any additional content (if needed at all), I'd suggest to keep it as-is (what was the issue here?) or link to the reference content more prominent.
If there is something to add to the existing reference documentation, please improve it instead of creating copies.

@bmunkholm
Copy link
Contributor Author

I wonder what value this content will bring...

Thats a very reasonable concern. And it's valid for a LOT of the pages we have.
I didn't write the content here itself - I only populated it from Gitbook. The original thought was that in general a lot of the content in Reference is very detailed, and something more easy to get started with and organized for easy discovery was needed.

We haven't come to reorganizing the Reference yet. But if it was up to me, and time enough was available, we would reorganize it significantly. Right now there is way too much overlap across many pages. But this still fits the current direction, and having multiple pages "under construction" in the "All Features" section doesn't give much confidence in the state of the docs tbh. Right now the FDW in Reference is burried under "Administration" which seems odd btw.

In flow with the current direction, I would still suggest to add this. If we are to not duplicate info at all, we need another strategic direction and can delete a lot of pages. (which I totally would support - we just don't have the capacity to do it).

Copy link
Member

@seut seut left a comment

Choose a reason for hiding this comment

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

Thats a very reasonable concern. And it's valid for a LOT of the pages we have.
I didn't write the content here itself - I only populated it from Gitbook. The original thought was that in general a lot of the content in Reference is very detailed, and something more easy to get started with and organized for easy discovery was needed.

Only because this was done in the past, does not justify to me to keep up with this. Also, please judge by case, as this is really a 1:1 copy, no further guidance is added here, afaik.
Copying content makes everything more complex to maintain for no good reason, so let us stop here please.
If we really need to include the same content completely in different places, we should imho look into different solution like including remote content, e.g. by https://pypi.org/project/sphinxext-remoteliteralinclude/.

@bmunkholm
Copy link
Contributor Author

bmunkholm commented Feb 13, 2026

@amotl @kneth - you both approved this. What are your thoughts?
Should we drop it altogether? Or is it still an improvement over current state, although not ideal?

@kneth
Copy link
Member

kneth commented Feb 16, 2026

IMHO, the current page needs a make-over. If we don't want to gather documentation about FDW in one page, I suggest that we simplify the page to mention that the feature exists and link to the two following pages:

By simplifying, I mean removing everything from "Synopsis" and down, and remove "SQL functions" and "System tables".

@amotl
Copy link
Member

amotl commented Feb 16, 2026

IMHO, the current page needs a make-over.

I absolutely agree. Currently, it is obviously just a stub. While I was happy that someone would fill the gaps, it doesn't make sense to add redundant content, which likely has been created by AI-based summarization tools instead of conceiving unique content. If this is the case here, I will come up with a different proposal as we go.

@bmunkholm bmunkholm marked this pull request as draft February 16, 2026 15:31
@bmunkholm
Copy link
Contributor Author

bmunkholm commented Feb 16, 2026

created by AI-based summarization tools

In this case it was actually a human :-).

@amotl
Copy link
Member

amotl commented Feb 16, 2026

I'd like to apologize if it was a human in this case, I don't want to hurt anyones feelings. We've lost a bit track, and also GH-264 did not make much progress 1, so we thought actually improving content was mostly out of scope, because it was merely a rehash of existing material in a different structure. After this converged progressively, it became more difficult to pick any cherries.

Footnotes

  1. In this spirit, what about the ingredients of Getting started / Search: Add new section (GenAI, edited) #264 today?

Copy link
Member

@amotl amotl left a comment

Choose a reason for hiding this comment

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

Hi again. I revisited the review because I didn't do a thorough content comparison before, and because @seut had admonitions about it, also content-wise. I've identified the primary offending section now, and I think the patch will be good to go if we just remove it and more prominently refer to the reference documentation page instead. Thanks!

I think the excellent stepper-based presentation of a typical FDW workflow is absolutely the right choice for this kind of page within the "all features" section that aims to provide an optimal layer above the reference documentation, to improve on guidance matters. It would be sad to leave this behind.

Image

Comment on lines +92 to +112
Query clauses like `GROUP BY`, `HAVING`, `LIMIT` or `ORDER BY` are executed
within CrateDB, not within the foreign system. `WHERE` clauses can in some
circumstances be pushed to the foreign system, but that depends on the
concrete foreign data wrapper implementation. You can check if this is the
case by using the {ref}`crate-reference:ref-explain` statement.

For example, in the following explain output there is a dedicated `Filter`
node, indicating that the filter is executed within CrateDB:

```sql
CREATE FOREIGN TABLE doc.remote_documents (name text)
SERVER my_postgresql
OPTIONS (schema_name 'public', table_name 'documents');
EXPLAIN SELECT ts, value FROM remote_readings WHERE device = 'sensor-42';
```

```text
+--------------------------------------------------------------------------+
| QUERY PLAN |
+--------------------------------------------------------------------------+
| Filter[(device = 'sensor-42')] (rows=0) |
| └ ForeignCollect[doc.remote_readings | [device] | true] (rows=unknown) |
+--------------------------------------------------------------------------+
```
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this is the primary offending section with a 100% redundancy to the reference documentation page. Can you just remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I'm not entirely sure what exactly you mean should be removed. The whole diff? (92-112)?

Instead of back and forth with me just acting as a scribe, perhaps it's easiest if you just edit the way you can see it being good? 🙏

Copy link
Member

@amotl amotl Feb 18, 2026

Choose a reason for hiding this comment

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

It is this original content I am referring to. It seems to have been copied 1:1 to that spot?

Query clauses like `GROUP BY`, `HAVING`, `LIMIT` or `ORDER BY` are executed
within CrateDB, not within the foreign system. `WHERE` clauses can in some
circumstances be pushed to the foreign system, but that depends on the
concrete foreign data wrapper implementation. You can check if this is the
case by using the {ref}`crate-reference:ref-explain` statement.
For example, in the following explain output there is a dedicated `Filter`
node, indicating that the filter is executed within CrateDB:
```sql
EXPLAIN SELECT ts, value FROM remote_readings WHERE device = 'sensor-42';
```
```text
+--------------------------------------------------------------------------+
| QUERY PLAN |
+--------------------------------------------------------------------------+
| Filter[(device = 'sensor-42')] (rows=0) |
| └ ForeignCollect[doc.remote_readings | [device] | true] (rows=unknown) |
+--------------------------------------------------------------------------+
```

Copy link
Member

@amotl amotl Feb 18, 2026

Choose a reason for hiding this comment

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

Aha. I see now that the SQL statement is different to probably match the tutorial, and that the paragraph above is the teaser to that, which is probably needed to make sense. Well, it still bears 95% redundancy otherwise, so I'd still vote to remove the section to satisfy corresponding admonitions from colleagues.

@amotl amotl marked this pull request as ready for review February 18, 2026 11:35
@bmunkholm bmunkholm marked this pull request as draft February 20, 2026 14:02
@bmunkholm
Copy link
Contributor Author

I put this back to draft as it's not ready for merging. @amotl If you have an exact idea about where to take this, I would appreciate if you do the edits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanding-1200 Fine sanding.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants