Commit 8874760
Support
* Support `attachMetadatabase` in previews
Previews can currently crash if an app database is provisioned that
attaches a metadatabase. Despite trying to ensure all databases are
in-memory to work around an Xcode previews quirk, SQLite still throws a
file system error when connecting to an in-memory database with a file
URL.
This PR attempts to work around the issue by sharing the same database
connection in previews.
This does require losing the internal `DatabaseMigrator` we currently
use for the metadatabase and instead depend on `IF NOT EXISTS` because
GRDB only supports a single set of migrations per database (we could
maybe scope this change just to previews), but this is probably OK. It
also means that the migrator will always detect schema changes for
previews since the metadatabase tables will conflict, but this is also
probably OK since previews are not long-living.
* Revert "Support `attachMetadatabase` in previews"
This reverts commit 1734711.
* wip
* wip
* wip
* wip
---------
Co-authored-by: Brandon Williams <mbrandonw@hey.com>attachMetadatabase in previews (#267)1 parent 6828f5f commit 8874760
2 files changed
Lines changed: 30 additions & 12 deletions
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
317 | 331 | | |
318 | 332 | | |
319 | 333 | | |
| |||
1917 | 1931 | | |
1918 | 1932 | | |
1919 | 1933 | | |
| 1934 | + | |
1920 | 1935 | | |
1921 | 1936 | | |
1922 | 1937 | | |
| |||
1927 | 1942 | | |
1928 | 1943 | | |
1929 | 1944 | | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
1933 | 1948 | | |
1934 | 1949 | | |
1935 | 1950 | | |
| |||
2022 | 2037 | | |
2023 | 2038 | | |
2024 | 2039 | | |
2025 | | - | |
| 2040 | + | |
2026 | 2041 | | |
2027 | 2042 | | |
2028 | 2043 | | |
2029 | 2044 | | |
2030 | | - | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
2031 | 2050 | | |
2032 | 2051 | | |
2033 | 2052 | | |
| |||
2044 | 2063 | | |
2045 | 2064 | | |
2046 | 2065 | | |
2047 | | - | |
2048 | 2066 | | |
2049 | 2067 | | |
2050 | 2068 | | |
| |||
0 commit comments