Пример #1
0
        public void EnsureIndex(EJDB2Handle handle, string collection, string path, ejdb_idx_mode_t mode)
        {
            if (handle.IsInvalid)
            {
                throw new ArgumentException("Invalid DB handle.");
            }

            if (handle.IsClosed)
            {
                throw new ArgumentException("DB handle is closed.");
            }

            if (collection == null)
            {
                throw new ArgumentNullException(nameof(collection));
            }

            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            ulong rc;

            using (var pool = new Utf8StringPool())
            {
                rc = _helper.ejdb_ensure_index(handle.DangerousGetHandle(),
                                               pool.GetString(collection), pool.GetString(path), mode);
            }

            if (rc != 0)
            {
                throw _e.CreateException(rc);
            }
        }
Пример #2
0
 public ulong ejdb_remove_index(IntPtr db, IntPtr coll, IntPtr path, ejdb_idx_mode_t mode) => Interop.ejdb_remove_index(db, coll, path, mode);
Пример #3
0
 public static extern ulong ejdb_remove_index(
     IntPtr db, IntPtr coll, IntPtr path, ejdb_idx_mode_t mode);