I have a room database configuration like below. [code]Room.databaseBuilder(context.applicationContext, AppDataBase::class.java, "wallet.db" ).setQueryCallback(QueryInterceptor(), executor = Executors.newSingleThreadScheduledExecutor() ).createFromAsset("attributes.db").build()[/code]
I want to add some default pre-populated categories into an attributes table. Because user can also add or edit the present pre-populated data.
attributes.db has below queries.
[code]CREATE TABLE IF NOT EXISTS [/code]attributes[code]([/code]id[code]INTEGER PRIMARY KEY AUTOINCREMENT,[/code]key[code]TEXT NOT NULL,[/code]value[code]TEXT NOT NULL,[/code]meta_data[code]TEXT DEFAULT '',[/code]isActive[code] INTEGER NOT NULL, PRIMARY KEY([/code]id`) );
INSERT INTO [code]attributes_in_detail[/code] ([code]key[/code], [code]value[/code], [code]isActive[/code]) VALUES ([code]essentials[/code], [code]Rent/mortgage[/code], 1); ` I am not able to see the attributes.db queries getting run. Please help me how can I archive this in android room database.