@raphiniert/ra-data-postgrest 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +236 -224
- package/README.md +247 -232
- package/esm/index.d.ts +2 -1
- package/esm/index.js +16 -5
- package/esm/urlBuilder.d.ts +7 -1
- package/esm/urlBuilder.js +12 -3
- package/lib/index.d.ts +2 -1
- package/lib/index.js +16 -5
- package/lib/urlBuilder.d.ts +7 -1
- package/lib/urlBuilder.js +13 -4
- package/package.json +51 -50
- package/src/index.ts +422 -408
- package/src/urlBuilder.ts +320 -311
package/CHANGELOG.md
CHANGED
|
@@ -1,224 +1,236 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
Find all notable changes of this project in this file.
|
|
4
|
-
|
|
5
|
-
## v2.
|
|
6
|
-
### Improvements
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
- [#
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
##
|
|
95
|
-
|
|
96
|
-
- [#
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
###
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
|
|
156
|
-
## v1.1.
|
|
157
|
-
|
|
158
|
-
### Fixes
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
Find all notable changes of this project in this file.
|
|
4
|
+
|
|
5
|
+
## v2.2.0 - 2024-06-28
|
|
6
|
+
### Improvements
|
|
7
|
+
- [#123](https://github.com/raphiniert-com/ra-data-postgrest/pull/125) Adding global sort order options @[kav](https://github.com/kav)
|
|
8
|
+
|
|
9
|
+
## v2.1.0 - 2024-02-27
|
|
10
|
+
### Improvements
|
|
11
|
+
- updated dependencies
|
|
12
|
+
|
|
13
|
+
### Fixes
|
|
14
|
+
- [#123](https://github.com/raphiniert-com/ra-data-postgrest/pull/123) Modifying update call to only update changed fields @[kav](https://github.com/kav)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## v2.0.0 - 2023-12-29
|
|
18
|
+
### Improvements
|
|
19
|
+
- updated dependencies
|
|
20
|
+
|
|
21
|
+
### Fixes
|
|
22
|
+
- [#113](https://github.com/raphiniert-com/ra-data-postgrest/pull/113) remove {} value wrapping for cs/cd @[ruslantalpa](https://github.com/ruslantalpa)
|
|
23
|
+
|
|
24
|
+
### Breaking changes
|
|
25
|
+
- the fix in this version might break old versions, as the {} are removed. Thus, one needs to manually add the {} for cs/cd.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## v2.0.0-alpha.4 - 2023-10-23
|
|
29
|
+
### Improvements
|
|
30
|
+
- updated dependencies
|
|
31
|
+
|
|
32
|
+
### New feature
|
|
33
|
+
- [#100](https://github.com/raphiniert-com/ra-data-postgrest/pull/100) support "meta.columns" on all code paths (useful when the user does not have permissions on all the columns in which case doing select=* gives permissions errors) - @[ruslantalpa](https://github.com/ruslantalpa)
|
|
34
|
+
|
|
35
|
+
### Fixes
|
|
36
|
+
- [#50](https://github.com/raphiniert-com/ra-data-postgrest/issues/50) and [#88](https://github.com/raphiniert-com/ra-data-postgrest/issues/88) solved by [#100](https://github.com/raphiniert-com/ra-data-postgrest/pull/100) including other fixes - @[ruslantalpa](https://github.com/ruslantalpa)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## v2.0.0-alpha.3 - 2023-06-16
|
|
40
|
+
### Improvements
|
|
41
|
+
- updated dependencies
|
|
42
|
+
|
|
43
|
+
### New feature
|
|
44
|
+
- [#82](https://github.com/raphiniert-com/ra-data-postgrest/pull/82), add logical operator filter parsing - @[jordiyapz](https://github.com/jordiyapz)
|
|
45
|
+
|
|
46
|
+
### Fixes
|
|
47
|
+
- [#81](https://github.com/raphiniert-com/ra-data-postgrest/pull/81), use {} with cs and cd operators url - @[YannBeauxis](https://github.com/YannBeauxis)
|
|
48
|
+
|
|
49
|
+
### Breaking changes
|
|
50
|
+
- Changed from from regular parameters to instantiate the dataProvider to a configuration interface/class. Thus, in future initalize the dataProvider by creating a structure which implements the interface:
|
|
51
|
+
|
|
52
|
+
```jsx
|
|
53
|
+
import { fetchUtils } from 'react-admin';
|
|
54
|
+
import postgrestRestProvider,
|
|
55
|
+
{ IDataProviderConfig,
|
|
56
|
+
defaultPrimaryKeys,
|
|
57
|
+
defaultSchema } from '@raphiniert/ra-data-postgrest';
|
|
58
|
+
|
|
59
|
+
const config: IDataProviderConfig = {
|
|
60
|
+
apiUrl: 'http://path.to.my.api/',
|
|
61
|
+
httpClient: fetchUtils.fetchJson,
|
|
62
|
+
defaultListOp: 'eq',
|
|
63
|
+
primaryKeys: defaultPrimaryKeys,
|
|
64
|
+
schema: defaultSchema
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
dp = postgrestRestProvider(config);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## v2.0.0-alpha.2 - 2023-04-24
|
|
71
|
+
### Improvements
|
|
72
|
+
- updated dependencies
|
|
73
|
+
|
|
74
|
+
### New feature
|
|
75
|
+
- [#49](https://github.com/raphiniert-com/ra-data-postgrest/issues/49), custom schema name can be used
|
|
76
|
+
|
|
77
|
+
## v2.0.0-alpha.1 - 2023-04-09
|
|
78
|
+
### Improvements
|
|
79
|
+
- updated dependencies
|
|
80
|
+
- updated `urlBuilder` and integrated URL encoding
|
|
81
|
+
|
|
82
|
+
### New feature
|
|
83
|
+
- [#48](https://github.com/raphiniert-com/ra-data-postgrest/issues/48) solved by pull request [#55](https://github.com/raphiniert-com/ra-data-postgrest/pull/55), the create method should return the data returned by postgrest and not the posted data - @[christiaanwesterbeek](https://github.com/christiaanwesterbeek)
|
|
84
|
+
- [#39](https://github.com/raphiniert-com/ra-data-postgrest/pull/39), allow passing extra headers via meta for react-admin hooks - @[christiaanwesterbeek](https://github.com/christiaanwesterbeek)
|
|
85
|
+
- [#41](https://github.com/raphiniert-com/ra-data-postgrest/pull/41), allow columns filtering for getList and getManyReference - @[christiaanwesterbeek](https://github.com/christiaanwesterbeek)
|
|
86
|
+
- added support of [#41](https://github.com/raphiniert-com/ra-data-postgrest/pull/41) for other functions, but `create` and `updateMany`
|
|
87
|
+
- [#38](https://github.com/raphiniert-com/ra-data-postgrest/pull/38), Let the sort param in getList be optional - @[christiaanwesterbeek](https://github.com/christiaanwesterbeek)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## v1.2.1 - 2023-04-07
|
|
91
|
+
- small fix in condition
|
|
92
|
+
- fixed package name
|
|
93
|
+
|
|
94
|
+
## v2.0.0-alpha.0 - 2022-11-23
|
|
95
|
+
|
|
96
|
+
- [#42](https://github.com/raphiniert-com/ra-data-postgrest/issues/42), started adding some unit tests - @[christiaanwesterbeek](https://github.com/christiaanwesterbeek)
|
|
97
|
+
- dropped authProvider
|
|
98
|
+
- code cleanup & restructuring
|
|
99
|
+
- minor bugfixes - @[christiaanwesterbeek](https://github.com/christiaanwesterbeek)
|
|
100
|
+
- added some notes to README.md
|
|
101
|
+
|
|
102
|
+
### Breaking changes
|
|
103
|
+
|
|
104
|
+
- dropped authProvider as this should rather be an own package in case of a generic piece of software or application specific.
|
|
105
|
+
|
|
106
|
+
## v1.2.0 - 2022-08-23
|
|
107
|
+
|
|
108
|
+
- [#33](https://github.com/raphiniert-com/ra-data-postgrest/pull/33), adding dependabot - @[promitheus7](https://github.com/promitheus7)
|
|
109
|
+
- [#30](https://github.com/raphiniert-com/ra-data-postgrest/pull/30) and [#33](https://github.com/raphiniert-com/ra-data-postgrest/pull/33), updated dependency to compatible starting from `ra-core` 4.1.x - @[corrideat](https://github.com/corrideat), @[promitheus7](https://github.com/promitheus7)
|
|
110
|
+
|
|
111
|
+
## v1.1.9 - 2022-08-23
|
|
112
|
+
|
|
113
|
+
- [#30](https://github.com/raphiniert-com/ra-data-postgrest/pull/30), updated ts and modified code, such that some package dependencies became unrequired - @[corrideat](https://github.com/corrideat)
|
|
114
|
+
|
|
115
|
+
## v1.1.8 - 2022-01-07
|
|
116
|
+
|
|
117
|
+
- required re-release as I missed to transpile all and upload the features of 1.1.7 to npm.
|
|
118
|
+
|
|
119
|
+
## v1.1.7 - 2022-01-07
|
|
120
|
+
|
|
121
|
+
### Fixes
|
|
122
|
+
|
|
123
|
+
- fixed bad behaivor with compound keys while using field named `id` [issue #27](https://github.com/raphiniert-com/ra-data-postgrest/issues/27) and [issue #19](https://github.com/raphiniert-com/ra-data-postgrest/pull/19) - @[kenfehling](https://github.com/kenfehling)
|
|
124
|
+
|
|
125
|
+
### New feature
|
|
126
|
+
|
|
127
|
+
- [#26](https://github.com/raphiniert-com/ra-data-postgrest/pull/26), added rpc filter support, which is explained [here](https://github.com/raphiniert-com/ra-data-postgrest#special-filter-feature-rpc-functions) - @[TheRealAstroboy](https://github.com/TheRealAstroboy)
|
|
128
|
+
|
|
129
|
+
## v1.1.6 - 2021-01-16
|
|
130
|
+
|
|
131
|
+
### Fixes
|
|
132
|
+
|
|
133
|
+
- [#24](https://github.com/raphiniert-com/ra-data-postgrest/pull/24), fixed eq. prefix for non-compound keys [issue #23](https://github.com/raphiniert-com/ra-data-postgrest/issues/23) - @[andymed-jlp](https://github.com/andymed-jlp)
|
|
134
|
+
|
|
135
|
+
## v1.1.5 - 2021-01-16
|
|
136
|
+
|
|
137
|
+
### Fixes
|
|
138
|
+
|
|
139
|
+
- fixed query string generation of rpc endpoints [issue #22](https://github.com/raphiniert-com/ra-data-postgrest/issues/22)
|
|
140
|
+
|
|
141
|
+
### Breaking changes
|
|
142
|
+
|
|
143
|
+
- Support was dropped for generating the query string given many ids in case of an rpc endpoint. If your application has some psql functions which parse the standard input, I recommend to rework your db design. If this change causes strong damage to your application, please contact me in order to find a proper generic solution. Query strings of single rpc calls now drop the operator (`eq.`) and are generated properly.
|
|
144
|
+
|
|
145
|
+
## v1.1.4 - 2021-01-16
|
|
146
|
+
|
|
147
|
+
- deployment error
|
|
148
|
+
|
|
149
|
+
## v1.1.3 - 2020-11-30
|
|
150
|
+
|
|
151
|
+
### Fixes
|
|
152
|
+
|
|
153
|
+
- [#20](https://github.com/raphiniert-com/ra-data-postgrest/pull/20), fixed small bug in update - @[mkkane](https://github.com/mkkane)
|
|
154
|
+
- removed console log
|
|
155
|
+
|
|
156
|
+
## v1.1.2 - 2020-10-05
|
|
157
|
+
|
|
158
|
+
### Fixes
|
|
159
|
+
|
|
160
|
+
- fixed the last fix of getMany and getManyReferecnce for compound keys :)
|
|
161
|
+
|
|
162
|
+
## v1.1.1 - 2020-09-28
|
|
163
|
+
|
|
164
|
+
### Fixes
|
|
165
|
+
|
|
166
|
+
- fixed getMany and getManyReferecnce for compound keys
|
|
167
|
+
|
|
168
|
+
## v1.1.0 - 2020-09-16
|
|
169
|
+
|
|
170
|
+
### Fixes
|
|
171
|
+
|
|
172
|
+
- removed requirement to define order key in react admin, when using compound keys: default was `id`, now it's the compound key
|
|
173
|
+
|
|
174
|
+
### Breaking changes
|
|
175
|
+
|
|
176
|
+
- refactored compound primary keys:
|
|
177
|
+
For single custom keys wrap an array as follows:
|
|
178
|
+
```jsx
|
|
179
|
+
const dataProvider = postgrestRestProvider(
|
|
180
|
+
API_URL,
|
|
181
|
+
fetchUtils.fetchJson,
|
|
182
|
+
'eq',
|
|
183
|
+
new Map([
|
|
184
|
+
['some_table', ['custom_id']], // <- instead of ['some_table','custom_id']
|
|
185
|
+
['another_table', ['first_column', 'second_column']],
|
|
186
|
+
])
|
|
187
|
+
);
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## v1.0.7 - 2020-08-23
|
|
191
|
+
|
|
192
|
+
### New feature
|
|
193
|
+
|
|
194
|
+
- [#14](https://github.com/raphiniert-com/ra-data-postgrest/pull/14), added compound primary keys (see [README.md](https://github.com/raphiniert-com/ra-data-postgrest/blob/master/README.md#compound-primary-keys)) - @[programmarchy](https://github.com/programmarchy)
|
|
195
|
+
|
|
196
|
+
### Maintenance
|
|
197
|
+
|
|
198
|
+
- `import React from 'react';` -> `import * as React from 'react';`
|
|
199
|
+
- Some minor code cleanup
|
|
200
|
+
|
|
201
|
+
## v1.0.6 - 2020-06-15
|
|
202
|
+
|
|
203
|
+
### Fixes
|
|
204
|
+
|
|
205
|
+
- Fixed wrong support statement concerning [postgrest starter kit](https://github.com/subzerocloud/postgrest-starter-kit) in readme
|
|
206
|
+
|
|
207
|
+
## v1.0.5 - 2020-06-15
|
|
208
|
+
|
|
209
|
+
### Fixes
|
|
210
|
+
|
|
211
|
+
- [#13](https://github.com/raphiniert-com/ra-data-postgrest/pull/13), Remove console.log - @[jpagex](https://github.com/jpagex)
|
|
212
|
+
- [#12](https://github.com/raphiniert-com/ra-data-postgrest/pull/12), Fixed limit parameter - @[jpagex](https://github.com/jpagex)
|
|
213
|
+
|
|
214
|
+
## v1.0.4 - 2020-06-08
|
|
215
|
+
|
|
216
|
+
### Fixes
|
|
217
|
+
|
|
218
|
+
- Fixed missing js files in npm package [#8](https://github.com/raphiniert-com/ra-data-postgrest/issues/8)
|
|
219
|
+
- [#9](https://github.com/raphiniert-com/ra-data-postgrest/pull/9), Fixed typo in readme - @[seclace](https://github.com/seclace)
|
|
220
|
+
|
|
221
|
+
## v1.0.3 - 2020-05-17
|
|
222
|
+
|
|
223
|
+
### Fixes
|
|
224
|
+
|
|
225
|
+
- Fixed bug when multidelete - @[colonist4096](https://github.com/colonist4096)
|
|
226
|
+
- [#5](https://github.com/raphiniert-com/ra-data-postgrest/pull/6), Fixed bug while using multiple filters on the same attribute - @[olivierdalang](https://github.com/olivierdalang)
|
|
227
|
+
|
|
228
|
+
## v1.0.2 - 2020-03-10
|
|
229
|
+
|
|
230
|
+
### Fixes
|
|
231
|
+
|
|
232
|
+
- [#4](https://github.com/raphiniert-com/ra-data-postgrest/pull/4), Fixed bug while using ReferenceField with UUID - @[xero88](https://github.com/xero88)
|
|
233
|
+
|
|
234
|
+
## v1.0.1 - 2020-02-01
|
|
235
|
+
|
|
236
|
+
- initial release
|