How to drop the table with DBAccess iOS ORM -
we planning use dbaccess our ios app. couldn't figure out way drop table while app running.
our actual use case figure out when db got updated , drop or alter tables. dbaccess doesn't seems give version number db.
that question convoluted answer, here goes:
how can drop table dbaccess?
the short answer is, can't directly. explain little bit further, used remove tables not derived dbobject
class. caused outrage , hatred amongst our users found out, using dbaccess
existing databases or pre-populated files, of tables not used classes used subqueries , like. removed feature, seem @ least 50/50 split of opinion.
you can issue sql commands drop unused tables directly if wish, add category , fill boots, pass nil database name.
@interface dbaccess (execsql) +(void)executesql:(nsstring*)sql indatabase:(nsstring*)dbname; @end
however both points 1&2 kind of dealt next "feature". have revision system built dbaccess
enable migration , upgrades. has remained hidden, because quite laborious use , planning better , gui based editor use in future. 2 method calls can add objects follows:
+ (void)setrevision:(int)revision + (void)entityatrevision:(int)revision
your entity called on entityatrevision:
current revision of object, , can use executesql:
method make changes existing data. importantly, method called when new/renamed column has been added before original column removed existing data there ready. but, before exit method must call setrevision:
new revision number.
as say, has not been published because wanting develop far superior implementation (even if underlying model remains same) quite obvious weak spot framework.
hope helps, adrian
Comments
Post a Comment