Seeds database test data with SQL scripts and Node scripts: sqlite3 import, PostgreSQL COPY/INSERT, fixtures, and repeatable seed flows.
Agentic Workflow: Read -> Reason -> Act (api-test-data-sqlite-seeding)
You are Api Test Data Sqlite Seeding (testing) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — testing context for api-test-data-sqlite-seeding
- Domain: Seeds database test data with SQL scripts and Node scripts: sqlite3 import, PostgreSQL COPY/INSERT, fixtures, and repeatable seed flows.
- sqlite-seeding: Seed SQLite databases for API tests —
sqlite3 test.db "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TE
- postgres-seeding: Seed PostgreSQL for integration tests —
psql -d app -f seed.sql
- Check
knowledge and prerequisites: faker, node.js, python
2. Reason — think for api-test-data-sqlite-seeding
- For
sqlite-seeding: Seed SQLite databases for API tests — decide which checks to run
- For
postgres-seeding: Seed PostgreSQL for integration tests — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-test-data-sqlite-seeding tools
- Tools:
Glob, Grep, Read, Sqlite3, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-test-data-sqlite-seeding:406d3af5
API Test Data v2 - Database Seeding
Database seeding for API tests.
What This Skill Does
- Seeds SQLite and PostgreSQL fixtures
- Resets state between tests
- Exports reusable seed scripts
When to Use
- Integration test databases
- CI ephemeral environments
- Reproducible local dev data
Real Commands
sqlite3 test.db "INSERT INTO users (name, email) VALUES ('alice', 'a@example.com')"
psql -d app -c "COPY users (name, email) FROM '/tmp/users.csv' WITH (FORMAT csv, HEADER true)"
psql -d app -c "TRUNCATE users RESTART IDENTITY"
Seeding Strategy
- Truncate with restart identity
- Insert fixtures in dependency order
- Re-verify with count queries
Testing
- Reset then seed in test setup hooks
- Verify foreign keys after truncation
- Time large seeds with COPY vs INSERT
Best Practices
- Keep seed scripts idempotent
- Version seeds with migrations
- Use CSV COPY for bulk rows
Capabilities
sqlite-seeding
Seed SQLite databases for API tests
Parameters:
db-file (string): SQLite database file
table (string): Target table
sql (string): SQL statement
Commands:
sqlite3 test.db "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)"
sqlite3 test.db "INSERT INTO users (name, email) VALUES ('alice', 'a@localhost'), ('bob', 'b@localhost')"
sqlite3 test.db "SELECT COUNT(*) FROM users"
node -e "const db=require('better-sqlite3')('test.db'); db.prepare('INSERT INTO users (name,email) VALUES (?,?)').run('carol','c@example.com'); console.log(db.prepare('SELECT COUNT(*) c FROM users').get())"
sqlite3 test.db ".dump" > seed.sql
Examples:
- sqlite3 multi-row INSERT seeds fixtures
- better-sqlite3 runs prepared statements
- .dump exports the full seed
postgres-seeding
Seed PostgreSQL for integration tests
Commands:
psql -d app -f seed.sql
psql -d app -c "COPY users (name, email) FROM '/tmp/users.csv' WITH (FORMAT csv, HEADER true)"
psql -d app -c "TRUNCATE users RESTART IDENTITY"
pg_dump --data-only -t users app > seed.sql
Examples:
References
1---2name: "api-test-data-sqlite-seeding"3description: "Seeds database test data with SQL scripts and Node scripts: sqlite3 import, PostgreSQL COPY/INSERT, fixtures, and repeatable seed flows. Use when working with sqlite seeding, postgres seeding or when the user mentions sqlite seeding, postgres seeding."4license: "MIT"5compatibility: "Requires faker, node.js, python, factory-boy, json-schema-faker."6metadata:7 source: https://skillmd.com/skills/opknock/api-test-data-sqlite-seeding8 author: Kdesk9 version: 2.0.010 category: testing11allowed-tools: "Glob Grep Read Bash(node:*) Bash(pg_dump:*) Bash(psql:*) Bash(sqlite3:*)"12---1314Seeds database test data with SQL scripts and Node scripts: sqlite3 import, PostgreSQL COPY/INSERT, fixtures, and repeatable seed flows.1516## Agentic Workflow: Read -> Reason -> Act (api-test-data-sqlite-seeding)1718You are **Api Test Data Sqlite Seeding** (testing) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — testing context for `api-test-data-sqlite-seeding`21- Domain: Seeds database test data with SQL scripts and Node scripts: sqlite3 import, PostgreSQL COPY/INSERT, fixtures, and repeatable seed flows.22- **sqlite-seeding**: Seed SQLite databases for API tests — `sqlite3 test.db "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TE`23- **postgres-seeding**: Seed PostgreSQL for integration tests — `psql -d app -f seed.sql`24- Check `knowledge` and `prerequisites: faker, node.js, python`2526### 2. Reason — think for `api-test-data-sqlite-seeding`27- For `sqlite-seeding`: Seed SQLite databases for API tests — decide which checks to run28- For `postgres-seeding`: Seed PostgreSQL for integration tests — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-test-data-sqlite-seeding` tools32- Tools: `Glob`, `Grep`, `Read`, `Sqlite3`, `Bash` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-test-data-sqlite-seeding:406d3af5`3536# API Test Data v2 - Database Seeding3738Database seeding for API tests.3940## What This Skill Does41- Seeds SQLite and PostgreSQL fixtures42- Resets state between tests43- Exports reusable seed scripts4445## When to Use46- Integration test databases47- CI ephemeral environments48- Reproducible local dev data4950## Real Commands5152```bash53sqlite3 test.db "INSERT INTO users (name, email) VALUES ('alice', 'a@example.com')"54psql -d app -c "COPY users (name, email) FROM '/tmp/users.csv' WITH (FORMAT csv, HEADER true)"55psql -d app -c "TRUNCATE users RESTART IDENTITY"56```5758## Seeding Strategy591. Truncate with restart identity602. Insert fixtures in dependency order613. Re-verify with count queries6263## Testing64- Reset then seed in test setup hooks65- Verify foreign keys after truncation66- Time large seeds with COPY vs INSERT676869## Best Practices70- Keep seed scripts idempotent71- Version seeds with migrations72- Use CSV COPY for bulk rows7374## Capabilities7576### sqlite-seeding77Seed SQLite databases for API tests7879**Parameters:**80- `db-file` (string): SQLite database file81- `table` (string): Target table82- `sql` (string): SQL statement8384**Commands:**85- `sqlite3 test.db "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)"`86- `sqlite3 test.db "INSERT INTO users (name, email) VALUES ('alice', 'a@localhost'), ('bob', 'b@localhost')"`87- `sqlite3 test.db "SELECT COUNT(*) FROM users"`88- `node -e "const db=require('better-sqlite3')('test.db'); db.prepare('INSERT INTO users (name,email) VALUES (?,?)').run('carol','c@example.com'); console.log(db.prepare('SELECT COUNT(*) c FROM users').get())"`89- `sqlite3 test.db ".dump" > seed.sql`9091**Examples:**92- sqlite3 multi-row INSERT seeds fixtures93- better-sqlite3 runs prepared statements94- .dump exports the full seed9596### postgres-seeding97Seed PostgreSQL for integration tests9899**Commands:**100- `psql -d app -f seed.sql`101- `psql -d app -c "COPY users (name, email) FROM '/tmp/users.csv' WITH (FORMAT csv, HEADER true)"`102- `psql -d app -c "TRUNCATE users RESTART IDENTITY"`103- `pg_dump --data-only -t users app > seed.sql`104105**Examples:**106- -cli --help107- -api --help108109## References110- [SQLite CLI Docs](https://www.sqlite.org/cli.html)111- [PostgreSQL COPY](https://www.postgresql.org/docs/current/sql-copy.html)