1. Write in Markdown
Define your application logic, routes, and tasks in Spryfile.md
This guide will walk you through creating and deploying your first SQLPage application using Spry.
Follow these steps to generate SQLPage assets and start the development server:
Generate the SQLPage source files from your Spryfile.md:
./spry.ts spc --fs dev-src.auto --destroy-first --conf sqlpage/sqlpage.jsonRun Spry in watch mode for live reloading:
./spry.ts spc --fs dev-src.auto --destroy-first --conf sqlpage/sqlpage.json --watchDeploy SQLPage components to your SQLite database:
./spry.ts task deployLaunch the SQLPage server:
SQLPAGE_SITE_PREFIX="" sqlpageYour application will be available at http://localhost:8080
Configure your PostgreSQL connection string:
export DATABASE_URL="postgresql://user:password@localhost:5432/mydb"./spry.ts spc --fs dev-src.auto --destroy-first --conf sqlpage/sqlpage.json./spry.ts spc --fs dev-src.auto --destroy-first --conf sqlpage/sqlpage.json --watch./spry.ts task deploySQLPAGE_SITE_PREFIX="" sqlpageThe Spryfile.md is where you define your application. Here’s a simple example:
# My First Spry App
## Database Setup
```bash prepare-db --descr "Initialize database"sqlite3 app.db < schema.sql```
## Home Page
```sql index.sqlSELECT 'text' AS component, 'Welcome to Spry!' AS title, 'This is my first SQLPage app' AS contents;```1. Write in Markdown
Define your application logic, routes, and tasks in Spryfile.md
2. Generate Assets
Spry converts your Markdown into SQLPage-compatible files
3. Deploy
Run tasks and deploy your application to the database
4. Serve
SQLPage serves your application directly from the database