Execute a SQL statement
Hello, I dont know if this is really an issue, but Im interested if is it possible with DB flow to execute SQL statements? I have a exported database in a text file that I want to create a db from it in android?
Here is the example statements that I need to implement:
BEGIN TRANSACTION;
CREATE TABLE android_metadata (locale TEXT);
INSERT INTO android_metadata VALUES ('en_US');
CREATE TABLE Plan(bill_total REAL, calculationAmount REAL, consumer_id TEXT, contract_end TEXT, data_level_gb TEXT, data_level_id INTEGER, days_to_switch INTEGER, direct_from_operator INTEGER, flow TEXT, pid_ INTEGER, plan_id TEXT, network_generation_ TEXT, one_offs TEXT, partner_plan_id TEXT, payment_level TEXT, payment_level_id INTEGER, retailer_name TEXT, roaming_amount REAL, savings_amount REAL, savings_avg REAL, savings_percents INTEGER, operator_id INTEGER, PRIMARY KEY(pid_));
INSERT INTO Plan VALUES (0.0,0.0,'55f2bd632d69874748225814','Your contract ends in 91 days','1',2,91,0,'55f2bd565e06285a09750d90',0,'55f2bd653dc7412168a2afcb','3G',NULL,NULL,'No upfront',3,'Virgin',0.0,-276.0,30.0,-329,12);
You could use raw queries: https://github.com/Raizlabs/DBFlow/blob/master/usage/SQLQuery.md
I'd recommend you use the transaction manager and @Table extended from BaseModel thought.
Maybe the issue would be "The ability to import .db files" which is duplicated: https://github.com/Raizlabs/DBFlow/issues/386
related to #415
@arturonaredo The SQLQuery link doesn't work.
Can you provide the correct link please?
@arturonaredo your introduced link is not available