static public int sqlite3_close(sqlite3 db) { int rc = _imp.sqlite3_close(db.ptr); db.set_already_disposed(); return(rc); }
static public int sqlite3_close(sqlite3 db) { int rc = _imp.sqlite3_close(db.ptr); db.done(); return(rc); }
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 void SetProvider(ISQLite3Provider imp) { int version = imp.sqlite3_libversion_number(); IntPtr db; int rc; rc = imp.sqlite3_open(":memory:", out db); if (rc != 0) { throw new Exception(); } rc = imp.sqlite3_close(db); if (rc != 0) { throw new Exception(); } _imp = imp; }
static public void SetProvider(ISQLite3Provider imp) { if (_frozen) { return; } int version = imp.sqlite3_libversion_number(); #if not // don't do this, because it ends up calling sqlite3_initialize IntPtr db; int rc; rc = imp.sqlite3_open(":memory:", out db); if (rc != 0) { throw new Exception(); } rc = imp.sqlite3_close(db); if (rc != 0) { throw new Exception(); } #endif _imp = imp; }