@@ -12,11 +12,11 @@ One way to install `pgdd` is to install from source by cloning this repository.
12
12
13
13
### Prereqs
14
14
15
- Pgx and its dependencies are the main prereq for PgDD.
15
+ pgrx and its dependencies are the main prereq for PgDD.
16
16
Install Prereqs and ensure PostgreSQL dev tools are installed.
17
17
18
- > See the [ Cargo PGX ] ( https://github.com/zombodb/pgx /tree/master/cargo-pgx )
19
- documentation for more information on using pgx .
18
+ > See the [ Cargo pgrx ] ( https://github.com/zombodb/pgrx /tree/master/cargo-pgrx )
19
+ documentation for more information on using pgrx .
20
20
21
21
22
22
``` bash
@@ -25,18 +25,18 @@ sudo apt install postgresql-server-dev-all libreadline-dev zlib1g-dev curl \
25
25
graphviz
26
26
```
27
27
28
- [ Install Rust] ( https://www.rust-lang.org/tools/install ) and Pgx .
28
+ [ Install Rust] ( https://www.rust-lang.org/tools/install ) and pgrx .
29
29
30
30
``` bash
31
31
curl https://sh.rustup.rs -sSf | sh -s -- -y
32
32
source $HOME /.cargo/env
33
33
```
34
34
35
- Install ` cargo-pgx ` regularly (see dev steps below for non-standard install).
35
+ Install ` cargo-pgrx ` regularly (see dev steps below for non-standard install).
36
36
37
37
38
38
``` bash
39
- cargo install --locked cargo-pgx
39
+ cargo install --locked cargo-pgrx
40
40
```
41
41
42
42
@@ -47,13 +47,13 @@ cargo install cargo-deb
47
47
```
48
48
49
49
50
- Initialize pgx . Need to run this after install AND occasionally to get updates
51
- to Postgres versions or glibc updates. Not typically required to follow pgx
50
+ Initialize pgrx . Need to run this after install AND occasionally to get updates
51
+ to Postgres versions or glibc updates. Not typically required to follow pgrx
52
52
developments.
53
53
54
54
55
55
``` bash
56
- cargo pgx init
56
+ cargo pgrx init
57
57
```
58
58
59
59
@@ -74,7 +74,7 @@ changes the last two digits of the port!
74
74
75
75
76
76
``` bash
77
- cargo pgx run pg14
77
+ cargo pgrx run pg14
78
78
```
79
79
80
80
The output starts with something similar to:
@@ -87,19 +87,19 @@ building extension with features `pg14`
87
87
88
88
89
89
``` bash
90
- Copying control file to ` /home/username/.pgx /14.0/pgx -install/share/postgresql/extension/pgdd.control`
91
- Copying shared library to ` /home/username/.pgx /14.0/pgx -install/lib/postgresql/pgdd.so`
90
+ Copying control file to ` /home/username/.pgrx /14.0/pgrx -install/share/postgresql/extension/pgdd.control`
91
+ Copying shared library to ` /home/username/.pgrx /14.0/pgrx -install/lib/postgresql/pgdd.so`
92
92
Building SQL generator with features ` pg14`
93
93
" cargo" " build" " --bin" " sql-generator" " --features" " pg14" " --no-default-features"
94
94
Compiling pgdd v0.4.0 (/home/username/git/pgdd)
95
95
Finished dev [unoptimized + debuginfo] target(s) in 13.84s
96
96
Discovering SQL entities
97
97
Discovered 9 SQL entities: 0 schemas (0 unique), 6 functions, 0 types, 0 enums, 3 sqls, 0 ords, 0 hashes
98
98
running SQL generator with features ` pg14`
99
- " cargo" " run" " --bin" " sql-generator" " --features" " pg14" " --no-default-features" " --" " --sql" " /home/username/.pgx /14.0/pgx -install/share/postgresql/extension/pgdd--0.4.1-dev.sql"
99
+ " cargo" " run" " --bin" " sql-generator" " --features" " pg14" " --no-default-features" " --" " --sql" " /home/username/.pgrx /14.0/pgrx -install/share/postgresql/extension/pgdd--0.4.1-dev.sql"
100
100
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
101
- Running ` target/debug/sql-generator --sql /home/username/.pgx /14.0/pgx -install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
102
- Copying extension schema file to ` /home/username/.pgx /14.0/pgx -install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
101
+ Running ` target/debug/sql-generator --sql /home/username/.pgrx /14.0/pgrx -install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
102
+ Copying extension schema file to ` /home/username/.pgrx /14.0/pgrx -install/share/postgresql/extension/pgdd--0.4.1-dev.sql`
103
103
Finished installing pgdd
104
104
Starting Postgres v14 on port 28814
105
105
Re-using existing database pgdd
@@ -111,13 +111,13 @@ In the test instance of psql, create the extension in database.
111
111
CREATE EXTENSION pgdd;
112
112
```
113
113
114
- > Note: When you see "Re-using existing database pgdd" your previous installed version of ` pgdd ` will be available. To ensure you are working with the latest version of the ` pgdd ` extension you must drop/create the extension, quit the psql shell, and re-run the ` cargo pgx run ` command.
114
+ > Note: When you see "Re-using existing database pgdd" your previous installed version of ` pgdd ` will be available. To ensure you are working with the latest version of the ` pgdd ` extension you must drop/create the extension, quit the psql shell, and re-run the ` cargo pgrx run ` command.
115
115
116
116
117
117
## Build binary packages
118
118
119
119
Debian/Ubuntu Bionic binaries are available for 0.4.0
120
- (first [ pgx ] ( https://github.com/tcdi/pgx ) version)
120
+ (first [ pgrx ] ( https://github.com/tcdi/pgrx ) version)
121
121
and later. More distributions will likely have binaries available in the future.
122
122
123
123
@@ -134,62 +134,28 @@ During development some versions may be copied to the `./standalone/` directory.
134
134
cp ./target/artifacts/* ./standalone/
135
135
```
136
136
137
- ## Pgx Generate graphviz
137
+ ## pgrx Generate graphviz
138
138
139
139
``` bash
140
- cargo pgx schema -d pgdd.dot
140
+ cargo pgrx schema -d pgdd.dot
141
141
dot -Goverlap=prism -Gspline=ortho -Tjpg pgdd.dot > pgdd.jpg
142
142
```
143
143
144
- ![ pgx dependencies for pgdd] ( pgdd.jpg )
144
+ ![ pgrx dependencies for pgdd] ( pgdd.jpg )
145
145
146
146
147
147
## Non-standard dev
148
148
149
- When working against Pgx installed from a non-tagged branch, install pgx using:
149
+ When working against pgrx installed from a non-tagged branch, install pgrx using:
150
150
151
151
``` bash
152
- cargo install --locked --force --git " https://github.com/tcdi/pgx " \
152
+ cargo install --locked --force --git " https://github.com/tcdi/pgrx " \
153
153
--branch " develop" \
154
- " cargo-pgx "
154
+ " cargo-pgrx "
155
155
```
156
156
157
- Or a beta branch
158
157
159
- ``` bash
160
- cargo install --locked --force cargo-pgx --version 0.2.0-beta.4
161
- ```
162
-
163
- Changes to ` Cargo.toml ` required in ` [lib] ` and ` [dependencies] ` sections.
164
-
165
-
166
- ``` toml
167
- [lib ]
168
- # rlib added to build against repo instead of crate (I think)
169
- crate-type = [" cdylib" , " rlib" ]
170
- # crate-type = ["cdylib"]
171
- ```
172
-
173
-
174
- ``` toml
175
- [dependencies ]
176
-
177
- pgx = { git = " https://github.com/tcdi/pgx" , branch = " oh-no-type-resolution" }
178
- pgx-macros = { git = " https://github.com/tcdi/pgx" , branch = " develop" }
179
- # pgx = "0.1.21"
180
- # pgx-macros = "0.1.21"
181
-
182
- # Won't be needed in final version (hopefully!)
183
- pgx-utils = { git = " https://github.com/tcdi/pgx" , branch = " develop" }
184
-
185
- [dev-dependencies ]
186
- pgx-tests = { git = " https://github.com/tcdi/pgx" , branch = " develop" }
187
- # pgx-tests = "0.1.21"
188
- ```
189
-
190
-
191
-
192
- The following command can be used to force pgx to overwrite the configs it needs to
158
+ The following command can be used to force pgrx to overwrite the configs it needs to
193
159
for various dev related changes.
194
160
195
161
Clean things out.
@@ -209,28 +175,28 @@ Force build the schema.
209
175
210
176
211
177
``` bash
212
- cargo pgx schema -f
178
+ cargo pgrx schema -f
213
179
```
214
180
215
181
216
182
## Non-standard In Docker
217
183
218
- If testing this extension against non-standard pgx install, update the
184
+ If testing this extension against non-standard pgrx install, update the
219
185
Dockerfile to install from the specific branch.
220
186
221
187
Change
222
188
223
189
``` bash
224
190
RUN /bin/bash rustup.sh -y \
225
- && cargo install --locked cargo-pgx
191
+ && cargo install --locked cargo-pgrx
226
192
```
227
193
228
194
To
229
195
230
196
``` bash
231
197
RUN /bin/bash rustup.sh -y \
232
- && cargo install --locked --force --git " https://github.com/tcdi/pgx " \
198
+ && cargo install --locked --force --git " https://github.com/tcdi/pgrx " \
233
199
--branch " develop" \
234
- " cargo-pgx "
200
+ " cargo-pgrx "
235
201
```
236
202
0 commit comments