public SQLite3Provider() { #if WINDOWS_PHONE IntPtr db; int rc; ISQLite3Provider me = this as ISQLite3Provider; rc = me.sqlite3_open(":memory:", out db); if (0 == rc) { string errmsg; rc = me.sqlite3_exec(db, string.Format("PRAGMA temp_store_directory = '{0}';", Windows.Storage.ApplicationData.Current.LocalFolder.Path), null, null, out errmsg); // ignore rc, I guess rc = me.sqlite3_exec(db, string.Format("PRAGMA data_store_directory = '{0}';", Windows.Storage.ApplicationData.Current.LocalFolder.Path), null, null, out errmsg); // ignore rc, I guess rc = me.sqlite3_close(db); // ignore rc, I guess } #elif NETFX_CORE IntPtr db; int rc; ISQLite3Provider me = this as ISQLite3Provider; rc = me.sqlite3_open(":memory:", out db); if (0 == rc) { string errmsg; rc = me.sqlite3_exec(db, string.Format("PRAGMA temp_store_directory = '{0}';", Windows.Storage.ApplicationData.Current.TemporaryFolder.Path), null, null, out errmsg); // ignore rc, I guess rc = me.sqlite3_exec(db, string.Format("PRAGMA data_store_directory = '{0}';", Windows.Storage.ApplicationData.Current.LocalFolder.Path), null, null, out errmsg); // ignore rc, I guess rc = me.sqlite3_close(db); // ignore rc, I guess } #endif }
static public int sqlite3_exec(sqlite3 db, string sql, delegate_exec callback, object user_data, out string errMsg) { return(_imp.sqlite3_exec(db.ptr, sql, callback, user_data, out errMsg)); }