Core 1830 Docs Migration: Custom Functions 1 of 2#6
Conversation
* doc migration epic branch * 3/4 progress of security * finished configuration.md, began users and roles * users and roles migrated; still needs updates * updated user and roles operations * corrections to security docs * CORE-1825 Add/Update "install harpedb" subtopics (#1) * added mac, added/updated windows, added/updated node version requirements, and added offline docs * go requirements * docs adjustments * testing variable usage * testing variable usage * Update other.md Update installation for other operating systems. * added link to download * node version * exact replica download button * functional download link * deleted old link * node version Co-authored-by: Kris Zyp <kriszyp@gmail.com> * Core 1826 add/update harperdb studio topic and subtopics (#2) * added mac, added/updated windows, added/updated node version requirements, and added offline docs * 1/3 through studio subtopics * 2/3 through studio subtopics * 3/3 through studio subtopics * corrected harperdb operations api * removed icon descriptions and fixed typos * removed icon descriptions * primary key vs hash_attribute change * primary key vs hash attribute qualifier * minor change to example function Co-authored-by: Kris Zyp <kriszyp@gmail.com>
# Conflicts: # docs/harperdb-cloud/index.md # docs/harperdb-studio/index.md
| ``` | ||
|
|
||
|
|
||
| 3. **create a project folder in your Custom Functions root directory** |
There was a problem hiding this comment.
For this step do we also want to recommend having the user run the command npm init ?
|
|
||
| * To use your helpers, they must be exported from your helper file. Please use any standard export mechanisms available for your module system. We like ESM, ECMAScript Modules. Our example below exports using `module.exports`. | ||
|
|
||
| * To include the helper in your route file, you must import. With ESM, you'd use a `require` statement. |
There was a problem hiding this comment.
Can we change this sentence:
To include the helper in your route file, you must import.
To something like:
You must import the helper module into your file that needs access to the exported functions.
Can we also link to the section in define-routes.md that shows where we are requiring the custom validator?
|
|
||
| * [**Instance URL**]:[**Custom Functions Port**]/[**Project Name**]/[**Route URL**] | ||
|
|
||
| * The route below, within the **dogs** project, would be available at **http://localhost:9926/dogs**. |
There was a problem hiding this comment.
Depending on the name of the route file this URL may not be accurate. If the route file name is index.js I think the above URL would be correct. If it is say test.js the URL would be http://localhost:9926/dogs/test.js
| Before you get started with Custom Functions, here’s a primer on the basic configuration and the structure of a Custom Functions Project. | ||
|
|
||
| ## Configuration | ||
| Custom Functions is enabled by default. If you wish to manage Custom Functions directly, you will find the relevant configuration parameters in your [configuration file](https://harperdb.io/docs/reference/configuration-file/). The available settings are listed below: |
There was a problem hiding this comment.
@DavidCockerill do you think we should add a section this showing an actual configuration section in YAML?
There was a problem hiding this comment.
Yeah, I think so. No need to send them chasing links.
There was a problem hiding this comment.
@terraHDB let's add a section with example of the custom functions YAML section
| --- | ||
| ## How does Studio Work? | ||
| While HarperDB Studio is web based and hosted by us, all database interactions are performed locally. The HarperDB Studio loads in your browser, at which point you login to your HarperDB instances. Credentials are stored in your browser cache and are not transmitted back to HarperDB. All database interactions are made via the HarperDB REST API directly from your browser to your instance. | ||
| While HarperDB Studio is web based and hosted by us, all database interactions are performed locally. The HarperDB Studio loads in your browser, at which point you login to your HarperDB instances. Credentials are stored in your browser cache and are not transmitted back to HarperDB. All database interactions are made via the HarperDB Operations API directly from your browser to your instance. |
There was a problem hiding this comment.
Can we change:
all database interactions are performed locally.
to
all database interactions are performed on the HarperDB instance the studio is connected to.
|
|
||
|
|
||
|
|
||
| **Built-In Roles** |
There was a problem hiding this comment.
In 3.3.0 we added a new role type called structure_user. When defining this role type you can either assign a value of true which will allow the role to create and drop schemas & tables. Alternatively the role type can be assigned a string array. The values in this array are schemas and allows the role to only create and drop tables in the designated schemas.
There was a problem hiding this comment.
✔️ please let me know if that role's description is accurate
|
|
||
| * This role is an internally managed role to facilitate communication between clustered instances. | ||
|
|
||
| * `structure_user` - This role provides specific access for creation and deletion of data. |
There was a problem hiding this comment.
This role provides specific access for creation and deletion of schemas and tables.
This PR is 1 of 2 for Custom Functions and its subtopics.
Current state of CF docs: https://harperdb.io/docs/custom-functions/