Skip to content

Commit 7d344c7

Browse files
committed
More documentation updates
1 parent c32f4cb commit 7d344c7

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

docs/technical-details/reference/globals.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,9 @@ This records the provided value as a metric into Harper's analytics. Harper effi
255255
* `path` - This is an optional path (like a URL path). For a URL like /my-resource/, you would typically include a path of "my-resource", not including the id so you can group by all the requests to "my-resource" instead of individually aggregating by each individual id.
256256
* `method` - Optional method to group by.
257257
* `type` - Optional type to group by.
258+
259+
### `server.getUser(username): Promise<User>`
260+
This returns the user object with permissions/authorization information based on the provided username. This does not verify the password, so it is generally used for looking up users by username. If you want to verify a user by password, use [`server.authenticateUser`](globals.md#serverauthenticateuserusername-password-user).
261+
262+
### `server.authenticateUser(username, password): Promise<User>`
263+
This returns the user object with permissions/authorization information based on the provided username. The password will be verified before returning the user object (if the password is incorrect, an error will be thrown).

docs/technical-details/reference/resource.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ GET /MyTable/test?foo=bar
413413
```
414414
This will be mapped to the resource with a primary key of `test?foo=bar`, and no querying will be performed on that resource.
415415
416+
### `getRecordCount({ exactCount: boolean })`
417+
This will return the number of records in the table. By default, this will return an approximate count of records, which is fast and efficient. If you want an exact count, you can pass `{ exactCount: true }` as the first argument, but this will be slower and more expensive. The return value will be a Promise that resolves to an object with a `recordCount` property, which is the number of records in the table. If this was not an exact count, it will also include `estimatedRange` array with estimate range of the count.
418+
419+
```javascript
420+
416421
### `parsePath(path, context, query) {`
417422

418423
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:
@@ -423,6 +428,8 @@ This is called by static methods when they are responding to a URL (from HTTP re
423428
}
424429
```
425430

431+
### getRecordCount: Promise<{}
432+
426433
### `isCollection(resource: Resource): boolean`
427434

428435
This returns a boolean indicating if the provide resource instance represents a collection (can return a query result) or a single record/entity.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ There is a [new `loadEnv` component loader](../../../developers/components/built
4141
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.
4242

4343
### Improved URL path parsing
44-
Resources can be defined with nested paths and directly accessed by the exact path without requiring a trailing slash. 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. A new `directURL` option/flag on resources allows for more direct URL path handling as well.
44+
Resources can be defined with nested paths and directly accessed by the exact path without requiring a trailing slash. 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. A new [`directURLMapping` option/flag](../../../deployments/configuration.md) on resources that allows for more direct URL path handling as well.
4545

4646
### `server.authenticateUser` API
4747
In addition to the `server.getUser` API that allows for retrieval of users by username, the `server.authenticateUser` API is now available which will _always_ verify the user by the provided password.
@@ -62,4 +62,7 @@ By default, transactions can now be reused after calling `transaction.commit()`.
6262
The GraphQL query endpoint can be configured to listen on different ports. GraphQL query endpoing is now also disabled by default, to avoid any conflicts.
6363

6464
### Glob support for components
65-
Glob file handling for specifying files used by components has been improved for better consistency.
65+
Glob file handling for specifying files used by components has been improved for better consistency.
66+
67+
### Table.getRecordCount
68+
`Table.getRecordCount()` is now available to get the number of records in a table.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
HarperDB version 4 ([Tucker release](tucker.md)) represents major step forward in database technology. This release line has ground-breaking architectural advancements including:
44

5+
## [4.5](4.5.0.md)
6+
* Blob Storage - 4.5 introduces a new [Blob storage system](../../reference/blob.md).
7+
* Password Hashing Upgrade - two new password hashing algorithms for better security (to replace md5).
8+
* New resource and storage Analytics
9+
510
## [4.4](4.4.0.md)
611

712
* Native replication (codename "Plexus") which is faster, more efficient, secure, and reliable than the previous replication system and provides provisional sharding capabilities with a foundation for the future

0 commit comments

Comments
 (0)