Documentation
Documentation

Technical reference

Data and images

Understand project databases, safe query conventions, and generated image files.

Project database provisioning

When persistent data is required, the agent can provision a project-specific Cloudflare D1 database. D1 is SQLite-compatible. Database access is proxied through the ion7 router, with the required runtime configuration injected at deployment.

Provisioning must succeed before the app uses its database helpers. Do not replace this with a local SQLite file in the container. Ask for an explicit schema and ownership rules when your app stores user-specific information.

Parameterized queries

Use bound parameters for values instead of concatenating submitted input into SQL. PHP starters provide db_query and db_exec through db.php; FPC starters provide DbQuery and DbExec through Db.

PHP · after database provisioning
require_once __DIR__ . '/db.php';
$rows = db_query(
    'SELECT * FROM notes WHERE id > ?',
    [10]
);

Create schemas deliberately, using idempotent initialization where appropriate. A restore point saves source, not a copy of your database. Consider data compatibility when changing or restoring queries.

Generated images in project files

Ask the agent for images with a clear subject, visual style, and intended placement. Generated images are saved as project files; the file viewer can display them. Image generation has a separate credit charge.

Image bytes are stored separately from text source and associated with their project by a file pointer. Deployed applications resolve the project's asset map to serve those bytes. For a public/images/example.png file, the served path is /images/example.png.

HTML · illustrative image reference
<img
  src="/images/example.png"
  alt="Describe the actual image"
  width="800"
  height="600"
>

Lifecycle and export boundaries

  • Source history preserves binary pointers for restoration, not copies of the image bytes in each version.
  • GitHub push resolves the binary files before sending them to the repository.
  • History ZIP downloads currently substitute text notices for binary assets.
  • Project deletion removes its source, commits, and chat history, and attempts cleanup of its project database.