Skip to content

Commit 8cdb1f0

Browse files
committed
More release notes and information about property access
1 parent cb6bb27 commit 8cdb1f0

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

docs/developers/rest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This can be used to search for records by the specified property name and value.
3030

3131
### `GET /my-resource/<record-id>.property`
3232

33-
This can be used to retrieve the specified property of the specified record.
33+
This can be used to retrieve the specified property of the specified record. Note that this will only work for properties that are declared in the schema.
3434

3535
## PUT
3636

docs/technical-details/reference/blob.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,20 @@ export class MyEndpoint extends MyTable {
7575
}
7676
```
7777

78+
### Blob `size`
79+
80+
Blobs that are created from streams may not have the standard `size` property available, because the size may not be known while data is being streamed. Consequently, the `size` property may be undefined until the size is determined. You can listen for the `size` event to be notified when the size is available:
81+
```javascript
82+
let record = await MyTable.get('my-record');
83+
let blob = record.data;
84+
blob.size // will be available if it was saved with a known size
85+
let stream blob.stream(); // start streaming the data
86+
if (blob.size === undefined) {
87+
blob.on('size', (size) => {
88+
// will be called once the size is available
89+
})
90+
}
91+
92+
```
93+
7894
See the [configuration](../../deployments/configuration.md) documentation for more information on configuring where blob are stored.

docs/technical-details/reference/resource.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ This defines the source for a table. This allows a table to function as a cache
387387
388388
If the source resource implements subscription support, real-time invalidation can be performed to ensure the cache is guaranteed to be fresh (and this can eliminate or reduce the need for time-based expiration of data).
389389
390+
### `directURLMapping`
391+
This property can be set to force the direct URL request target to be mapped to the resource primary key. Normally, URL resource targets are parsed, where the path is mapped to the primary key of the resource (and decoded using standard URL decoding), and any query string parameters are used to query that resource. But if this is turned on, the full URL is used as the primary key. For example:
392+
```javascript
393+
export class MyTable extends tables.MyTable {
394+
static directURLMapping = true;
395+
}
396+
```
397+
```http request
398+
GET /MyTable/test?foo=bar
399+
```
400+
This will be mapped to the resource with a primary key of `test?foo=bar`, and no querying will be performed on that resource.
401+
390402
### `parsePath(path, context, query) {`
391403
392404
This is called by static methods when they are responding to a URL (from HTTP request, for example), and translates the path to an id. By default, this will parse `.property` suffixes for accessing properties and specifying preferred content type in the URL (and for older tables it will convert a multi-segment path to multipart an array id). However, in some situations you may wish to preserve the path directly as a string. You can override `parsePath` for simpler path to id preservation:

docs/technical-details/release-notes/4.tucker/4.5.0.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ The default port for replication has been changed from 9925 to 9933.
2222
Accessing record properties from resource instances should be accessible through standard property access syntax, regardless of whether the property was declared in a schema. Previously only properties declared in a schema were accessible through standard property access syntax. This change allows for more consistent and intuitive access to record properties, regardless of how they were defined. It is still recommended to declare properties in a schema for better performance and documentation.
2323

2424
### Cluster Status Information
25-
The [`cluster_status` operation](../../../developers/operations-api/clustering.md) now includes new statistics for replication, including the timestamps of last received transactions, sent transactions, and committed transactions.
25+
The [`cluster_status` operation](../../../developers/operations-api/clustering.md) now includes new statistics for replication, including the timestamps of last received transactions, sent transactions, and committed transactions.
26+
27+
### URL id.property handling
28+
The `id.property` syntax for accessing properties in URLs will only be applied to properties that are declared in a schema. This allows for URLs to generally include dots in paths without being interpreted as property access.
29+
30+
### HTTP/2
31+
HarperDB now supports HTTP/2 for all API endpoints.

0 commit comments

Comments
 (0)