Description
When using it in preview, it seems the database is preserved between preview runs, not recreated anew. It clearly exists in memory (not on disk), and the context shows we are inside the preview.
This is evident because when the preview is run again, the console shows a unique constraint violation error on the table. In other words, the database already exists and contains the corresponding record.
SQLite error 19: UNIQUE constraint failed: examples.id - while executing `INSERT INTO "examples" ("id", "name") VALUES (?, ?)`
Checklist
Expected behavior
I expect that, similar to SwiftData, if we use an in-memory database, it will be recreated each time we run the preview.
Actual behavior
The database exists and is not recreated.
Reproducing project
SqliteDataPreview.zip
SQLiteData version information
1.6.1
Sharing version information
2.8.0
GRDB version information
7.10.0
Destination operating system
iOS 26
Xcode version information
Version 26.4
Swift Compiler version information
swift-driver version: 1.148.6 Apple Swift version 6.3 (swiftlang-6.3.0.123.5 clang-2100.0.123.102)
Target: arm64-apple-macosx26.0
Description
When using it in preview, it seems the database is preserved between preview runs, not recreated anew. It clearly exists in memory (not on disk), and the context shows we are inside the preview.
This is evident because when the preview is run again, the console shows a unique constraint violation error on the table. In other words, the database already exists and contains the corresponding record.
Checklist
mainbranch of this package.Expected behavior
I expect that, similar to SwiftData, if we use an in-memory database, it will be recreated each time we run the preview.
Actual behavior
The database exists and is not recreated.
Reproducing project
SqliteDataPreview.zip
SQLiteData version information
1.6.1
Sharing version information
2.8.0
GRDB version information
7.10.0
Destination operating system
iOS 26
Xcode version information
Version 26.4
Swift Compiler version information