Skip to content

v0.97.0

Choose a tag to compare

@avallete avallete released this 01 May 15:51
· 59 commits to main since this release

Breaking Changes 🚨

  • .snaplet/config.json new "adapter" key: We changed the way we detect the adapter/dialect that you're using for generating your Seed Client for better integrations.
    The adapter is now persisted to .snaplet/config.json.

    You can run npx @snaplet/seed init again which should update your .snaplet/config.json file with the adapter you're using.

    If you want to do it manually, you can add the adapter key to your .snaplet/config.json file.

    {
      // possible values: "prisma" | "postgres" | "pg" | "better-sqlite3" | "mysql2"
      "adapter": "prisma"
    }
  • Deeper Prisma integration: When using Prisma adapter, we now parse your prisma.schema and automatically reflect your model and field names in the generated Seed Client.

    To apply this change, regenerate your Seed Client using npx @snaplet/seed sync.

  • Snaplet AI for better data: We've improved our AI workflow to provide the best data for your seeds. It also means that the data generated might be different from the previous versions.

New Features 🎉

  • MySQL support 🐬: We now support MySQL databases! You can use the mysql2 adapter to connect to your database.
  • Global connect strategy: You can now pass a connect option when creating the Seed Client to automatically connect all generated data to the global store.
    const seed = await createSeedClient({ connect: true })
    
    await seed.users(x => x(2))
    
    // all the posts will be connected to the previously created users in the seed.$store
    await seed.posts(x => x(2))

Improvements 🛠️

  • Optional login: Login is now optional, you can use @snaplet/seed without an account in Snaplet Cloud.