I think this is a simple question but I didnt find the answer in the FMDB git page. When you use the command:
[database executeUpdate:@"create table T_table(name text primary key, age int)"];
does FMDB or SQLite make some kind of verification to see if the table already exists?
Can I call this method in my class initializer without creating more than one table?
Sorry if stupid question.
Another solution is to change your query to:
create table if not exists test_table (test_no NUMBER, test_name TEXT);
or, you can check for the existence with:
select sql from SQLITE_MASTER where name = 'test_table'
And see if you get any results back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With