bknd-database-provision
Use when setting up a production database for Bknd. Covers SQLite file, LibSQL/Turso, Cloudflare D1, PostgreSQL, Neon, Supabase, and Xata configuration.
What this skill does
# Provision Production Database
Set up and configure a production database for your Bknd application.
## Prerequisites
- Bknd application with schema defined
- Account on chosen database provider (for cloud databases)
- Environment for storing connection credentials
## When to Use UI Mode
- Creating databases via provider dashboards (Turso, Neon, Cloudflare, Supabase)
- Managing database settings and access tokens
- Viewing database metrics and logs
## When to Use Code Mode
- Configuring database connection in Bknd
- CLI commands for database creation
- Schema sync and migrations
## Database Selection Guide
| Database | Best For | Platform Compatibility | Cost |
|----------|----------|------------------------|------|
| **SQLite File** | VPS, Docker, single-server | Node.js, Bun | Free |
| **LibSQL/Turso** | Serverless, edge, global | All platforms | Free tier |
| **Cloudflare D1** | Cloudflare Workers | Cloudflare only | Free tier |
| **PostgreSQL** | Complex queries, transactions | VPS, Docker | Self-hosted |
| **Neon** | Serverless Postgres | Vercel, Lambda | Free tier |
| **Supabase** | Postgres + extras | Any | Free tier |
| **Xata** | Serverless + search | Any | Free tier |
---
## SQLite File (VPS/Docker)
**Best for:** Single-server deployments with full control
### Step 1: Configure Connection
```typescript
// bknd.config.ts
export default {
app: (env) => ({
connection: {
url: env.DB_URL ?? "file:data.db", // Relative to cwd
},
}),
};
```
### Step 2: Set Environment Variable
```bash
# Relative path (project directory)
DB_URL=file:data.db
# Absolute path (recommended for production)
DB_URL=file:/var/data/myapp/bknd.db
```
### Step 3: Ensure Directory Exists
```bash
mkdir -p /var/data/myapp
```
### Docker Volume
```yaml
# docker-compose.yml
services:
bknd:
volumes:
- bknd-data:/app/data
environment:
- DB_URL=file:/app/data/bknd.db
volumes:
bknd-data:
```
---
## LibSQL / Turso
**Best for:** Serverless, edge deployments, global distribution
### Step 1: Install Turso CLI
```bash
# macOS/Linux
curl -sSfL https://get.tur.so/install.sh | bash
# Authenticate
turso auth login
```
### Step 2: Create Database
```bash
# Create database
turso db create my-bknd-db
# Optional: Specify region
turso db create my-bknd-db --location lax # Los Angeles
```
### Step 3: Get Connection Details
```bash
# Get connection URL
turso db show my-bknd-db --url
# Output: libsql://my-bknd-db-username.turso.io
# Create auth token
turso db tokens create my-bknd-db
# Output: eyJhbGciOi...
```
### Step 4: Configure Bknd
```typescript
// bknd.config.ts
export default {
app: (env) => ({
connection: {
url: env.DB_URL, // libsql://...
authToken: env.DB_TOKEN,
},
}),
};
```
### Step 5: Set Environment Variables
```bash
DB_URL=libsql://my-bknd-db-username.turso.io
DB_TOKEN=eyJhbGciOi...
```
### Turso Locations
Common regions: `ams` (Amsterdam), `fra` (Frankfurt), `lax` (LA), `lhr` (London), `nrt` (Tokyo), `syd` (Sydney)
```bash
turso db locations # List all regions
```
---
## Cloudflare D1
**Best for:** Cloudflare Workers deployments
### Step 1: Create D1 Database
```bash
wrangler d1 create my-bknd-db
```
Output:
```
Created D1 database 'my-bknd-db'
database_name = "my-bknd-db"
database_id = "abc123-def456-..."
```
### Step 2: Configure wrangler.toml
```toml
name = "my-bknd-app"
main = "src/index.ts"
compatibility_date = "2024-01-01"
[[d1_databases]]
binding = "DB"
database_name = "my-bknd-db"
database_id = "abc123-def456-..."
```
### Step 3: Configure Bknd Adapter
```typescript
// src/index.ts
import { hybrid, type CloudflareBkndConfig } from "bknd/adapter/cloudflare";
import { d1Sqlite } from "bknd/adapter/cloudflare";
export default hybrid<CloudflareBkndConfig>({
app: (env) => ({
connection: d1Sqlite({ binding: env.DB }),
isProduction: true,
}),
});
```
### D1 CLI Commands
```bash
# List databases
wrangler d1 list
# Execute SQL (local dev)
wrangler d1 execute my-bknd-db --local --command "SELECT * FROM posts"
# Execute SQL (production)
wrangler d1 execute my-bknd-db --command "SELECT * FROM posts"
# Export backup
wrangler d1 backup create my-bknd-db
```
---
## PostgreSQL (Self-Hosted)
**Best for:** Complex queries, large datasets, existing Postgres infrastructure
### Step 1: Install Adapter
```bash
npm install postgres
# or
npm install pg
```
### Step 2: Configure Connection
**Using `postgres` (recommended):**
```typescript
import { PostgresJsConnection } from "bknd/adapter/postgres";
export default {
app: (env) => ({
connection: new PostgresJsConnection({
connectionString: env.DATABASE_URL,
}),
}),
};
```
**Using `pg`:**
```typescript
import { PgPostgresConnection } from "bknd/adapter/postgres";
export default {
app: (env) => ({
connection: new PgPostgresConnection({
connectionString: env.DATABASE_URL,
}),
}),
};
```
### Step 3: Set Connection String
```bash
DATABASE_URL=postgresql://user:password@host:5432/database?sslmode=require
```
---
## Neon (Serverless Postgres)
**Best for:** Vercel, serverless, auto-scaling Postgres
### Step 1: Create Project at neon.tech
1. Sign up at [neon.tech](https://neon.tech)
2. Create new project
3. Copy connection string from dashboard
### Step 2: Install Neon Dialect
```bash
npm install kysely-neon
```
### Step 3: Configure Connection
```typescript
import { createCustomPostgresConnection } from "bknd";
import { NeonDialect } from "kysely-neon";
const neon = createCustomPostgresConnection("neon", NeonDialect);
export default {
app: (env) => ({
connection: neon({
connectionString: env.NEON_DATABASE_URL,
}),
}),
};
```
### Step 4: Set Environment Variable
```bash
NEON_DATABASE_URL=postgres://user:[email protected]/neondb?sslmode=require
```
---
## Supabase
**Best for:** Full-featured Postgres with extras (auth, storage, realtime)
### Step 1: Create Project at supabase.com
1. Sign up at [supabase.com](https://supabase.com)
2. Create new project
3. Go to Settings > Database > Connection string
### Step 2: Get Direct Connection String
Use "Direct connection" (not pooler) for Bknd:
```
postgresql://postgres:[PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres
```
### Step 3: Configure Connection
```typescript
export default {
app: (env) => ({
connection: {
url: env.SUPABASE_DB_URL,
},
}),
};
```
### Step 4: Set Environment Variable
```bash
SUPABASE_DB_URL=postgresql://postgres:[email protected]:5432/postgres
```
---
## Xata
**Best for:** Serverless Postgres with built-in search
### Step 1: Create Database at xata.io
1. Sign up at [xata.io](https://xata.io)
2. Create workspace and database
### Step 2: Install Xata Dialect
```bash
npm install @xata.io/kysely
```
### Step 3: Configure Connection
```typescript
import { createCustomPostgresConnection } from "bknd";
import { XataDialect } from "@xata.io/kysely";
const xata = createCustomPostgresConnection("xata", XataDialect);
export default {
app: (env) => ({
connection: xata({
apiKey: env.XATA_API_KEY,
workspace: "your-workspace",
database: "your-database",
}),
}),
};
```
---
## Schema Sync
After configuring your database, Bknd auto-syncs schema on first request. For manual control:
```bash
# Dry run (preview changes)
npx bknd sync --dry-run
# Apply changes
npx bknd sync
# Force sync (use with caution)
npx bknd sync --force
```
---
## Connection Testing
### Verify Connection
```typescript
// test-connection.ts
import { app } from "bknd";
const bknd = app({
connection: {
url: process.env.DB_URL!,
authToken: process.env.DB_TOKEN,
},
});
async function test() {
await bknd.build();
console.log("Connection successful!");
console.log("Entities:", Object.keys(bknd.modules.data.entities));
process.exit(0);
}
test().catch((e) => {
console.error("ConnRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.