{"id":20847863,"url":"https://github.com/jamesvillarrubia/feathers-harperdb","last_synced_at":"2026-02-27T18:04:54.202Z","repository":{"id":39065251,"uuid":"437042633","full_name":"jamesvillarrubia/feathers-harperdb","owner":"jamesvillarrubia","description":"This library is a FeathersJS database adapter for HarperDB - a high-scale, LMDB \u0026 NodeJS database. It uses a combination of the raw HarperDB RESTful endpoints and KnexJS-translated queries through HarperDB's subset of supported SQL commands.","archived":false,"fork":false,"pushed_at":"2024-09-07T18:26:27.000Z","size":685,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-03T06:12:27.523Z","etag":null,"topics":["database","feathersjs","harperdb","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesvillarrubia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-10T16:24:35.000Z","updated_at":"2024-09-07T18:26:31.000Z","dependencies_parsed_at":"2024-05-01T01:28:11.743Z","dependency_job_id":"5badd230-d54d-4bfd-a71f-3af8e8679ebe","html_url":"https://github.com/jamesvillarrubia/feathers-harperdb","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":0.06666666666666665,"last_synced_commit":"001569dde13b29bf992bb1249f7a5f0ff5635572"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jamesvillarrubia/feathers-harperdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesvillarrubia%2Ffeathers-harperdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesvillarrubia%2Ffeathers-harperdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesvillarrubia%2Ffeathers-harperdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesvillarrubia%2Ffeathers-harperdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesvillarrubia","download_url":"https://codeload.github.com/jamesvillarrubia/feathers-harperdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesvillarrubia%2Ffeathers-harperdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29907350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T17:28:36.873Z","status":"ssl_error","status_checked_at":"2026-02-27T17:28:20.970Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","feathersjs","harperdb","javascript","nodejs"],"created_at":"2024-11-18T02:23:29.231Z","updated_at":"2026-02-27T18:04:54.173Z","avatar_url":"https://github.com/jamesvillarrubia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# feathers-harperdb\n                    \n[![NPM](https://img.shields.io/npm/l/feathers-harperdb)](https://github.com/jamesvillarrubia/feathers-harperdb/blob/main/LICENSE) [![npm](https://img.shields.io/npm/v/feathers-harperdb?label=latest)](https://www.npmjs.com/package/feathers-harperdb)\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jamesvillarrubia/feathers-harperdb/Node%20Lint%20\u0026%20Test?label=build%20%26%20lint)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/feathers-harperdb)\n\u003c!-- [![Download Status](https://img.shields.io/npm/dm/feathers-harperdb.svg)](https://www.npmjs.com/package/feathers-harperdb) --\u003e\n\nThis library is a FeathersJS database adapter for HarperDB - a high-scale, LMDB \u0026 NodeJS database. It uses a combination of the raw HarperDB RESTful endpoints and [KnexJS](http://knexjs.org/)-translated queries through HarperDB's subset of supported SQL commands.  It also uses [Harperive](https://www.npmjs.com/package/harperive) for authentication, promise management, and connectivity.  Harperive is exposed internally for developers wishing to build more complex queries in a HarperDB service.\n\n```bash\nnpm install --save feathers-harperdb\n```\n\n\u003e __Important:__ `feathers-harperdb` implements the [Feathers Common database adapter API](https://docs.feathersjs.com/api/databases/common.html) and [querying syntax](https://docs.feathersjs.com/api/databases/querying.html).\n\u003e \n\n## API\n\n### `service(options)`\n\n\n```js\nconst service = require('feathers-harperdb');\napp.use('/messages', service({\n    //...options\n}););\n```\n\n\n__Options:__\n- `name` (**required**) - The name of the table\n- `config` (**required**) - Usually set in `config/{ENV}.json`. See \"Connection Options\" below\n- `client` (*optional*) - The Harperive Client, can be manually overriden and accessed\n- `id` (*optional*, default: `id`) - The name of the id field property.\n- `events` (*optional*) - A list of [custom service events](https://docs.feathersjs.com/api/events.html#custom-events) sent by this service\n- `paginate` (*optional*) - A [pagination object](https://docs.feathersjs.com/api/databases/common.html#pagination) containing a `default` and `max` page size\n- `multi` (*optional*) - Allow `create` with arrays and `update` and `remove` with `id` `null` to change multiple items. Can be `true` for all methods or an array of allowed methods (e.g. `[ 'remove', 'create' ]`)\n- `whitelist` (*optional*) - A list of additional query parameters to allow (e..g `[ '$regex', '$geoNear' ]`). Default is the supported `operators`\n- `sortField` (*optional*, default: `__createdtime__`) - By default all objects will be sorted ASC by created timestamp, similar to sorting by Integer auto-incremented `id` in most feather SQL operations\n- `sortDirection` (*optional*, default: `asc`) - The default sort direction, can be one of `[ 'asc', 'desc' ]`\n- `limit` (*optional*, default: `5000`) - The max number of objects to return without pagination, will be overriden by pagination settings\n- `sync` (*optional*, default: `true` ) - Setting true will create schema and table on load as part of the `service.setup()` function run by FeathersJS\n- `force` (*optional*, default: `false`) , Settign true will delete the schema on setup, starting with fresh database with every boot, much like Sequelize's `forceSync`.\n\n\n__Connection Options:__\nThe connection options are passed in as a `config` object inside the options object (i.e. `harper({ config: { ...connection_options } })`)\n- `schema` (**required**) - The name of the schema (i.e. DB-equivalent) in the HarperDB instance\n- `harperHost` (**required**) - The location of the Harper Host\n- `username` (**required**) - The username to connect with\n- `password` (**required**) - The password to connect with\n- `table` (*optional*) - The name of the table referenced by the service, defaults to the configured `name`, but can be overriden by setting `config.table`\n\nThese can also be set via a \"harperdb\" configuration field in the Feathers `config/{ENV}.json`:\n```json\n  \"harperdb\":{\n    \"harperHost\": \"http://localhost:9925\",\n    \"username\": \"admin\",\n    \"password\": \"password\",\n    \"schema\": \"test\"\n  }\n```\n\n## Setting up Service\nTo set up your service, your service class.js and service.js files should look something like this:\n\n```javascript\n//books.class.js\nconst { Service } = require('feathers-harperdb');\nexports.Books = class Books extends Service{\n  constructor(options, app) {\n    super({\n      ...options,\n      name: 'books'\n    });\n  }\n};\n\n//books.service.js\nconst { Books } = require('./books.class');\nconst hooks = require('./books.hooks');\nmodule.exports = function (app) {\n  const options = {\n    paginate: app.get('paginate'),\n    config: {\n      ...app.get('harperdb'),\n      table: 'books'\n    }\n  };\n  app.use('/books', new Books(options, app));\n  const service = app.service('books');\n  service.hooks(hooks);\n};\n```\n\n\n## Querying\n\nIn addition to the [common querying mechanism](https://docs.feathersjs.com/api/databases/querying.html), this adapter also supports direct NoSQL submissions via the [Harperive client](https://chandan-24.github.io/Harperive/#/) like this:\n\n\n```javascript\nlet service = app.service('books')\nawait service.client.insert({\n  table: this.table,\n  records: [\n    {\n      user_id: 43,\n      username: 'simon_j',\n      first_name: 'James',\n      middle_name: 'J.',\n      last_name: 'Simon'\n    }\n  ]\n})\n.then((res) =\u003e console.log(res))\n.catch((err) =\u003e console.log(err));\n```\n\nYou can also use Harperive's generic execution option like so:\n```javascript\nconst options = {\n  operation: 'harperdb_operation',\n  //other fields...\n};\n\n// Promise\nlet service = app.service('books')\nawait service.client.executeOperation(options)\n  .then((res) =\u003e console.log(res))\n  .catch((err) =\u003e console.log(err));\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesvillarrubia%2Ffeathers-harperdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesvillarrubia%2Ffeathers-harperdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesvillarrubia%2Ffeathers-harperdb/lists"}