Skip to content

Seeding from dumped fixture fails on SQLite #1736

@askor

Description

@askor

Description

Trying to seed the database from a fixture that has been generated with cargo loco db seed --dump fails with SQLite database.

To Reproduce

  1. Generate a new project
  2. Select SQLite as DB Provider
  3. Run server
  4. Add a user with this curl command:
    curl -X POST http://localhost:5150/api/auth/register -H "Content-Type: application/json" -d '{"email":"jane.doe@example.com","password":"P@ssw0rd123!","name":"Jane Doe"}'
  5. Dump DB with cargo loco db seed --dump
  6. Reset DB with cargo loco db reset
  7. Apply seed with cargo loco db seed

Output:
cargo loco db seed
2026-01-31T19:34:29.441398Z WARN app: loco_rs::boot: seed: reset=false from=src/fixtures environment=development
Error: DB(Json("premature end of input"))

Expected Behavior

I expect the user to be in the database after seeding, but the seed fails with output: Error: DB(Json("premature end of input")).

Environment:

macOS 26.2
rustc 1.93.0 (254b59607 2026-01-19)

Additional Context

I found an issue that discussed the same error, where jondot concludes its because

The error itself follows from Sqlite requiring a Z to parse properly

Also this more recent comment after confirming the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions