You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-14Lines changed: 22 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,21 @@
1
1
# etcd_fdw
2
+
2
3
A foreign data wrapper around etcd for postgres
3
4
4
5
## Setup
6
+
5
7
- Install pgrx on your machine `cargo install --locked cargo-pgrx --version 0.16.1`
6
8
- Setup pgrx `cargo pgrx init`
7
9
- Install protoc and protobuf (needed by etcd-client)
8
-
- Instructions can be found [here](https://protobuf.dev/installation/)
10
+
- Instructions can be found [on the official site](https://protobuf.dev/installation/)
9
11
- Have some kind of etcd you want to test and run
10
12
11
-
12
13
## Build
14
+
13
15
- To build simply run `cargo pgrx run` with or without the `--release` flag
14
16
15
17
## Try out something yourself
18
+
16
19
Currently we can only read from etcd.
17
20
Here's an example of how to connect to your etcd instance and read some KVs
18
21
@@ -37,36 +40,41 @@ SELECT * FROM test;
37
40
```
38
41
39
42
Which would yield something like:
43
+
40
44
```
41
45
key | value
42
46
-----+-------
43
47
bar | baz
44
48
foo | bar
45
49
(2 rows)
46
50
```
47
-
the rowid option is required. As are the names key and value for the columns.
48
51
52
+
the rowid option is required. As are the names key and value for the columns.
49
53
50
54
## Pushdowning
51
55
52
-
#### ORDER BY push-down
56
+
`etcd_fdw` supports push-down of filters, order by and limit clauses to the etcd server.
57
+
58
+
### ORDER BY push-down
59
+
53
60
`etcd_fdw` now also supports order by push-down. If possible, push order by
54
61
clause to the remote server so that we get the ordered result set from the
55
62
foreign server itself.
56
63
57
-
#### LIMIT push-down
64
+
### LIMIT push-down
65
+
58
66
`etcd_fdw` now also supports limit offset push-down. Wherever possible,
59
-
perform LIMIT operations on the remote server.
67
+
perform LIMIT operations on the remote server.
60
68
61
69
#### WHERE push-down
70
+
62
71
`etcd_fdw` now supports WHERE clause push-down for simple key-based comparisons. Whenever possible, equality and range conditions are translated into etcd key scans, so filtering is done on the remote server.
63
72
Currently supported operators: `=`, `>=`, `>`, `<=`, `<`, `BETWEEN`, and `LIKE 'prefix%'`.
64
73
This behavior is consistent with the prefix, range_end, and key options in `CREATE FOREIGN TABLE`.
65
74
66
-
Usage
67
-
-----
75
+
## Usage
68
76
69
-
## CREATE SERVER options
77
+
###CREATE SERVER options
70
78
71
79
`etcd_fdw` accepts the following options via the `CREATE SERVER` command:
72
80
@@ -109,8 +117,7 @@ Usage
109
117
110
118
Timeout in seconds to each request after the connection has been established.
111
119
112
-
113
-
## CREATE FOREIGN TABLE options
120
+
### CREATE FOREIGN TABLE options
114
121
115
122
`etcd_fdw` accepts the following table-level options via the
116
123
`CREATE FOREIGN TABLE` command.
@@ -139,7 +146,7 @@ Usage
139
146
140
147
The starting key to fetch from etcd.
141
148
142
-
This option defines the beginning of the range.
149
+
This option defines the beginning of the range.
143
150
If neither `prefix` nor `key` is specified, the FDW will default to `\0` (the lowest possible key).
144
151
145
152
-**range_end** as *string*, optional, no default
@@ -153,16 +160,17 @@ Usage
153
160
154
161
Specifies the read consistency level for etcd queries.
155
162
156
-
157
163
Linearizable(`l`), Ensures the result reflects the latest consensus state of the cluster.
158
164
Linearizable reads have higher latency but guarantee fresh data.
159
165
160
-
Serializable(`s`), Allows serving results from a local etcd member without cluster-wide consensus.
166
+
Serializable(`s`), Allows serving results from a local etcd member without cluster-wide consensus.
161
167
Serializable reads are faster and lighter on the cluster, but may return stale data in some cases
162
168
163
169
## What doesn't work
170
+
164
171
etcd_fdw supports almost all kinds of CRUD operations. What doesn't work is modifying the key (which is the rowid value) directly using `UPDATE` statements.
0 commit comments