Generate SQL queries (stage 5 queries) from Waterline statements (stage 4 queries). Latest version 3.0.1. Released March 2023. Used internally by Sails/Waterline SQL adapters. Replaces Waterline-Sequel; not backwards compatible. Uses knex to compile SQL and supports PostgreSQL, MySQL, Oracle, MSSQL. Intended for adapter authors, not app-level code.
npm install waterline-sql-builderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a SQL builder instance for PostgreSQL and compiles a Waterline stage 4 query into a SQL template string with bindings.
Migrate from Waterline-Sequel to waterline-sql-builder; see migration guide in Waterline adapter interface docs.
Use Sails's model methods (e.g., User.find()) for app-level queries instead of waterline-sql-builder directly.
Consider using 'mssql' only if necessary; test thoroughly.
Validate your stage 4 query structure against Waterline's architecture docs before passing it to compile.
Run 'npm install waterline-sql-builder --save'
Use 'const SQLBuilder = require('waterline-sql-builder');' instead of import.Use one of the supported dialects: 'postgresql', 'postgres', 'mysql', 'oracle', 'mssql', or 'sqlite3'.