{"id":18378,"library":"foxhound","title":"FoxHound","description":"FoxHound is a fluent query generation DSL for Node.js and the browser (v2.0.27). It generates dialect-specific SQL from a single chainable API, keeping application code database-agnostic while producing parameterized queries for MySQL, PostgreSQL, MSSQL, SQLite, and ALASQL. Key differentiators include schema-aware auto-management of identity columns, timestamps, soft-delete tracking, built-in Fable integration (logging, config, UUID generation), and multiple output dialects including human-readable English and REST URL endpoints. The library supports full CRUD, count, filtering, sorting, joins, pagination, and custom SQL overrides with automatic parameter binding. It is released under the MIT license and follows a configure-then-build pattern.","status":"active","version":"2.0.27","language":"javascript","source_language":"en","source_url":"https://github.com/stevenvelozo/foxhound","tags":["javascript","orm","dal","query"],"install":[{"cmd":"npm install foxhound","lang":"bash","label":"npm"},{"cmd":"yarn add foxhound","lang":"bash","label":"yarn"},{"cmd":"pnpm add foxhound","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for configuration, logging, and UUID generation. FoxHound operates as a Fable service.","package":"fable","optional":true}],"imports":[{"note":"CommonJS module; ESM import will fail unless a bundler is used.","wrong":"import libFoxHound from 'foxhound';","symbol":"libFoxHound","correct":"const libFoxHound = require('foxhound');"},{"note":"Instantiation requires a Fable instance; no direct constructor.","wrong":"new libFoxHound();","symbol":"new","correct":"libFoxHound.new(_Fable);"},{"note":"Build methods must be called after configuration; they generate query.body and query.parameters.","wrong":"","symbol":"buildReadQuery","correct":"tmpQuery.buildReadQuery();"}],"quickstart":{"code":"const libFable = require('fable');\nconst libFoxHound = require('foxhound');\n\nconst _Fable = new libFable({});\nconst tmpQuery = libFoxHound.new(_Fable);\n\ntmpQuery\n    .setScope('Books')\n    .setDataElements(['Title', 'Author', 'PublishedYear'])\n    .addFilter('Genre', 'Science Fiction')\n    .addSort({Column: 'PublishedYear', Direction: 'Descending'})\n    .setCap(25)\n    .setDialect('MySQL')\n    .buildReadQuery();\n\nconsole.log(tmpQuery.query.body);\n// => SELECT `Title`, `Author`, `PublishedYear` FROM `Books`\n//    WHERE `Books`.`Genre` = :Genre_w0 ORDER BY PublishedYear DESC LIMIT 25;\n\nconsole.log(tmpQuery.query.parameters);\n// => { Genre_w0: 'Science Fiction' }","lang":"javascript","description":"Create a query instance with a Fable object, chain configuration methods to build a SELECT query for MySQL, then log the SQL and parameters."},"warnings":[{"fix":"Always pass a configured Fable object to libFoxHound.new().","message":"Requires a Fable instance; cannot be instantiated directly.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Use .dialect('MySQL') instead of .setDialect('MySQL').","message":"The 'setDialect' method is deprecated in favor of 'dialect'.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Update any code that assumes fixed parameter names; use the parameters object returned.","message":"Query parameters are now named with a suffix (e.g., :Genre_w0) to avoid collisions across multiple filters.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use libFoxHound.new(_Fable) instead of new libFoxHound().","cause":"Attempting to instantiate FoxHound without a Fable instance.","error":"TypeError: libFoxHound is not a constructor"},{"fix":"Ensure all necessary methods (setScope, setDialect, etc.) are called before buildReadQuery().","cause":"Calling buildReadQuery() before complete configuration.","error":"Cannot read property 'query' of undefined"},{"fix":"Use one of: 'MySQL', 'PostgreSQL', 'MSSQL', 'SQLite', 'ALASQL', 'English', or 'MeadowEndpoints'.","cause":"Using an unsupported dialect string.","error":"Error: Dialect 'XYZ' not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}