Report hasn't been filed before.
What version of drizzle-orm are you using?
0.38.4
What version of drizzle-kit are you using?
0.30.2
Other packages
No response
Describe the Bug
Hi all,
when using PRAGMA optimize in sqlite, it will create internal statistic tables that are used by the query planner. As an example, one of the tables is named sqlite_stat1 as documented in the linked manual section.
Undesired behavior: When using drizzle-kit push, it treats these tables as unknown and asks to delete them:
[✓] Pulling schema from database...
Warning Found data-loss statements:
· You're about to delete sqlite_stat1 table with 28 items
THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED
Do you still want to push changes?
Desired result: In my opinion, drizzle-kit should ignore all internal tables, views and other objects when analyzing the schema. As documented here, it is quite easy to identify internal objects: Their names will begin with "sqlite_" and it's not possible for user code to create schema objects with this prefix.
Report hasn't been filed before.
What version of
drizzle-ormare you using?0.38.4
What version of
drizzle-kitare you using?0.30.2
Other packages
No response
Describe the Bug
Hi all,
when using
PRAGMA optimizein sqlite, it will create internal statistic tables that are used by the query planner. As an example, one of the tables is namedsqlite_stat1as documented in the linked manual section.Undesired behavior: When using
drizzle-kit push, it treats these tables as unknown and asks to delete them:Desired result: In my opinion,
drizzle-kitshould ignore all internal tables, views and other objects when analyzing the schema. As documented here, it is quite easy to identify internal objects: Their names will begin with "sqlite_" and it's not possible for user code to create schema objects with this prefix.