[英]How to specify a database schema name for Android Room database
Is it possible to specify a database schema name when using Room for Android applications?使用 Room for Android 应用程序时是否可以指定数据库架构名称?
I am trying to set some Sqlite PRAGMA values and want to ensure I am only affecting my applications local database and not any others such as the sqlite database associated with Android WorkerManager.我正在尝试设置一些 Sqlite PRAGMA 值,并希望确保我只影响我的应用程序本地数据库,而不影响任何其他数据库,例如与 Android WorkerManager 关联的 sqlite 数据库。
PRAGMA schema.auto_vacuum = 0 | NONE | 1 | FULL | 2 | INCREMENTAL;
By default the schema name is main ie the main database.默认情况下,模式名称是 main,即主数据库。 If not the default or main then the schema must be an ATTACH
ed database or temp (for a temporary database).如果不是 default 或 main,则模式必须是ATTACH
ed 数据库或 temp(对于临时数据库)。
PRAGMA Statements
根据PRAGMA Statements
If you aren't ATTACH
ing a database then there is no need for the schema.如果您不是ATTACH
数据库,则不需要架构。
ie PRAGMA is only relevant/affects the database or an ATTACH
ed database, if the schema is provided and is not main.即 PRAGMA 仅相关/影响数据库或ATTACH
ed 数据库,如果提供了模式并且不是主要的。 It will not affect other databases, so other databases will not be affected.它不会影响其他数据库,所以其他数据库不会受到影响。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.