Esempio n. 1
0
        /// <summary>
        /// Constructor when recreating change set from previously generated and persisted change set buffer
        /// </summary>
        /// <param name="persistedBuffer">persisted data returned from previous change set generation buffer</param>
        public SQLiteChangeSet(byte[] persistedBuffer)
        {
            this.size   = 0;
            this.buffer = new Sqlite3ChangesetBuffer(IntPtr.Zero);

            if (persistedBuffer.Length > 0)
            {
                IntPtr nativeBuffer = SQLiteMalloc(persistedBuffer.Length);
                // if malloc succeeded (not NULL) then copy managed data to sqlite's unmanaged memory buffer
                if (nativeBuffer != IntPtr.Zero)
                {
                    this.size = persistedBuffer.Length;
                    Marshal.Copy(persistedBuffer, 0, nativeBuffer, this.size);
                    this.buffer = new Sqlite3ChangesetBuffer(nativeBuffer);
                }
            }
        }
Esempio n. 2
0
 private static extern Result ChangeSetApply(Sqlite3DatabaseHandle db, int changeSetBufferSize, Sqlite3ChangesetBuffer changeSetBuffer,
                                             [MarshalAs(UnmanagedType.FunctionPtr)] FilterCallback xFilter,
                                             [MarshalAs(UnmanagedType.FunctionPtr)] ConflictCallback xConflict,
                                             IntPtr pCtx);
Esempio n. 3
0
 private static extern Result InvertChangeSet(int changeSetBufferSizeIn, Sqlite3ChangesetBuffer changeSetBufferIn,
                                              out int changeSetBufferSizeOut, out Sqlite3ChangesetBuffer changeSetBufferOut);
Esempio n. 4
0
 private static extern Result ChangeSetStart(out Sqlite3ChangesetIterator iter, int changeSetBufferSize, Sqlite3ChangesetBuffer changeSetBuffer);
Esempio n. 5
0
 private static extern Result GenerateChangeSet(IntPtr session, out int changeSetBufferSize, out Sqlite3ChangesetBuffer changeSetBuffer);
Esempio n. 6
0
 /// <summary>
 /// Constructor used via SQLite Session module when initially creating change set buffer
 /// </summary>
 /// <param name="size">count of bytes of buffer</param>
 /// <param name="buffer">data used by SQLite Session module to reconstruct tables based on generated change set</param>
 public SQLiteChangeSet(int size, Sqlite3ChangesetBuffer buffer)
 {
     this.size   = size;
     this.buffer = buffer;
 }