Skip to content

spc

Main command for SQLPage content generation and management.

Terminal window
./spry.ts spc [options]
  • -p, --package - Emit SQL package to stdout
  • -d, --dialect <dialect> - SQL dialect for package generation (sqlite or postgres)
  • --fs <directory> - Materialize SQL files to directory
  • --destroy-first - Remove target directory before materialization
  • --watch - Watch for changes and rebuild automatically
  • --with-sqlpage - Start SQLPage server in watch mode
  • --sqlpage-bin <binary> - SQLPage binary path (default: sqlpage)
  • -c, --conf <path> - Write sqlpage.json configuration file
Terminal window
# Generate SQL package for SQLite
./spry.ts spc --package
# Generate SQL package for PostgreSQL
./spry.ts spc --package --dialect postgres
Terminal window
# Materialize files to directory
./spry.ts spc --fs dev-src.auto
# With config file generation
./spry.ts spc --fs dev-src.auto --conf sqlpage/sqlpage.json
# Clean build (remove existing files first)
./spry.ts spc --fs dev-src.auto --destroy-first
Terminal window
# Watch mode with auto-rebuild
./spry.ts spc --fs dev-src.auto --watch
# Watch mode with SQLPage server
./spry.ts spc --fs dev-src.auto --destroy-first --watch --with-sqlpage
# Custom SQLPage binary
./spry.ts spc --fs dev-src.auto --watch --with-sqlpage --sqlpage-bin /usr/local/bin/sqlpage
Terminal window
# Deploy to SQLite database
./spry.ts spc --package | sqlite3 app.db
# Deploy to PostgreSQL
./spry.ts spc --package --dialect postgres | psql $DATABASE_URL
# Deploy to remote PostgreSQL
./spry.ts spc --package --dialect postgres | psql postgresql://user:pass@host:5432/db

List all SQLPage file entries from Markdown sources.

Terminal window
./spry.ts spc ls [options]
  • -i, --pi - Show cell names and INFO lines
  • -I, --pi-attrs - Show cell names, INFO, and attributes
  • -t, --tree - Display as tree structure
Terminal window
# List all SQLPage files
./spry.ts spc ls
# Show as tree
./spry.ts spc ls --tree
# Show cell information
./spry.ts spc ls --pi

Output contents of SQLPage files matching glob patterns.

Terminal window
./spry.ts spc cat -g <glob> [options]
  • -g, --glob <pattern> - Path glob pattern(s) to match (required, repeatable)
Terminal window
# Show all SQL files
./spry.ts spc cat -g "*.sql"
# Show specific files
./spry.ts spc cat -g "index.sql" -g "admin/*.sql"