Skip to content

Add more CREATE FOREIGN TABLE options#21

Merged
imranzaheer612 merged 5 commits intomainfrom
table-options
Sep 29, 2025
Merged

Add more CREATE FOREIGN TABLE options#21
imranzaheer612 merged 5 commits intomainfrom
table-options

Conversation

@imranzaheer612
Copy link
Copy Markdown
Contributor

@imranzaheer612 imranzaheer612 commented Sep 25, 2025

New options

  • prefix
  • keys_only
  • revision
  • key
  • range_eng
  • consistency

Copy link
Copy Markdown
Contributor

@if-loop69420 if-loop69420 left a comment

Choose a reason for hiding this comment

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

Looks good. LGTM, if you've tested that everything works

@if-loop69420 if-loop69420 self-requested a review September 29, 2025 07:30
Copy link
Copy Markdown
Contributor

@if-loop69420 if-loop69420 left a comment

Choose a reason for hiding this comment

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

Please address these

Comment thread README.md
Comment thread src/lib.rs Outdated
@@ -237,21 +235,51 @@ impl ForeignDataWrapper<EtcdFdwError> for EtcdFdw {
limit: &Option<Limit>,
_options: &std::collections::HashMap<String, String>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we change this to not have an '' before it? We're using the value and '' as a prefix suggests, that a value is not used

Copy link
Copy Markdown
Contributor

@if-loop69420 if-loop69420 left a comment

Choose a reason for hiding this comment

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

The prefix option still doesn't work for me. It still yields things not in the prefix.

etcd_fdw=# CREATE FOREIGN TABLE t_etcd_table (key text, value text) SERVER etcd_server OPTIONS (prefix '/foo');
CREATE FOREIGN TABLE
etcd_fdw=# SELECT * FROM t_etcd_table ;
    key    | value
-----------+-------
 /foo/bar  | baz
 bar_new   | baz
 foo_new   | abc

Please fix these. Other than that LGTM

Comment thread src/lib.rs Outdated
@imranzaheer612
Copy link
Copy Markdown
Contributor Author

@if-loop69420 I am not able to reproduce the error you mentioned

etcd_fdw=# CREATE FOREIGN TABLE t_etcd_table (key text, value text) SERVER my_etcd_server OPTIONS (rowid_column 'key', prefix 'foo');
CREATE FOREIGN TABLE
etcd_fdw=# select * from t_etcd_table;
 key  | value 
------+-------
 foo  | 1
 foo1 | 1
 foo2 | 1
 foo3 | 1
 foo4 | 1
(5 rows)

Copy link
Copy Markdown
Contributor

@if-loop69420 if-loop69420 left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you. LGTM

@imranzaheer612 imranzaheer612 merged commit 5119856 into main Sep 29, 2025
2 checks passed
@imranzaheer612 imranzaheer612 deleted the table-options branch September 30, 2025 10:01
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