platform/shared/db/DBAdapter.h in rhodes-2.0.0.beta2 vs platform/shared/db/DBAdapter.h in rhodes-2.0.0.beta3
- old
+ new
@@ -25,10 +25,12 @@
class CDBAdapter
{
sqlite3* m_dbHandle;
String m_strDbPath, m_strDbVer, m_strDbVerPath;
+ String m_strDbPartition;
+
Hashtable<String,sqlite3_stmt*> m_mapStatements;
common::CRubyMutex m_mxRuby;
common::CMutex m_mxDB;
boolean m_bUIWaitDB;
int m_nTransactionCounter;
@@ -46,14 +48,16 @@
m_strRhoVer = strRhoVer;
m_strAppVer = strAppVer;
}
};
+ static const char* USER_PARTITION_NAME(){return "user";}
public:
DEFINE_LOGCLASS;
- CDBAdapter(void) : m_dbHandle(0), m_strDbPath(""), m_bUIWaitDB(false), m_nTransactionCounter(0){}
+ CDBAdapter(const char* szDBPartition) : m_dbHandle(0), m_strDbPath(""), m_strDbPartition(szDBPartition),
+ m_bUIWaitDB(false), m_nTransactionCounter(0) {}
~CDBAdapter(void){}
void open (String strDbPath, String strVer, boolean bTemp);
void close();
sqlite3* getDbHandle(){ return m_dbHandle; }
@@ -242,10 +246,10 @@
sqlite3_stmt* createInsertStatement(rho::db::CDBResult& res, const String& tableName, CDBAdapter& db, String& strInsert);
virtual DBResultPtr prepareStatement( const char* szSt );
boolean migrateDB(const CDBVersion& dbVer, const String& strRhoDBVer, const String& strAppDBVer);
-
+ void copyTable(String tableName, CDBAdapter& dbFrom, CDBAdapter& dbTo);
};
}
}