{"id":42642,"library":"dogwater","title":"Dogwater","description":"A hapi plugin integrating Waterline ORM, currently at v2.3.0. It allows defining models, adapters, and connections for Waterline within a hapi server, and provides convenience methods like `server.dogwater()`, `server.collections()`, and `request.collections()` to access Waterline collections. Supports multi-plugin deployments with collision protection. Works with hapi >=10 <17 and waterline >=0.10.0 <0.13.0. Last updated in 2019; no major releases since v2. Alternative to using Waterline standalone with hapi.","status":"maintenance","version":"2.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/devinivy/dogwater","tags":["javascript","hapi","plugin","waterline","database","orm"],"install":[{"cmd":"npm install dogwater","lang":"bash","label":"npm"},{"cmd":"yarn add dogwater","lang":"bash","label":"yarn"},{"cmd":"pnpm add dogwater","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: hapi framework required >=10 <17","package":"hapi","optional":false},{"reason":"peer dependency: Waterline ORM required >=0.10.0 <0.13.0","package":"waterline","optional":false}],"imports":[{"note":"Package is CJS-only; ESM import will fail. Use require.","wrong":"import Dogwater from 'dogwater'","symbol":"Dogwater","correct":"const Dogwater = require('dogwater')"},{"note":"Accepts a single config object, not separate arguments.","wrong":"server.dogwater('model', {})","symbol":"server.dogwater()","correct":"server.dogwater({ identity: 'model', connection: 'conn', attributes: {} })"},{"note":"request.collections() is a method that returns an object. Call it each time.","wrong":"const Model = request.collections().modelname","symbol":"request.collections()","correct":"const Cols = request.collections(); const Model = Cols.modelname"},{"note":"server.collections is a function; must be invoked.","wrong":"server.collections.modelname","symbol":"server.collections()","correct":"const Cols = server.collections(); const Model = Cols.modelname"}],"quickstart":{"code":"const Hapi = require('hapi');\nconst Dogwater = require('dogwater');\nconst Memory = require('sails-memory');\n\nconst server = new Hapi.Server();\nserver.connection({ port: 3000 });\n\nserver.route({\n    method: 'get',\n    path: '/dogs/{id}',\n    handler: function (request, reply) {\n        const Dogs = request.collections().dogs;\n        reply(Dogs.findOne(request.params.id));\n    }\n});\n\nserver.register({\n    register: Dogwater,\n    options: {\n        adapters: { memory: Memory },\n        connections: { simple: { adapter: 'memory' } }\n    }\n}, (err) => {\n    if (err) throw err;\n    server.dogwater({\n        identity: 'dogs',\n        connection: 'simple',\n        attributes: { name: 'string' }\n    });\n    server.start((err) => {\n        if (err) throw err;\n        const Dogs = server.collections().dogs;\n        Dogs.create([\n            { name: 'Guinness' },\n            { name: 'Sully' },\n            { name: 'Ren' }\n        ]).then(() => {\n            console.log(`Go find some dogs at ${server.info.uri}`);\n        }).catch((err) => console.error(err));\n    });\n});","lang":"javascript","description":"Shows full hapi server setup with Dogwater, including model definition, route using request.collections(), and startup with data creation."},"warnings":[{"fix":"Upgrade to hapi 10+ and waterline 0.10+. Use server.dogwater() to register models after registration.","message":"Dogwater v2.0.0 dropped support for hapi <10 and waterline <0.10. Removed server.dogwater() model registration from options; models must be registered via the server.dogwater() method.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Consider migrating to a different ORM or using Waterline standalone with hapi.","message":"Package is in maintenance mode. The peer dependency range for waterline (>=0.10.0 <0.13.0) is outdated; Waterline is no longer actively maintained and newer versions may not be compatible.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Ensure each model has a unique identity string (lowercase, typically plural).","message":"model definitions must have an `identity` property. Duplicate identities across plugins will cause registration to fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Register all adapters in the `adapters` option when registering Dogwater on the root server.","message":"Dogwater requires a connection configuration with a valid adapter. Using an adapter name that was not registered via `adapters` option will throw a runtime error.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'0.10.0':52 '0.13.0':53 '10':48 '17':49 '2019':57 'access':34 'adapt':15 'allow':12 'altern':63 'collect':36 'collis':43 'connect':17 'conveni':26 'current':8 'databas':74 'defin':13 'deploy':41 'dogwat':1 'hapi':3,22,47,69,71 'integr':5 'javascript':70 'last':54 'like':28 'major':59 'method':27 'model':14 'multi':39 'multi-plugin':38 'orm':7,75 'plugin':4,40,72 'protect':44 'provid':25 'releas':60 'request.collections':32 'server':23 'server.collections':30 'server.dogwater':29 'sinc':61 'standalon':67 'support':37 'updat':55 'use':65 'v2':62 'v2.3.0':10 'waterlin':6,19,35,51,66,73 'within':20 'work':45","created_at":"2026-06-05T16:55:58.183570+00:00","updated_at":"2026-06-05T16:55:58.183570+00:00","problems":[{"fix":"Add `identity: 'mymodel'` to the model config object passed to server.dogwater().","cause":"Model definition missing `identity` property.","error":"AssertionError [ERR_ASSERTION]: Model must have an identity"},{"fix":"Include the adapter in the `adapters` option when registering Dogwater: `adapters: { xyz: require('sails-xyz') }`","cause":"Adapter name used in connection configuration but not registered in `adapters` option.","error":"Error: Adapter 'xyz' is not defined"},{"fix":"Ensure Dogwater is registered in the plugin or at the server level, and that the plugin exposes `request.collections`.","cause":"Calling request.collections() on a request that hasn't been decorated by Dogwater (e.g., in a plugin that doesn't have Dogwater registered).","error":"TypeError: request.collections is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/devinivy/dogwater#readme","github":"https://github.com/devinivy/dogwater","docs":null,"changelog":null,"pypi":null,"npm":"dogwater","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}