stacks-query-builder

Build and execute fluent SQL queries in Stacks applications.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-query-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-query-builder
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-query-builder
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-query-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building and maintaining SQL queries across a Stacks app can be error-prone and repetitive; the query-builder abstracts common patterns to deliver a fluent API and reliable results.

Core Features & Use Cases

  • Fluent SQL construction with a clean API
  • Integration with bun-query-builder and Stacks core components
  • Supports SQLite, MySQL, and PostgreSQL for cross-database apps

Quick Start

Create a query for the 'users' table, apply a where filter for active users, and fetch the results.

Frequently Asked Questions about stacks-query-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build SQL queries using a fluent API in a Stacks application?

To build SQL queries using a fluent API in a Stacks application, use the stacks-query-builder to construct statements with clean method chaining, applying filters and fetching results reliably across SQLite, MySQL, and PostgreSQL.

Does the Stacks query builder support both MySQL and PostgreSQL?

Yes, the Stacks query builder supports MySQL and PostgreSQL, along with SQLite, allowing you to configure and execute cross-database queries seamlessly within your application's data access layers.

What is the best way to avoid repetitive SQL code when querying a Stacks database?

The best way to avoid repetitive SQL code when querying a Stacks database is using a fluent query builder to abstract common patterns, delivering reliable results and reducing errors through a clean API.

Can I use bun-query-builder to fetch filtered records from a users table?

Yes, you can use the bun-query-builder integration to create a query for a users table, apply where filters such as selecting active users, and directly fetch the filtered results.

How does the Stacks query builder integrate with core configuration and project paths?

The Stacks query builder integrates with core paths and configuration files, including the QB state directory, to enable reliable and reusable data access layers across your entire project.

Why should I use a fluent SQL query builder instead of raw SQL in Stacks?

You should use a fluent SQL query builder instead of raw SQL in Stacks to abstract error-prone query patterns, maintain a clean API, and ensure reliable cross-database execution for SQLite, MySQL, and PostgreSQL.