Skip to content

Core 1830 Docs Migration: Custom Functions 1 of 2#6

Merged
kylebernhardy merged 38 commits into
CORE-1824from
CORE-1830
Nov 30, 2022
Merged

Core 1830 Docs Migration: Custom Functions 1 of 2#6
kylebernhardy merged 38 commits into
CORE-1824from
CORE-1830

Conversation

@terraHDB

Copy link
Copy Markdown
Contributor

This PR is 1 of 2 for Custom Functions and its subtopics.

Current state of CF docs: https://harperdb.io/docs/custom-functions/

Comment thread docs/custom-functions/define-routes.md
Comment thread docs/custom-functions/requirements-definitions.md Outdated
Comment thread docs/custom-functions/create-project.md Outdated
Comment thread docs/custom-functions/host-static.md Outdated
Comment thread docs/custom-functions/create-project.md Outdated
Comment thread docs/custom-functions/create-project.md Outdated
Comment thread docs/custom-functions/define-helpers.md Outdated
Comment thread docs/custom-functions/define-routes.md Outdated
Comment thread docs/custom-functions/index.md
Comment thread docs/custom-functions/requirements-definitions.md Outdated
Comment thread docs/custom-functions/requirements-definitions.md Outdated
Comment thread docs/custom-functions/define-helpers.md Outdated
Comment thread docs/custom-functions/define-helpers.md Outdated
terraHDB and others added 4 commits November 15, 2022 15:20
* 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
Comment thread docs/custom-functions/requirements-definitions.md Outdated
Comment thread docs/custom-functions/create-project.md Outdated
```


3. **create a project folder in your Custom Functions root directory**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this step do we also want to recommend having the user run the command npm init ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Comment thread docs/custom-functions/define-helpers.md Outdated

* 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.

@kylebernhardy kylebernhardy Nov 28, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Comment thread docs/custom-functions/define-routes.md Outdated

* [**Instance URL**]:[**Custom Functions Port**]/[**Project Name**]/[**Route URL**]

* The route below, within the **dogs** project, would be available at **http://localhost:9926/dogs**.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidCockerill do you think we should add a section this showing an actual configuration section in YAML?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think so. No need to send them chasing links.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@terraHDB let's add a section with example of the custom functions YAML section

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Comment thread docs/harperdb-studio/index.md Outdated
---
## 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change:
all database interactions are performed locally.

to
all database interactions are performed on the HarperDB instance the studio is connected to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️

Comment thread docs/security/basic-auth.md



**Built-In Roles**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔️ 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This role provides specific access for creation and deletion of schemas and tables.

@kylebernhardy kylebernhardy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@kylebernhardy
kylebernhardy merged commit 0ca0976 into CORE-1824 Nov 30, 2022
@dawsontoth
dawsontoth deleted the CORE-1830 branch July 17, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants