public static int sqlite3_open_v2(string filename, out DatabaseHandle ppDb, int flags, string zVfs)
        {
            var filenamePtr = MarshalEx.StringToHGlobalUTF8(filename);
            var zVfsPtr     = MarshalEx.StringToHGlobalUTF8(zVfs);

            try
            {
                return(sqlite3_open_v2(filenamePtr, out ppDb, flags, zVfsPtr));
            }
            finally
            {
                if (filenamePtr != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(filenamePtr);
                }
                if (zVfsPtr != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(zVfsPtr);
                }
            }
        }
 public static string sqlite3_errstr(int rc)
 {
     return(MarshalEx.PtrToStringUTF8(sqlite3_errstr_raw(rc)));
 }
 public static string sqlite3_libversion()
 {
     return(MarshalEx.PtrToStringUTF8(sqlite3_libversion_raw()));
 }
 public static string sqlite3_column_text(StatementHandle pStmt, int iCol)
 {
     return(MarshalEx.PtrToStringUTF8(sqlite3_column_text_raw(pStmt, iCol)));
 }
 public static string sqlite3_column_name(StatementHandle pStmt, int N)
 {
     return(MarshalEx.PtrToStringUTF8(sqlite3_column_name_raw(pStmt, N)));
 }
Example #6
0
 public void ThrowExceptionForRC_is_noop_when_ok()
 {
     MarshalEx.ThrowExceptionForRC(Constants.SQLITE_OK);
 }
Example #7
0
 public void PtrToStringUTF8_returns_null_when_zero()
 {
     Assert.Null(MarshalEx.PtrToStringUTF8(IntPtr.Zero));
 }
Example #8
0
 public void GetExceptionForRC_returns_null_when_ok()
 {
     Assert.Null(MarshalEx.GetExceptionForRC(Constants.SQLITE_OK));
 }