Out with MagicOnion, in with LiteNetLib
Removed MagicOnion Added LiteNetLib Created client and server abstractions Fixed serialization bugs
This commit is contained in:
parent
433a7b4ae4
commit
e96146b7bb
869 changed files with 59401 additions and 16812 deletions
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b3817a16ad2ea504a9e2b2a2581b0412
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension helpers for working with the AST.
|
||||
/// </summary>
|
||||
public static class ExtensionHelper
|
||||
{
|
||||
internal static JObject ToJObject(this object anonType)
|
||||
{
|
||||
return anonType == null ? null : JObject.FromObject(anonType);
|
||||
}
|
||||
|
||||
internal static IDictionary<string, object> ToDict(this object anonType)
|
||||
{
|
||||
return anonType == null ? null : PropertyHelper.ObjectToDictionary(anonType);
|
||||
}
|
||||
/// <summary>
|
||||
/// Uses a collection as parameters for a method call.
|
||||
/// </summary>
|
||||
/// <param name="args">Same as calling params object[] overload. Instead of specifying each param, ICollection can be used for convenience.</param>
|
||||
public static object[] AsParams<T>(this ICollection<T> args)
|
||||
{
|
||||
return args.OfType<object>().ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4a823fc8988297f4aabe8019ae3310cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
45
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/Poco.cs
Normal file
45
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/Poco.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
using RethinkDb.Driver.Net;
|
||||
using RethinkDb.Driver.Proto;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
internal class Poco : ReqlExpr
|
||||
{
|
||||
private readonly object obj;
|
||||
|
||||
public Poco(object obj) : base(new TermType(), null, null)
|
||||
{
|
||||
this.obj = obj;
|
||||
}
|
||||
|
||||
|
||||
internal class PocoWriter : JTokenWriter
|
||||
{
|
||||
public override void WriteStartArray()
|
||||
{
|
||||
base.WriteStartArray();
|
||||
this.WriteValue(Proto.TermType.MAKE_ARRAY);
|
||||
base.WriteStartArray();
|
||||
}
|
||||
|
||||
public override void WriteEndArray()
|
||||
{
|
||||
base.WriteEndArray();
|
||||
base.WriteEndArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected internal override object Build()
|
||||
{
|
||||
JToken token;
|
||||
using( var writer = new PocoWriter() )
|
||||
{
|
||||
Converter.Serializer.Serialize(writer, this.obj);
|
||||
token = writer.Token;
|
||||
}
|
||||
return token;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 977e5c4e6b4f6364d9f1675f07332c78
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,515 @@
|
|||
#pragma warning disable 419
|
||||
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
internal class PropertyHelper
|
||||
{
|
||||
// Delegate type for a by-ref property getter
|
||||
private delegate TValue ByRefFunc<TDeclaringType, TValue>(ref TDeclaringType arg);
|
||||
|
||||
private static readonly MethodInfo CallPropertyGetterOpenGenericMethod =
|
||||
typeof(PropertyHelper).GetTypeInfo().GetDeclaredMethod(nameof(CallPropertyGetter));
|
||||
|
||||
private static readonly MethodInfo CallPropertyGetterByReferenceOpenGenericMethod =
|
||||
typeof(PropertyHelper).GetTypeInfo().GetDeclaredMethod(nameof(CallPropertyGetterByReference));
|
||||
|
||||
private static readonly MethodInfo CallNullSafePropertyGetterOpenGenericMethod =
|
||||
typeof(PropertyHelper).GetTypeInfo().GetDeclaredMethod(nameof(CallNullSafePropertyGetter));
|
||||
|
||||
private static readonly MethodInfo CallNullSafePropertyGetterByReferenceOpenGenericMethod =
|
||||
typeof(PropertyHelper).GetTypeInfo().GetDeclaredMethod(nameof(CallNullSafePropertyGetterByReference));
|
||||
|
||||
private static readonly MethodInfo CallPropertySetterOpenGenericMethod =
|
||||
typeof(PropertyHelper).GetTypeInfo().GetDeclaredMethod(nameof(CallPropertySetter));
|
||||
|
||||
// Using an array rather than IEnumerable, as target will be called on the hot path numerous times.
|
||||
private static readonly ConcurrentDictionary<Type, PropertyHelper[]> PropertiesCache =
|
||||
new ConcurrentDictionary<Type, PropertyHelper[]>();
|
||||
|
||||
private static readonly ConcurrentDictionary<Type, PropertyHelper[]> VisiblePropertiesCache =
|
||||
new ConcurrentDictionary<Type, PropertyHelper[]>();
|
||||
|
||||
private Action<object, object> _valueSetter;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a fast <see cref="PropertyHelper"/>.
|
||||
/// This constructor does not cache the helper. For caching, use <see cref="GetProperties(object)"/>.
|
||||
/// </summary>
|
||||
public PropertyHelper(PropertyInfo property)
|
||||
{
|
||||
if( property == null )
|
||||
{
|
||||
throw new ArgumentNullException(nameof(property));
|
||||
}
|
||||
|
||||
Property = property;
|
||||
Name = property.Name;
|
||||
ValueGetter = MakeFastPropertyGetter(property);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the backing <see cref="PropertyInfo"/>.
|
||||
/// </summary>
|
||||
public PropertyInfo Property { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets (or sets in derived types) the property name.
|
||||
/// </summary>
|
||||
public virtual string Name { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property value getter.
|
||||
/// </summary>
|
||||
public Func<object, object> ValueGetter { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property value setter.
|
||||
/// </summary>
|
||||
public Action<object, object> ValueSetter
|
||||
{
|
||||
get
|
||||
{
|
||||
if( _valueSetter == null )
|
||||
{
|
||||
// We'll allow safe races here.
|
||||
_valueSetter = MakeFastPropertySetter(Property);
|
||||
}
|
||||
|
||||
return _valueSetter;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the property value for the specified <paramref name="instance"/>.
|
||||
/// </summary>
|
||||
/// <param name="instance">The object whose property value will be returned.</param>
|
||||
/// <returns>The property value.</returns>
|
||||
public object GetValue(object instance)
|
||||
{
|
||||
return ValueGetter(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the property value for the specified <paramref name="instance" />.
|
||||
/// </summary>
|
||||
/// <param name="instance">The object whose property value will be set.</param>
|
||||
/// <param name="value">The property value.</param>
|
||||
public void SetValue(object instance, object value)
|
||||
{
|
||||
ValueSetter(instance, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates and caches fast property helpers that expose getters for every public get property on the
|
||||
/// underlying type.
|
||||
/// </summary>
|
||||
/// <param name="instance">the instance to extract property accessors for.</param>
|
||||
/// <returns>a cached array of all public property getters from the underlying type of target instance.
|
||||
/// </returns>
|
||||
public static PropertyHelper[] GetProperties(object instance)
|
||||
{
|
||||
return GetProperties(instance.GetType());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates and caches fast property helpers that expose getters for every public get property on the
|
||||
/// specified type.
|
||||
/// </summary>
|
||||
/// <param name="type">the type to extract property accessors for.</param>
|
||||
/// <returns>a cached array of all public property getters from the type of target instance.
|
||||
/// </returns>
|
||||
public static PropertyHelper[] GetProperties(Type type)
|
||||
{
|
||||
return GetProperties(type, CreateInstance, PropertiesCache);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Creates and caches fast property helpers that expose getters for every non-hidden get property
|
||||
/// on the specified type.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <see cref="GetVisibleProperties"/> excludes properties defined on base types that have been
|
||||
/// hidden by definitions using the <c>new</c> keyword.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="instance">The instance to extract property accessors for.</param>
|
||||
/// <returns>
|
||||
/// A cached array of all public property getters from the instance's type.
|
||||
/// </returns>
|
||||
public static PropertyHelper[] GetVisibleProperties(object instance)
|
||||
{
|
||||
return GetVisibleProperties(instance.GetType(), CreateInstance, PropertiesCache, VisiblePropertiesCache);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Creates a caches fast property helpers that expose getters for every non-hidden get property
|
||||
/// on the specified type.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <see cref="GetVisibleProperties"/> excludes properties defined on base types that have been
|
||||
/// hidden by definitions using the <c>new</c> keyword.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="type">The type to extract property accessors for.</param>
|
||||
/// <returns>
|
||||
/// A cached array of all public property getters from the type.
|
||||
/// </returns>
|
||||
public static PropertyHelper[] GetVisibleProperties(Type type)
|
||||
{
|
||||
return GetVisibleProperties(type, CreateInstance, PropertiesCache, VisiblePropertiesCache);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a single fast property getter. The result is not cached.
|
||||
/// </summary>
|
||||
/// <param name="propertyInfo">propertyInfo to extract the getter for.</param>
|
||||
/// <returns>a fast getter.</returns>
|
||||
/// <remarks>
|
||||
/// This method is more memory efficient than a dynamically compiled lambda, and about the
|
||||
/// same speed.
|
||||
/// </remarks>
|
||||
public static Func<object, object> MakeFastPropertyGetter(PropertyInfo propertyInfo)
|
||||
{
|
||||
Debug.Assert(propertyInfo != null);
|
||||
|
||||
return MakeFastPropertyGetter(
|
||||
propertyInfo,
|
||||
CallPropertyGetterOpenGenericMethod,
|
||||
CallPropertyGetterByReferenceOpenGenericMethod);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a single fast property getter which is safe for a null input object. The result is not cached.
|
||||
/// </summary>
|
||||
/// <param name="propertyInfo">propertyInfo to extract the getter for.</param>
|
||||
/// <returns>a fast getter.</returns>
|
||||
/// <remarks>
|
||||
/// This method is more memory efficient than a dynamically compiled lambda, and about the
|
||||
/// same speed.
|
||||
/// </remarks>
|
||||
public static Func<object, object> MakeNullSafeFastPropertyGetter(PropertyInfo propertyInfo)
|
||||
{
|
||||
Debug.Assert(propertyInfo != null);
|
||||
|
||||
return MakeFastPropertyGetter(
|
||||
propertyInfo,
|
||||
CallNullSafePropertyGetterOpenGenericMethod,
|
||||
CallNullSafePropertyGetterByReferenceOpenGenericMethod);
|
||||
}
|
||||
|
||||
private static Func<object, object> MakeFastPropertyGetter(
|
||||
PropertyInfo propertyInfo,
|
||||
MethodInfo propertyGetterWrapperMethod,
|
||||
MethodInfo propertyGetterByRefWrapperMethod)
|
||||
{
|
||||
Debug.Assert(propertyInfo != null);
|
||||
|
||||
// Must be a generic method with a Func<,> parameter
|
||||
Debug.Assert(propertyGetterWrapperMethod != null);
|
||||
Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition);
|
||||
Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2);
|
||||
|
||||
// Must be a generic method with a ByRefFunc<,> parameter
|
||||
Debug.Assert(propertyGetterByRefWrapperMethod != null);
|
||||
Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition);
|
||||
Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2);
|
||||
|
||||
var getMethod = propertyInfo.GetMethod;
|
||||
Debug.Assert(getMethod != null);
|
||||
Debug.Assert(!getMethod.IsStatic);
|
||||
Debug.Assert(getMethod.GetParameters().Length == 0);
|
||||
|
||||
// Instance methods in the CLR can be turned into static methods where the first parameter
|
||||
// is open over "target". This parameter is always passed by reference, so we have a code
|
||||
// path for value types and a code path for reference types.
|
||||
if( getMethod.DeclaringType.GetTypeInfo().IsValueType )
|
||||
{
|
||||
// Create a delegate (ref TDeclaringType) -> TValue
|
||||
return MakeFastPropertyGetter(
|
||||
typeof(ByRefFunc<,>),
|
||||
getMethod,
|
||||
propertyGetterByRefWrapperMethod);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create a delegate TDeclaringType -> TValue
|
||||
return MakeFastPropertyGetter(
|
||||
typeof(Func<,>),
|
||||
getMethod,
|
||||
propertyGetterWrapperMethod);
|
||||
}
|
||||
}
|
||||
|
||||
private static Func<object, object> MakeFastPropertyGetter(
|
||||
Type openGenericDelegateType,
|
||||
MethodInfo propertyGetMethod,
|
||||
MethodInfo openGenericWrapperMethod)
|
||||
{
|
||||
var typeInput = propertyGetMethod.DeclaringType;
|
||||
var typeOutput = propertyGetMethod.ReturnType;
|
||||
|
||||
var delegateType = openGenericDelegateType.MakeGenericType(typeInput, typeOutput);
|
||||
var propertyGetterDelegate = propertyGetMethod.CreateDelegate(delegateType);
|
||||
|
||||
var wrapperDelegateMethod = openGenericWrapperMethod.MakeGenericMethod(typeInput, typeOutput);
|
||||
var accessorDelegate = wrapperDelegateMethod.CreateDelegate(
|
||||
typeof(Func<object, object>),
|
||||
propertyGetterDelegate);
|
||||
|
||||
return (Func<object, object>)accessorDelegate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a single fast property setter for reference types. The result is not cached.
|
||||
/// </summary>
|
||||
/// <param name="propertyInfo">propertyInfo to extract the setter for.</param>
|
||||
/// <returns>a fast getter.</returns>
|
||||
/// <remarks>
|
||||
/// This method is more memory efficient than a dynamically compiled lambda, and about the
|
||||
/// same speed. This only works for reference types.
|
||||
/// </remarks>
|
||||
public static Action<object, object> MakeFastPropertySetter(PropertyInfo propertyInfo)
|
||||
{
|
||||
Debug.Assert(propertyInfo != null);
|
||||
Debug.Assert(!propertyInfo.DeclaringType.GetTypeInfo().IsValueType);
|
||||
|
||||
var setMethod = propertyInfo.SetMethod;
|
||||
Debug.Assert(setMethod != null);
|
||||
Debug.Assert(!setMethod.IsStatic);
|
||||
Debug.Assert(setMethod.ReturnType == typeof(void));
|
||||
var parameters = setMethod.GetParameters();
|
||||
Debug.Assert(parameters.Length == 1);
|
||||
|
||||
// Instance methods in the CLR can be turned into static methods where the first parameter
|
||||
// is open over "target". This parameter is always passed by reference, so we have a code
|
||||
// path for value types and a code path for reference types.
|
||||
var typeInput = setMethod.DeclaringType;
|
||||
var parameterType = parameters[0].ParameterType;
|
||||
|
||||
// Create a delegate TDeclaringType -> { TDeclaringType.Property = TValue; }
|
||||
var propertySetterAsAction =
|
||||
setMethod.CreateDelegate(typeof(Action<,>).MakeGenericType(typeInput, parameterType));
|
||||
var callPropertySetterClosedGenericMethod =
|
||||
CallPropertySetterOpenGenericMethod.MakeGenericMethod(typeInput, parameterType);
|
||||
var callPropertySetterDelegate =
|
||||
callPropertySetterClosedGenericMethod.CreateDelegate(
|
||||
typeof(Action<object, object>), propertySetterAsAction);
|
||||
|
||||
return (Action<object, object>)callPropertySetterDelegate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given an object, adds each instance property with a public get method as a key and its
|
||||
/// associated value to a dictionary.
|
||||
///
|
||||
/// If the object is already an IDictionary{string,object} instance, then a copy
|
||||
/// is returned.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The implementation of PropertyHelper will cache the property accessors per-type. This is
|
||||
/// faster when the same type is used multiple times with ObjectToDictionary.
|
||||
/// </remarks>
|
||||
public static IDictionary<string, object> ObjectToDictionary(object value)
|
||||
{
|
||||
var dictionary = value as IDictionary<string, object>;
|
||||
if( dictionary != null )
|
||||
{
|
||||
return new Dictionary<string, object>(dictionary, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
dictionary = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
if( value != null )
|
||||
{
|
||||
foreach( var helper in GetProperties(value) )
|
||||
{
|
||||
dictionary[helper.Name] = helper.GetValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
private static PropertyHelper CreateInstance(PropertyInfo property)
|
||||
{
|
||||
return new PropertyHelper(property);
|
||||
}
|
||||
|
||||
// Called via reflection
|
||||
private static object CallPropertyGetter<TDeclaringType, TValue>(
|
||||
Func<TDeclaringType, TValue> getter,
|
||||
object target)
|
||||
{
|
||||
return getter((TDeclaringType)target);
|
||||
}
|
||||
|
||||
// Called via reflection
|
||||
private static object CallPropertyGetterByReference<TDeclaringType, TValue>(
|
||||
ByRefFunc<TDeclaringType, TValue> getter,
|
||||
object target)
|
||||
{
|
||||
var unboxed = (TDeclaringType)target;
|
||||
return getter(ref unboxed);
|
||||
}
|
||||
|
||||
// Called via reflection
|
||||
private static object CallNullSafePropertyGetter<TDeclaringType, TValue>(
|
||||
Func<TDeclaringType, TValue> getter,
|
||||
object target)
|
||||
{
|
||||
if( target == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return getter((TDeclaringType)target);
|
||||
}
|
||||
|
||||
// Called via reflection
|
||||
private static object CallNullSafePropertyGetterByReference<TDeclaringType, TValue>(
|
||||
ByRefFunc<TDeclaringType, TValue> getter,
|
||||
object target)
|
||||
{
|
||||
if( target == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var unboxed = (TDeclaringType)target;
|
||||
return getter(ref unboxed);
|
||||
}
|
||||
|
||||
private static void CallPropertySetter<TDeclaringType, TValue>(
|
||||
Action<TDeclaringType, TValue> setter,
|
||||
object target,
|
||||
object value)
|
||||
{
|
||||
setter((TDeclaringType)target, (TValue)value);
|
||||
}
|
||||
|
||||
protected static PropertyHelper[] GetVisibleProperties(
|
||||
Type type,
|
||||
Func<PropertyInfo, PropertyHelper> createPropertyHelper,
|
||||
ConcurrentDictionary<Type, PropertyHelper[]> allPropertiesCache,
|
||||
ConcurrentDictionary<Type, PropertyHelper[]> visiblePropertiesCache)
|
||||
{
|
||||
PropertyHelper[] result;
|
||||
if( visiblePropertiesCache.TryGetValue(type, out result) )
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
// The simple and common case, this is normal POCO object - no need to allocate.
|
||||
var allPropertiesDefinedOnType = true;
|
||||
var allProperties = GetProperties(type, createPropertyHelper, allPropertiesCache);
|
||||
foreach( var propertyHelper in allProperties )
|
||||
{
|
||||
if( propertyHelper.Property.DeclaringType != type )
|
||||
{
|
||||
allPropertiesDefinedOnType = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( allPropertiesDefinedOnType )
|
||||
{
|
||||
result = allProperties;
|
||||
visiblePropertiesCache.TryAdd(type, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
// There's some inherited properties here, so we need to check for hiding via 'new'.
|
||||
var filteredProperties = new List<PropertyHelper>(allProperties.Length);
|
||||
foreach( var propertyHelper in allProperties )
|
||||
{
|
||||
var declaringType = propertyHelper.Property.DeclaringType;
|
||||
if( declaringType == type )
|
||||
{
|
||||
filteredProperties.Add(propertyHelper);
|
||||
continue;
|
||||
}
|
||||
|
||||
// If this property was declared on a base type then look for the definition closest to the
|
||||
// the type to see if we should include it.
|
||||
var ignoreProperty = false;
|
||||
|
||||
// Walk up the hierarchy until we find the type that actually declares this
|
||||
// PropertyInfo.
|
||||
var currentTypeInfo = type.GetTypeInfo();
|
||||
var declaringTypeInfo = declaringType.GetTypeInfo();
|
||||
while( currentTypeInfo != null && currentTypeInfo != declaringTypeInfo )
|
||||
{
|
||||
// We've found a 'more proximal' public definition
|
||||
var declaredProperty = currentTypeInfo.GetDeclaredProperty(propertyHelper.Name);
|
||||
if( declaredProperty != null )
|
||||
{
|
||||
ignoreProperty = true;
|
||||
break;
|
||||
}
|
||||
|
||||
currentTypeInfo = currentTypeInfo.BaseType?.GetTypeInfo();
|
||||
}
|
||||
|
||||
if( !ignoreProperty )
|
||||
{
|
||||
filteredProperties.Add(propertyHelper);
|
||||
}
|
||||
}
|
||||
|
||||
result = filteredProperties.ToArray();
|
||||
visiblePropertiesCache.TryAdd(type, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected static PropertyHelper[] GetProperties(
|
||||
Type type,
|
||||
Func<PropertyInfo, PropertyHelper> createPropertyHelper,
|
||||
ConcurrentDictionary<Type, PropertyHelper[]> cache)
|
||||
{
|
||||
// Unwrap nullable types. This means Nullable<T>.Value and Nullable<T>.HasValue will not be
|
||||
// part of the sequence of properties returned by this method.
|
||||
type = Nullable.GetUnderlyingType(type) ?? type;
|
||||
|
||||
PropertyHelper[] helpers;
|
||||
if( !cache.TryGetValue(type, out helpers) )
|
||||
{
|
||||
// We avoid loading indexed properties using the Where statement.
|
||||
var properties = type.GetRuntimeProperties().Where(IsInterestingProperty);
|
||||
|
||||
var typeInfo = type.GetTypeInfo();
|
||||
if( typeInfo.IsInterface )
|
||||
{
|
||||
// Reflection does not return information about inherited properties on the interface itself.
|
||||
properties = properties.Concat(typeInfo.ImplementedInterfaces.SelectMany(
|
||||
interfaceType => interfaceType.GetRuntimeProperties().Where(IsInterestingProperty)));
|
||||
}
|
||||
|
||||
helpers = properties.Select(p => createPropertyHelper(p)).ToArray();
|
||||
cache.TryAdd(type, helpers);
|
||||
}
|
||||
|
||||
return helpers;
|
||||
}
|
||||
|
||||
// Indexed properties are not useful (or valid) for grabbing properties off an object.
|
||||
private static bool IsInterestingProperty(PropertyInfo property)
|
||||
{
|
||||
return property.GetIndexParameters().Length == 0 &&
|
||||
property.GetMethod != null &&
|
||||
property.GetMethod.IsPublic &&
|
||||
!property.GetMethod.IsStatic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1dffb6ae397451d4984cf8a0dce3796e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
#pragma warning disable 1591
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
/* An instance for a query that has been sent to the server. Keeps
|
||||
* track of its token, the args to .run() it was called with, and its
|
||||
* query type.
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// DO NOT USE DIRECTLY
|
||||
/// </summary>
|
||||
public class Query
|
||||
{
|
||||
public QueryType Type { get; }
|
||||
public long Token { get; }
|
||||
public ReqlAst Term { get; }
|
||||
public OptArgs GlobalOptions { get; }
|
||||
|
||||
public Query(QueryType type, long token, ReqlAst term, OptArgs globalOptions)
|
||||
{
|
||||
this.Type = type;
|
||||
this.Token = token;
|
||||
this.Term = term;
|
||||
this.GlobalOptions = globalOptions;
|
||||
}
|
||||
|
||||
public Query(QueryType type, long token) : this(type, token, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public static Query Stop(long token)
|
||||
{
|
||||
return new Query(QueryType.STOP, token, null, null);
|
||||
}
|
||||
|
||||
public static Query Continue(long token)
|
||||
{
|
||||
return new Query(QueryType.CONTINUE, token, null, null);
|
||||
}
|
||||
|
||||
public static Query Start(long token, ReqlAst term, OptArgs globalOptions)
|
||||
{
|
||||
return new Query(QueryType.START, token, term, globalOptions);
|
||||
}
|
||||
|
||||
public static Query ServerInfo(long token)
|
||||
{
|
||||
return new Query(QueryType.SERVER_INFO, token, null, null);
|
||||
}
|
||||
|
||||
public static Query NoReplyWait(long token)
|
||||
{
|
||||
return new Query(QueryType.NOREPLY_WAIT, token, null, null);
|
||||
}
|
||||
|
||||
public virtual string Serialize()
|
||||
{
|
||||
var queryArr = new JArray();
|
||||
|
||||
queryArr.Add(Type);
|
||||
|
||||
if( Term != null )
|
||||
{
|
||||
queryArr.Add(Term.Build());
|
||||
}
|
||||
if( GlobalOptions != null )
|
||||
{
|
||||
queryArr.Add(ReqlAst.BuildOptarg(GlobalOptions));
|
||||
}
|
||||
|
||||
return queryArr.ToString(Formatting.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: cef144145ff323247ab108fe4eaa76c5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
450
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/ReqlAst.cs
Normal file
450
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/ReqlAst.cs
Normal file
|
|
@ -0,0 +1,450 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Net;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using RethinkDb.Driver.Utils;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for all reql queries.
|
||||
/// </summary>
|
||||
public class ReqlAst
|
||||
{
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
protected internal TermType TermType { get; }
|
||||
protected internal Arguments Args { get; }
|
||||
protected internal OptArgs OptArgs { get; }
|
||||
|
||||
protected internal ReqlAst(TermType termType, Arguments args, OptArgs optargs)
|
||||
{
|
||||
this.TermType = termType;
|
||||
this.Args = args ?? new Arguments();
|
||||
this.OptArgs = optargs ?? new OptArgs();
|
||||
}
|
||||
|
||||
protected internal virtual object Build()
|
||||
{
|
||||
// Create a JSON object from the Ast
|
||||
JArray list = new JArray();
|
||||
list.Add(TermType);
|
||||
if( Args.Count > 0 )
|
||||
{
|
||||
var collect = Args.Select(a => { return a.Build(); });
|
||||
list.Add(new JArray(collect));
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(new JArray());
|
||||
}
|
||||
|
||||
if( OptArgs.Count > 0 )
|
||||
{
|
||||
list.Add(BuildOptarg(this.OptArgs));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
protected internal static JObject BuildOptarg(OptArgs opts)
|
||||
{
|
||||
var dict = opts.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Build());
|
||||
return JObject.FromObject(dict);
|
||||
}
|
||||
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
#region DYNAMIC LANGUAGE RUNTIME (DLR) RUNNERS
|
||||
|
||||
/// <summary>
|
||||
/// Runs the query on the connection. If you know the response type
|
||||
/// of your query, T (SUCCESS_ATOM) or Cursor[T] (SUCCESS_SEQUENCE or SUCCESS_PARTIAL)
|
||||
/// it's recommended to use `.RunAtom`, `.RunCursor` or `.RunResult` helpers
|
||||
/// as they offer a slight edge in performance since both bypass the
|
||||
/// dynamic language runtime execution engine.
|
||||
/// </summary>
|
||||
/// <returns>Returns T or Cursor[T]</returns>
|
||||
public virtual Task<dynamic> RunAsync<T>(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return conn.RunAsync<T>(this, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the query on the connection. If you know the response type
|
||||
/// of your query, T (SUCCESS_ATOM) or Cursor[T] (SUCCESS_SEQUENCE or SUCCESS_PARTIAL)
|
||||
/// it's recommended to use `.RunAtom`, `.RunCursor` or `.RunResult` helpers
|
||||
/// as they offer a slight edge in performance since both bypass the
|
||||
/// dynamic language runtime execution engine.
|
||||
/// </summary>
|
||||
/// <returns>Returns T or Cursor[T]</returns>
|
||||
public virtual Task<dynamic> RunAsync<T>(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunAsync<T>(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Runs the query on the connection. If you know the response type
|
||||
/// of your query, T (SUCCESS_ATOM) or Cursor[T] (SUCCESS_SEQUENCE or SUCCESS_PARTIAL)
|
||||
/// it's recommended to use `.RunAtom`, `.RunCursor` or `.RunResult` helpers
|
||||
/// as they offer a slight edge in performance since both bypass the
|
||||
/// dynamic language runtime execution engine.
|
||||
/// </summary>
|
||||
/// <returns>Returns T or Cursor[T]</returns>
|
||||
/// /// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<dynamic> RunAsync(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return RunAsync<dynamic>(conn, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the query on the connection. If you know the response type
|
||||
/// of your query, T (SUCCESS_ATOM) or Cursor[T] (SUCCESS_SEQUENCE or SUCCESS_PARTIAL)
|
||||
/// it's recommended to use `.RunAtom`, `.RunCursor` or `.RunResult` helpers
|
||||
/// as they offer a slight edge in performance since both bypass the
|
||||
/// dynamic language runtime execution engine.
|
||||
/// </summary>
|
||||
/// <returns>Returns T or Cursor[T]</returns>
|
||||
/// /// <param name="conn">connection</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<dynamic> RunAsync(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunAsync(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Runs the query on the connection. If you know the response type
|
||||
/// of your query, T (SUCCESS_ATOM) or Cursor[T] (SUCCESS_SEQUENCE or SUCCESS_PARTIAL)
|
||||
/// it's recommended to use `.RunAtom`, `.RunCursor` or `.RunResult` helpers
|
||||
/// as they offer a slight edge in performance since both bypass the
|
||||
/// dynamic language runtime execution engine.
|
||||
/// </summary>
|
||||
/// <returns>Returns T or Cursor[T]</returns>
|
||||
public virtual dynamic Run<T>(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunAsync<T>(conn, runOpts).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the query on the connection. If you know the response type
|
||||
/// of your query, T (SUCCESS_ATOM) or Cursor[T] (SUCCESS_SEQUENCE or SUCCESS_PARTIAL)
|
||||
/// it's recommended to use `.RunAtom`, `.RunCursor` or `.RunResult` helpers
|
||||
/// as they offer a slight edge in performance since both bypass the
|
||||
/// dynamic language runtime execution engine.
|
||||
/// </summary>
|
||||
/// <returns>Returns T or Cursor[T]</returns>
|
||||
public virtual dynamic Run(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return Run<dynamic>(conn, runOpts);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region RESPONSE TYPED RUNNERS
|
||||
|
||||
/// <summary>
|
||||
/// Executes a query with no expected response. Useful for fire-and-forget queries like insert, update.
|
||||
/// </summary>
|
||||
public void RunNoReply(IConnection conn, object runOpts = null)
|
||||
{
|
||||
conn.RunNoReply(this, runOpts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting a cursor (SUCCESS_SEQUENCE or SUCCESS_PARTIAL) response
|
||||
/// from your query. This method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
/// <returns>A Cursor</returns>
|
||||
public virtual Task<Cursor<T>> RunCursorAsync<T>(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return conn.RunCursorAsync<T>(this, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting a cursor (SUCCESS_SEQUENCE or SUCCESS_PARTIAL) response
|
||||
/// from your query. This method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
/// <returns>A Cursor</returns>
|
||||
public virtual Task<Cursor<T>> RunCursorAsync<T>(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunCursorAsync<T>(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting a cursor (SUCCESS_SEQUENCE or SUCCESS_PARTIAL) response
|
||||
/// from your query. This method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <returns>A Cursor</returns>
|
||||
public virtual Cursor<T> RunCursor<T>(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunCursorAsync<T>(conn, runOpts).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting SUCCESS_ATOM response from your query. This
|
||||
/// method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<T> RunAtomAsync<T>(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return conn.RunAtomAsync<T>(this, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting SUCCESS_ATOM response from your query. This
|
||||
/// method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<T> RunAtomAsync<T>(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunAtomAsync<T>(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting SUCCESS_ATOM response from your query. This
|
||||
/// method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
public virtual T RunAtom<T>(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunAtomAsync<T>(conn, runOpts).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting SUCCESS_ATOM or SUCCESS_SEQUENCE response from your query. This
|
||||
/// method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses. Consider using RunAtom or RunCursor if your
|
||||
/// response is either SUCCESS_ATOM or SUCCESS_SEQUENCE respectively. Exercise caution using this method
|
||||
/// with large datasets as the server can switch responses from SUCESS_SEQUENCE to SUCCESS_PARTIAL for the
|
||||
/// same exact query. Refer to the online documentation for this run helper.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<T> RunResultAsync<T>(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return conn.RunResultAsync<T>(this, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting SUCCESS_ATOM or SUCCESS_SEQUENCE response from your query. This
|
||||
/// method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses. Consider using RunAtom or RunCursor if your
|
||||
/// response is either SUCCESS_ATOM or SUCCESS_SEQUENCE respectively. Exercise caution using this method
|
||||
/// with large datasets as the server can switch responses from SUCESS_SEQUENCE to SUCCESS_PARTIAL for the
|
||||
/// same exact query. Refer to the online documentation for this run helper.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<T> RunResultAsync<T>(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunResultAsync<T>(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this method if you're expecting SUCCESS_ATOM or SUCCESS_SEQUENCE response from your query. This
|
||||
/// method offers a slight edge in performance without the need for the
|
||||
/// dynamic language runtime like the run() method uses. Consider using RunAtom or RunCursor if your
|
||||
/// response is either SUCCESS_ATOM or SUCCESS_SEQUENCE respectively. Exercise caution using this method
|
||||
/// with large datasets as the server can switch responses from SUCESS_SEQUENCE to SUCCESS_PARTIAL for the
|
||||
/// same exact query. Refer to the online documentation for this run helper.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
public virtual T RunResult<T>(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunResultAsync<T>(conn, runOpts).WaitSync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region EXTRA RUN HELPERS
|
||||
|
||||
/// <summary>
|
||||
/// OBSOLETE: Please use the .RunWriteAsync() method instead.
|
||||
/// </summary>
|
||||
[Obsolete("The .RunResultAsync() method has been renamed to .RunWriteAsync(). Please use the new method name instead.", error: false)]
|
||||
public virtual Task<Result> RunResultAsync(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return RunWriteAsync(conn, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OBSOLETE: Please use .RunWriteAsync() method instead.
|
||||
/// </summary>
|
||||
[Obsolete("The .RunResultAsync() method has been renamed to .RunWriteAsync(). Please use the new method name instead.", error: false)]
|
||||
public virtual Task<Result> RunResultAsync(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunWriteAsync(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OBSOLETE: Please use .RunWrite() method instead.
|
||||
/// </summary>
|
||||
[Obsolete("The .RunResult() method has been renamed to .RunWrite(). Please use the new method name instead.", error: false)]
|
||||
public virtual Result RunResult(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunWriteAsync(conn, runOpts).WaitSync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for DML type of queries that returns # of inserts, deletes, errors.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<Result> RunWriteAsync(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return conn.RunAtomAsync<Result>(this, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for DML type of queries that returns # of inserts, deletes, errors.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<Result> RunWriteAsync(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunWriteAsync(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for DML type of queries that returns # of inserts, deletes, errors.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
public virtual Result RunWrite(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunWriteAsync(conn, runOpts).WaitSync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Runs a query on the server and returns the raw <see cref="Response"/> object in an unsafe way
|
||||
/// with minimal client-side processing. The unbridled use of this method can
|
||||
/// lead to memory leaks on both the client and server. This method should only
|
||||
/// be used in well-understood and advanced scenarios.
|
||||
/// </summary>
|
||||
/// <param name="conn">The connection object</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<Response> RunUnsafeAsync(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return conn.RunUnsafeAsync(this, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for change feeds, use if your query is expecting an infinite changes() stream.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The document type of new/old value</typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<Cursor<Change<T>>> RunChangesAsync<T>(IConnection conn, object runOpts = null, CancellationToken cancelToken = default)
|
||||
{
|
||||
return conn.RunCursorAsync<Change<T>>(this, runOpts, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for change feeds, use if your query is expecting an infinite changes() stream.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The document type of new/old value</typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<Cursor<Change<T>>> RunChangesAsync<T>(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunChangesAsync<T>(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for change feeds, use if your query is expecting an infinite changes() stream.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The document type of new/old value</typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
public virtual Cursor<Change<T>> RunChanges<T>(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunChangesAsync<T>(conn, runOpts).WaitSync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for grouping queries.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">The key type of how items are grouped</typeparam>
|
||||
/// <typeparam name="TItem">The type of items</typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual async Task<IEnumerable<GroupedResult<TKey, TItem>>> RunGroupingAsync<TKey, TItem>(IConnection conn, object runOpts = null,
|
||||
CancellationToken cancelToken = default)
|
||||
{
|
||||
var tsk = await RunAtomAsync<GroupedResultSet<TKey, TItem>>(conn, runOpts, cancelToken).ConfigureAwait(false);
|
||||
return tsk;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for grouping queries.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">The key type of how items are grouped</typeparam>
|
||||
/// <typeparam name="TItem">The type of items</typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="cancelToken">Cancellation token used to stop *waiting* for a query response. The cancellation token does not cancel the query's execution on the server.</param>
|
||||
public virtual Task<IEnumerable<GroupedResult<TKey, TItem>>> RunGroupingAsync<TKey, TItem>(IConnection conn, CancellationToken cancelToken)
|
||||
{
|
||||
return RunGroupingAsync<TKey, TItem>(conn, null, cancelToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper shortcut for grouping queries.
|
||||
/// This method bypasses the dynamic language runtime for extra performance.
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">The key type of how items are grouped</typeparam>
|
||||
/// <typeparam name="TItem">The type of items</typeparam>
|
||||
/// <param name="conn">connection</param>
|
||||
/// <param name="runOpts">global anonymous type optional arguments</param>
|
||||
public virtual IEnumerable<GroupedResult<TKey, TItem>> RunGrouping<TKey, TItem>(IConnection conn, object runOpts = null)
|
||||
{
|
||||
return RunAtomAsync<GroupedResultSet<TKey, TItem>>(conn, runOpts).WaitSync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 525d7b2d52e0ac044a7b5761bed6ef78
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
194
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/ReqlExpr.cs
Normal file
194
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/ReqlExpr.cs
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
//Partial class for overloads expression overloads! :)
|
||||
//Cool man. Yeeah. That's right. So 1337.
|
||||
#pragma warning disable 660,661
|
||||
public partial class ReqlExpr
|
||||
#pragma warning restore 660,661
|
||||
{
|
||||
#region INDEXERS, READ WARNING
|
||||
// WARNING:
|
||||
// ANY ADDITIONAL INDEXERS YOU SPECIFY HERE MUST BE NEWLY
|
||||
// IMPLEMENTED IN THE AST SUBCLASS TEMPLATE TO BE PROPERLY
|
||||
// RESOLVED DURING OPERATOR RESOLUTION. REGEN OF THE AST
|
||||
// IS REQUIRED.
|
||||
//
|
||||
// SEE ReqlExprHelpers SECTION IN AstSublcassTemplate FOR
|
||||
// MORE INFORMATION.
|
||||
///
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public Bracket this[string bracket] => this.bracket(bracket);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public Bracket this[int bracket] => this.bracket(bracket);
|
||||
#endregion
|
||||
|
||||
public static ReqlExpr operator >(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.gt(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator <(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.lt(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator >=(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.ge(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator <=(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.le(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator ==(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.eq(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator !=(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.ne(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator +(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.add(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator -(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.sub(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator *(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.mul(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator /(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.div(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator %(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.mod(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator !(ReqlExpr a)
|
||||
{
|
||||
return a.not();
|
||||
}
|
||||
|
||||
|
||||
//&& and || might be a bit tricky here.
|
||||
public static bool operator false(ReqlExpr a)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool operator true(ReqlExpr a)
|
||||
{
|
||||
return false; //forces evaluation of & and | ?
|
||||
//this might be a bug here.
|
||||
}
|
||||
|
||||
public static ReqlExpr operator &(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.and(b);
|
||||
}
|
||||
|
||||
public static ReqlExpr operator |(ReqlExpr a, ReqlExpr b)
|
||||
{
|
||||
return a.or(b);
|
||||
}
|
||||
|
||||
|
||||
//Can we do implicit operators???
|
||||
public static implicit operator ReqlExpr(string a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(int a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(uint a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(byte a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(sbyte a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(long a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(ulong a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(double a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(decimal a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(float a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(DateTime a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(DateTimeOffset a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public static implicit operator ReqlExpr(Delegate a)
|
||||
{
|
||||
return Util.ToReqlExpr(a);
|
||||
}
|
||||
|
||||
public string ToRawString()
|
||||
{
|
||||
return ReqlRaw.ToRawString(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 32b53a1e5fbf70e48bd6200f09e30341
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
116
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/ReqlRaw.cs
Normal file
116
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/ReqlRaw.cs
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to inject raw protocol strings when the AST is dumped on the wire.
|
||||
/// </summary>
|
||||
public class ReqlRawExpr : ReqlExpr
|
||||
{
|
||||
private string RawProtocol { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Create an AST mid-flight with the raw protocol string.
|
||||
/// </summary>
|
||||
/// <param name="rawProtocol">Raw protocol string from ReqlAst.Build()</param>
|
||||
internal ReqlRawExpr(string rawProtocol) : base(new TermType(), null, null)
|
||||
{
|
||||
this.RawProtocol = rawProtocol;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the JToken representation of the raw protocol
|
||||
/// </summary>
|
||||
protected internal override object Build()
|
||||
{
|
||||
return JToken.Parse(this.RawProtocol);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to inject raw protocol strings when the AST is dumped on the wire.
|
||||
/// </summary>
|
||||
public class ReqlRaw : ReqlAst
|
||||
{
|
||||
private string RawProtocol { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Create an AST mid-flight with the raw protocol string.
|
||||
/// </summary>
|
||||
/// <param name="rawProtocol">Raw protocol string from ReqlAst.Build()</param>
|
||||
internal ReqlRaw(string rawProtocol) : base(new TermType(), null, null)
|
||||
{
|
||||
this.RawProtocol = rawProtocol;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the JToken representation of the raw protocol
|
||||
/// </summary>
|
||||
protected internal override object Build()
|
||||
{
|
||||
return JToken.Parse(this.RawProtocol);
|
||||
}
|
||||
|
||||
private const string RawTokenType = "$reql_reqlraw$";
|
||||
|
||||
/// <summary>
|
||||
/// Convert an AST item into a raw protocol string representation.
|
||||
/// Useful for serialization.
|
||||
/// </summary>
|
||||
/// <param name="astItem">Can be anything, ReqlFunction or otherwise</param>
|
||||
public static string ToRawString(object astItem)
|
||||
{
|
||||
var list = new List<Guid>();
|
||||
var token = Util.ToReqlAst(astItem, o => HookFuncTypes(o, list)).Build() as JToken;
|
||||
var query = token.ToString(Formatting.None);
|
||||
//pack
|
||||
return $"{string.Join("|", list)}{RawTokenType}{query}";
|
||||
}
|
||||
|
||||
internal static string HydrateProtocolString(string reqlRawString)
|
||||
{
|
||||
var tokenLocation = reqlRawString.IndexOf(RawTokenType, StringComparison.Ordinal);
|
||||
var guidStrings = reqlRawString.Substring(0, tokenLocation);
|
||||
var query = reqlRawString.Substring(tokenLocation + RawTokenType.Length);
|
||||
|
||||
//unpack
|
||||
var replaceTokens = guidStrings.Split('|')
|
||||
.Select(g => new { GuidString = $@"""{g}""", VarId = Func.NextVarId() });
|
||||
|
||||
foreach (var token in replaceTokens)
|
||||
{
|
||||
query = query.Replace(token.GuidString, token.VarId.ToString());
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a raw protocol string into an AST term that will
|
||||
/// be injected when the AST is serialized.
|
||||
/// </summary>
|
||||
/// <param name="reqlRawString">The raw protocol string to inject</param>
|
||||
/// <returns>A raw AST term</returns>
|
||||
public static ReqlRaw FromRawString(string reqlRawString)
|
||||
{
|
||||
var query = HydrateProtocolString(reqlRawString);
|
||||
return new ReqlRaw(query);
|
||||
}
|
||||
|
||||
|
||||
private static ReqlAst HookFuncTypes(object val, List<Guid> context)
|
||||
{
|
||||
var del = val as Delegate;
|
||||
if( del != null )
|
||||
{
|
||||
return Func.Serialize(del, context);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 97581729a9e4faf43bd2272864fd6bc7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Net.JsonConverters;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
public partial class TopLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// Type-safe helper method for R.Iso8601
|
||||
/// </summary>
|
||||
public Iso8601 Iso8601(DateTime? datetime)
|
||||
{
|
||||
var str = datetime?.ToString("o");
|
||||
return Ast.Iso8601.FromString(str);
|
||||
}
|
||||
/// <summary>
|
||||
/// Type-safe helper method for R.Iso8601
|
||||
/// </summary>
|
||||
public Iso8601 Iso8601(DateTimeOffset? datetime)
|
||||
{
|
||||
var str = datetime?.ToString("o");
|
||||
return Ast.Iso8601.FromString(str);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Type-safe helper for R.EpochTime
|
||||
/// </summary>
|
||||
public EpochTime EpochTime(DateTime? datetime)
|
||||
{
|
||||
var ticks = datetime?.ToUniversalTime().Ticks;
|
||||
var epoch = ReqlDateTimeConverter.ToUnixTime(ticks.Value);
|
||||
return EpochTime(epoch);
|
||||
}
|
||||
/// <summary>
|
||||
/// Type-safe helper for R.EpochTime
|
||||
/// </summary>
|
||||
public EpochTime EpochTime(DateTimeOffset? datetime)
|
||||
{
|
||||
var ticks = datetime?.UtcTicks;
|
||||
var epoch = ReqlDateTimeConverter.ToUnixTime(ticks.Value);
|
||||
return EpochTime(epoch);
|
||||
}
|
||||
|
||||
public ReqlRawExpr FromRawString(string reqlRawString)
|
||||
{
|
||||
var rawProtocol = ReqlRaw.HydrateProtocolString(reqlRawString);
|
||||
return new ReqlRawExpr(rawProtocol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d17489d39926b8b4096c3d0f3d00600c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
142
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/Util.cs
Normal file
142
Assets/Scripts/ServerShared/NIH/RethinkDb.Driver/Ast/Util.cs
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RethinkDb.Driver.Model;
|
||||
|
||||
namespace RethinkDb.Driver.Ast
|
||||
{
|
||||
internal static class Util
|
||||
{
|
||||
public static ReqlAst ToReqlAst(object val)
|
||||
{
|
||||
return ToReqlAst(val, 100, null);
|
||||
}
|
||||
public static ReqlAst ToReqlAst(object val, Func<object, ReqlAst> hook)
|
||||
{
|
||||
return ToReqlAst(val, 100, hook);
|
||||
}
|
||||
|
||||
public static ReqlExpr ToReqlExpr(object val)
|
||||
{
|
||||
var converted = ToReqlAst(val);
|
||||
var reqlAst = converted as ReqlExpr;
|
||||
if( !ReferenceEquals(reqlAst, null) )
|
||||
{
|
||||
return reqlAst;
|
||||
}
|
||||
throw new ReqlDriverError($"Cannot convert {val} to ReqlExpr");
|
||||
}
|
||||
|
||||
private static ReqlAst ToReqlAst(object val, int remainingDepth, Func<object, ReqlAst> hook = null )
|
||||
{
|
||||
if( remainingDepth <= 0 )
|
||||
{
|
||||
throw new ReqlDriverCompileError("Recursion limit reached converting to ReqlAst");
|
||||
}
|
||||
if( hook != null )
|
||||
{
|
||||
var converted = hook(val);
|
||||
if( !ReferenceEquals(converted, null) )
|
||||
{
|
||||
return converted;
|
||||
}
|
||||
}
|
||||
var ast = val as ReqlAst;
|
||||
if( !ReferenceEquals(ast, null) )
|
||||
{
|
||||
return ast;
|
||||
}
|
||||
|
||||
if( val is JToken token )
|
||||
{
|
||||
return new Poco(token);
|
||||
}
|
||||
|
||||
if( val is IList lst )
|
||||
{
|
||||
Arguments innerValues = new Arguments();
|
||||
foreach( object innerValue in lst )
|
||||
{
|
||||
innerValues.Add(ToReqlAst(innerValue, remainingDepth - 1));
|
||||
}
|
||||
return new MakeArray(innerValues, null);
|
||||
}
|
||||
|
||||
if( val is IDictionary dict )
|
||||
{
|
||||
var obj = new Dictionary<string, ReqlAst>();
|
||||
foreach( var keyObj in dict.Keys )
|
||||
{
|
||||
var key = keyObj as string;
|
||||
if( key == null )
|
||||
{
|
||||
throw new ReqlDriverCompileError("Object keys can only be strings");
|
||||
}
|
||||
|
||||
obj[key] = ToReqlAst(dict[keyObj]);
|
||||
}
|
||||
return MakeObj.fromMap(obj);
|
||||
}
|
||||
|
||||
if( val is Delegate del )
|
||||
{
|
||||
return Func.FromLambda(del);
|
||||
}
|
||||
|
||||
var dt = val as DateTime?;
|
||||
if( dt != null )
|
||||
{
|
||||
return new Poco(dt);
|
||||
}
|
||||
var dto = val as DateTimeOffset?;
|
||||
if( dto != null )
|
||||
{
|
||||
return new Poco(dto);
|
||||
}
|
||||
|
||||
var @int = val as int?;
|
||||
if( @int != null )
|
||||
{
|
||||
return new Datum(@int);
|
||||
}
|
||||
|
||||
if( IsNumber(val) )
|
||||
{
|
||||
return new Datum(val);
|
||||
}
|
||||
|
||||
var @bool = val as bool?;
|
||||
if( @bool != null )
|
||||
{
|
||||
return new Datum(@bool);
|
||||
}
|
||||
|
||||
if( val is string str )
|
||||
{
|
||||
return new Datum(str);
|
||||
}
|
||||
if( val == null )
|
||||
{
|
||||
return new Datum(null);
|
||||
}
|
||||
|
||||
return new Poco(val);
|
||||
}
|
||||
|
||||
public static bool IsNumber(object value)
|
||||
{
|
||||
return value is sbyte
|
||||
|| value is byte //maybe have char here?
|
||||
|| value is short
|
||||
|| value is ushort
|
||||
|| value is int
|
||||
|| value is uint
|
||||
|| value is long
|
||||
|| value is ulong
|
||||
|| value is float
|
||||
|| value is double
|
||||
|| value is decimal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 82410c8fb9920e940aa61c94125dd688
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
|
||||
namespace RethinkDb.Driver
|
||||
{
|
||||
internal class ErrorBuilder
|
||||
{
|
||||
internal string Msg { get; }
|
||||
internal ResponseType? ResponseType { get; }
|
||||
internal Backtrace Backtrace { get; set; }
|
||||
internal ErrorType? ErrorType { get; set; }
|
||||
internal ReqlAst Term { get; set; }
|
||||
|
||||
public ErrorBuilder(string msg, ResponseType responseType)
|
||||
{
|
||||
this.Msg = msg;
|
||||
this.ResponseType = responseType;
|
||||
}
|
||||
|
||||
public virtual ErrorBuilder SetBacktrace(Backtrace backtrace)
|
||||
{
|
||||
this.Backtrace = backtrace;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual ErrorBuilder SetErrorType(ErrorType errorType)
|
||||
{
|
||||
this.ErrorType = errorType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual ErrorBuilder SetTerm(Query query)
|
||||
{
|
||||
this.Term = query.Term;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual ReqlError Build()
|
||||
{
|
||||
ReqlError con;
|
||||
switch( ResponseType )
|
||||
{
|
||||
case Proto.ResponseType.CLIENT_ERROR:
|
||||
con = new ReqlClientError(Msg);
|
||||
break;
|
||||
case Proto.ResponseType.COMPILE_ERROR:
|
||||
con = new ReqlServerCompileError(Msg);
|
||||
break;
|
||||
case Proto.ResponseType.RUNTIME_ERROR:
|
||||
{
|
||||
switch( ErrorType )
|
||||
{
|
||||
case Proto.ErrorType.INTERNAL:
|
||||
con = new ReqlInternalError(Msg);
|
||||
break;
|
||||
case Proto.ErrorType.RESOURCE_LIMIT:
|
||||
con = new ReqlResourceLimitError(Msg);
|
||||
break;
|
||||
case Proto.ErrorType.QUERY_LOGIC:
|
||||
con = new ReqlQueryLogicError(Msg);
|
||||
break;
|
||||
case Proto.ErrorType.NON_EXISTENCE:
|
||||
con = new ReqlNonExistenceError(Msg);
|
||||
break;
|
||||
case Proto.ErrorType.OP_FAILED:
|
||||
con = new ReqlOpFailedError(Msg);
|
||||
break;
|
||||
case Proto.ErrorType.OP_INDETERMINATE:
|
||||
con = new ReqlOpIndeterminateError(Msg);
|
||||
break;
|
||||
case Proto.ErrorType.USER:
|
||||
con = new ReqlUserError(Msg);
|
||||
break;
|
||||
case Proto.ErrorType.PERMISSION_ERROR:
|
||||
con = new ReqlPermissionError(Msg);
|
||||
break;
|
||||
default:
|
||||
con = new ReqlRuntimeError(Msg);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
con = new ReqlError(Msg);
|
||||
break;
|
||||
}
|
||||
|
||||
con.Backtrace = this.Backtrace;
|
||||
con.Term = this.Term;
|
||||
|
||||
return con;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0c527493cc42ca048966cf4d2da9aed2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bdf576eeb0526ec4aad06928661a909c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 67b37b717eafc6542b57ccd0eb51a695
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace RethinkDb.Driver.Extras.Dao
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for Document of IdT
|
||||
/// </summary>
|
||||
/// <typeparam name="IdT">Type of ID property</typeparam>
|
||||
public interface IDocument<IdT>
|
||||
{
|
||||
/// <summary>
|
||||
/// The Id of the document
|
||||
/// </summary>
|
||||
IdT Id { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// All Documents (aka. domain objects / entities) should derive from Document of IdT
|
||||
/// </summary>
|
||||
/// <typeparam name="IdT">Type of Id property</typeparam>
|
||||
public abstract class Document<IdT> : IDocument<IdT>
|
||||
{
|
||||
/// <summary>
|
||||
/// The Id of the document
|
||||
/// </summary>
|
||||
[JsonProperty("id",
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public virtual IdT Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 09071cad0d60ac147aa6867358676b9e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
namespace RethinkDb.Driver.Extras.Dao
|
||||
{
|
||||
/// <summary>
|
||||
/// Document Access Object interface
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Document entity</typeparam>
|
||||
/// <typeparam name="IdT">Type of Id property</typeparam>
|
||||
public interface IDao<T, IdT>
|
||||
{
|
||||
/// <summary>
|
||||
/// Get a document by Id.
|
||||
/// </summary>
|
||||
T GetById(IdT id);
|
||||
|
||||
/// <summary>
|
||||
/// Get a document by Id.
|
||||
/// </summary>
|
||||
Task<T> GetByIdAsync(IdT id);
|
||||
|
||||
///// <summary>
|
||||
///// Get all documents by Id
|
||||
///// </summary>
|
||||
///// <param name="ids">The Ids of the documents</param>
|
||||
//IEnumerable<T> GetAllById(params IdT[] ids);
|
||||
|
||||
/// <summary>
|
||||
/// Save document. If the document exists, an exception will be thrown. Returns and deserializes the returned document.
|
||||
/// </summary>
|
||||
/// <returns>Returns and deserializes the returned document</returns>
|
||||
T Save(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Save document. If the document exists, an exception will be thrown. Returns and deserializes the returned document.
|
||||
/// </summary>
|
||||
/// <returns>Returns and deserializes the returned document</returns>
|
||||
Task<T> SaveAsync(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing document. If the document does not exist, an exception will be thrown.
|
||||
/// </summary>
|
||||
void Update(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing document. If the document does not exist, an exception will be thrown.
|
||||
/// </summary>
|
||||
Task UpdateAsync(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Saves or updates a document. If the document doesn't exist, it will be saved. If the document exists, it will be updated.
|
||||
/// </summary>
|
||||
/// <param name="doc"></param>
|
||||
T SaveOrUpdate(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Saves or updates a document. If the document doesn't exist, it will be saved. If the document exists, it will be updated.
|
||||
/// </summary>
|
||||
/// <param name="doc"></param>
|
||||
Task<T> SaveOrUpdateAsync(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a document.
|
||||
/// </summary>
|
||||
void Delete(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a document.
|
||||
/// </summary>
|
||||
Task DeleteAsync(T doc);
|
||||
|
||||
/// <summary>
|
||||
/// Delete a document by Id.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
void DeleteById(IdT id);
|
||||
|
||||
/// <summary>
|
||||
/// Delete a document by Id.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
Task DeleteByIdAsync(IdT id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b2c7d437869a40c418b05f65cff8eb6f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,209 @@
|
|||
using System.Threading.Tasks;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Net;
|
||||
using RethinkDb.Driver.Utils;
|
||||
|
||||
namespace RethinkDb.Driver.Extras.Dao
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic Document Access Object for RethinkDB
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of Document (aka. domain object / entity)</typeparam>
|
||||
/// <typeparam name="IdT">The type of the Id property in Document</typeparam>
|
||||
public abstract class RethinkDao<T, IdT> : IDao<T, IdT> where T : IDocument<IdT>
|
||||
{
|
||||
/// <summary>
|
||||
/// RethinkDB query root.
|
||||
/// </summary>
|
||||
protected static readonly RethinkDB R = RethinkDB.R;
|
||||
/// <summary>
|
||||
/// RethinkDB connection
|
||||
/// </summary>
|
||||
protected readonly IConnection conn;
|
||||
/// <summary>
|
||||
/// RethinkDB database name
|
||||
/// </summary>
|
||||
protected readonly string DbName;
|
||||
/// <summary>
|
||||
/// RethinkDB table name
|
||||
/// </summary>
|
||||
protected readonly string TableName;
|
||||
/// <summary>
|
||||
/// Table AST term used to build queries stating at the table term.
|
||||
/// </summary>
|
||||
protected readonly Table Table;
|
||||
|
||||
private readonly object returnChanges;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor for <see cref="RethinkDao{T,IdT}"/>
|
||||
/// </summary>
|
||||
/// <param name="conn">The connection</param>
|
||||
/// <param name="dbName">The database</param>
|
||||
/// <param name="tableName">The table</param>
|
||||
protected RethinkDao(IConnection conn, string dbName, string tableName)
|
||||
{
|
||||
this.conn = conn;
|
||||
this.DbName = dbName;
|
||||
this.TableName = tableName;
|
||||
this.Table = R.Db(dbName).Table(tableName);
|
||||
|
||||
this.returnChanges = new { return_changes = true};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a document by Id.
|
||||
/// </summary>
|
||||
public virtual T GetById(IdT id)
|
||||
{
|
||||
return GetByIdAsync(id).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a document by Id.
|
||||
/// </summary>
|
||||
public virtual Task<T> GetByIdAsync(IdT id)
|
||||
{
|
||||
return this.Table.Get(id).RunAtomAsync<T>(conn);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Save document. If the document exists, an exception will be thrown. Returns and deserializes the returned document.
|
||||
/// </summary>
|
||||
/// <returns>Returns and deserializes the returned document</returns>
|
||||
public virtual T Save(T doc)
|
||||
{
|
||||
return SaveAsync(doc).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save document. If the document exists, an exception will be thrown. Returns and deserializes the returned document.
|
||||
/// </summary>
|
||||
/// <returns>Returns and deserializes the returned document</returns>
|
||||
public virtual async Task<T> SaveAsync(T doc)
|
||||
{
|
||||
var result = await this.Table
|
||||
.Insert(doc)[returnChanges].OptArg("conflict", "error")
|
||||
.RunWriteAsync(conn)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
result.AssertNoErrors();
|
||||
result.AssertInserted(1);
|
||||
return result.ChangesAs<T>()[0].NewValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing document. If the document does not exist, an exception will be thrown.
|
||||
/// </summary>
|
||||
public virtual void Update(T doc)
|
||||
{
|
||||
//var result = this.Table
|
||||
// .Get(doc.Id)
|
||||
// .Update(doc)
|
||||
// .RunResult(conn);
|
||||
|
||||
//var result = this.Table
|
||||
// .Replace(doc)
|
||||
// .RunResult(conn);
|
||||
|
||||
//var result = this.Table
|
||||
// .Get(doc.Id)
|
||||
// .Replace(dbDoc =>
|
||||
// R.Branch(dbDoc == null,
|
||||
// R.Error("The document doesn't exist"),
|
||||
// doc
|
||||
// )).RunResult(conn);
|
||||
|
||||
UpdateAsync(doc).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an existing document. If the document does not exist, an exception will be thrown.
|
||||
/// </summary>
|
||||
public virtual async Task UpdateAsync(T doc)
|
||||
{
|
||||
var result = await this.Table
|
||||
.GetAll(doc.Id).OptArg("index", "id")
|
||||
.Replace(doc)
|
||||
.RunWriteAsync(conn)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
result.AssertNoErrors();
|
||||
result.AssertReplaced(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves or updates a document. If the document doesn't exist, it will be saved. If the document exists, it will be updated.
|
||||
/// </summary>
|
||||
/// <param name="doc"></param>
|
||||
public virtual T SaveOrUpdate(T doc)
|
||||
{
|
||||
return SaveOrUpdateAsync(doc).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves or updates a document. If the document doesn't exist, it will be saved. If the document exists, it will be updated.
|
||||
/// </summary>
|
||||
/// <param name="doc"></param>
|
||||
public virtual async Task<T> SaveOrUpdateAsync(T doc)
|
||||
{
|
||||
var result = await this.Table
|
||||
.Insert(doc)[returnChanges].OptArg("conflict", "replace")
|
||||
.RunWriteAsync(conn)
|
||||
.ConfigureAwait(false);
|
||||
|
||||
result.AssertNoErrors();
|
||||
|
||||
if (result.Inserted != 0)
|
||||
{
|
||||
result.AssertInserted(1);
|
||||
return result.ChangesAs<T>()[0].NewValue;
|
||||
}
|
||||
if (result.Replaced != 0)
|
||||
{
|
||||
result.AssertReplaced(1);
|
||||
return result.ChangesAs<T>()[0].NewValue;
|
||||
}
|
||||
throw new ReqlAssertFailure($"{nameof(SaveOrUpdate)} failed.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a document.
|
||||
/// </summary>
|
||||
public virtual void Delete(T doc)
|
||||
{
|
||||
DeleteAsync(doc).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a document.
|
||||
/// </summary>
|
||||
public virtual Task DeleteAsync(T doc)
|
||||
{
|
||||
return DeleteByIdAsync(doc.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete a document by Id.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public virtual void DeleteById(IdT id)
|
||||
{
|
||||
DeleteByIdAsync(id).WaitSync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete a document by Id.
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
public virtual async Task DeleteByIdAsync(IdT id)
|
||||
{
|
||||
var result = await this.Table.Get(id).Delete()
|
||||
.RunWriteAsync(conn)
|
||||
.ConfigureAwait(false);
|
||||
result.AssertDeleted(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 45ae3fa4f7844354da676c3514ffd884
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 79d0998775a84784eaa71b9cea3eda20
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1dfaee0af6b1bf140b15b8040457e585
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Add : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Sum two or more numbers, or concatenate two or more strings or arrays.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: It's as easy as 2 + 2 = 4.</para>
|
||||
/// <code>> r.expr(2).add(2).run(conn, callback)
|
||||
/// // result passed to callback
|
||||
/// 4
|
||||
/// </code></example>
|
||||
public Add (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Sum two or more numbers, or concatenate two or more strings or arrays.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: It's as easy as 2 + 2 = 4.</para>
|
||||
/// <code>> r.expr(2).add(2).run(conn, callback)
|
||||
/// // result passed to callback
|
||||
/// 4
|
||||
/// </code></example>
|
||||
public Add (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Sum two or more numbers, or concatenate two or more strings or arrays.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: It's as easy as 2 + 2 = 4.</para>
|
||||
/// <code>> r.expr(2).add(2).run(conn, callback)
|
||||
/// // result passed to callback
|
||||
/// 4
|
||||
/// </code></example>
|
||||
public Add (Arguments args, OptArgs optargs)
|
||||
: base(TermType.ADD, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 465c0991b25e7044385435b80b91ab43
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class And : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Compute the logical "and" of one or more values.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return whether both <code>a</code> and <code>b</code> evaluate to true.</para>
|
||||
/// <code>var a = true, b = false;
|
||||
/// r.expr(a).and(b).run(conn, callback);
|
||||
/// // result passed to callback
|
||||
/// false
|
||||
/// </code></example>
|
||||
public And (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Compute the logical "and" of one or more values.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return whether both <code>a</code> and <code>b</code> evaluate to true.</para>
|
||||
/// <code>var a = true, b = false;
|
||||
/// r.expr(a).and(b).run(conn, callback);
|
||||
/// // result passed to callback
|
||||
/// false
|
||||
/// </code></example>
|
||||
public And (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Compute the logical "and" of one or more values.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return whether both <code>a</code> and <code>b</code> evaluate to true.</para>
|
||||
/// <code>var a = true, b = false;
|
||||
/// r.expr(a).and(b).run(conn, callback);
|
||||
/// // result passed to callback
|
||||
/// false
|
||||
/// </code></example>
|
||||
public And (Arguments args, OptArgs optargs)
|
||||
: base(TermType.AND, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fc869d802abbc534a8808262584a7047
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Append : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Append a value to an array.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve Iron Man's equipment list with the addition of some new boots.</para>
|
||||
/// <code>r.table('marvel').get('IronMan')('equipment').append('newBoots').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Append (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Append a value to an array.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve Iron Man's equipment list with the addition of some new boots.</para>
|
||||
/// <code>r.table('marvel').get('IronMan')('equipment').append('newBoots').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Append (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Append a value to an array.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve Iron Man's equipment list with the addition of some new boots.</para>
|
||||
/// <code>r.table('marvel').get('IronMan')('equipment').append('newBoots').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Append (Arguments args, OptArgs optargs)
|
||||
: base(TermType.APPEND, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba1741c071b147146b5aad68fac3a849
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class April : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
public April (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
public April (Arguments args) : this(args, null) {
|
||||
}
|
||||
public April (Arguments args, OptArgs optargs)
|
||||
: base(TermType.APRIL, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f12ae87b2a23d454cae2209e9a3b0a8f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Args : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para><code>r.args</code> is a special term that's used to splice an array of arguments
|
||||
/// into another term. This is useful when you want to call a variadic
|
||||
/// term such as <a href="/api/javascript/get_all/">getAll</a> with a set of arguments produced at runtime.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get Alice and Bob from the table <code>people</code>.</para>
|
||||
/// <code>r.table('people').getAll('Alice', 'Bob').run(conn, callback)
|
||||
/// // or
|
||||
/// r.table('people').getAll(r.args(['Alice', 'Bob'])).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Args (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para><code>r.args</code> is a special term that's used to splice an array of arguments
|
||||
/// into another term. This is useful when you want to call a variadic
|
||||
/// term such as <a href="/api/javascript/get_all/">getAll</a> with a set of arguments produced at runtime.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get Alice and Bob from the table <code>people</code>.</para>
|
||||
/// <code>r.table('people').getAll('Alice', 'Bob').run(conn, callback)
|
||||
/// // or
|
||||
/// r.table('people').getAll(r.args(['Alice', 'Bob'])).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Args (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para><code>r.args</code> is a special term that's used to splice an array of arguments
|
||||
/// into another term. This is useful when you want to call a variadic
|
||||
/// term such as <a href="/api/javascript/get_all/">getAll</a> with a set of arguments produced at runtime.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get Alice and Bob from the table <code>people</code>.</para>
|
||||
/// <code>r.table('people').getAll('Alice', 'Bob').run(conn, callback)
|
||||
/// // or
|
||||
/// r.table('people').getAll(r.args(['Alice', 'Bob'])).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Args (Arguments args, OptArgs optargs)
|
||||
: base(TermType.ARGS, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 38738fd8ca104444f9473c2f23941efe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Asc : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
public Asc (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
public Asc (Arguments args) : this(args, null) {
|
||||
}
|
||||
public Asc (Arguments args, OptArgs optargs)
|
||||
: base(TermType.ASC, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: aa697ab4c4aa52e46874a867edc7aeb5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class August : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
public August (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
public August (Arguments args) : this(args, null) {
|
||||
}
|
||||
public August (Arguments args, OptArgs optargs)
|
||||
: base(TermType.AUGUST, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3cf9cf35938ba744a8bd9960478087c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Avg : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Averages all the elements of a sequence. If called with a field name,
|
||||
/// averages all the values of that field in the sequence, skipping
|
||||
/// elements of the sequence that lack that field. If called with a
|
||||
/// function, calls that function on every element of the sequence and
|
||||
/// averages the results, skipping elements of the sequence where that
|
||||
/// function returns <code>null</code> or a non-existence error.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: What's the average of 3, 5, and 7?</para>
|
||||
/// <code>r.expr([3, 5, 7]).avg().run(conn, callback)
|
||||
/// </code></example>
|
||||
public Avg (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Averages all the elements of a sequence. If called with a field name,
|
||||
/// averages all the values of that field in the sequence, skipping
|
||||
/// elements of the sequence that lack that field. If called with a
|
||||
/// function, calls that function on every element of the sequence and
|
||||
/// averages the results, skipping elements of the sequence where that
|
||||
/// function returns <code>null</code> or a non-existence error.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: What's the average of 3, 5, and 7?</para>
|
||||
/// <code>r.expr([3, 5, 7]).avg().run(conn, callback)
|
||||
/// </code></example>
|
||||
public Avg (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Averages all the elements of a sequence. If called with a field name,
|
||||
/// averages all the values of that field in the sequence, skipping
|
||||
/// elements of the sequence that lack that field. If called with a
|
||||
/// function, calls that function on every element of the sequence and
|
||||
/// averages the results, skipping elements of the sequence where that
|
||||
/// function returns <code>null</code> or a non-existence error.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: What's the average of 3, 5, and 7?</para>
|
||||
/// <code>r.expr([3, 5, 7]).avg().run(conn, callback)
|
||||
/// </code></example>
|
||||
public Avg (Arguments args, OptArgs optargs)
|
||||
: base(TermType.AVG, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4051480d1182c4a4eb5cfc50fd022d5b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Between : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Get all documents between two keys. Accepts three optional arguments: <code>index</code>, <code>leftBound</code>, and <code>rightBound</code>. If <code>index</code> is set to the name of a secondary index, <code>between</code> will return all documents where that index's value is in the specified range (it uses the primary key by default). <code>leftBound</code> or <code>rightBound</code> may be set to <code>open</code> or <code>closed</code> to indicate whether or not to include that endpoint of the range (by default, <code>leftBound</code> is closed and <code>rightBound</code> is open).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Find all users with primary key >= 10 and < 20 (a normal half-open interval).</para>
|
||||
/// <code>r.table('marvel').between(10, 20).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Between (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Get all documents between two keys. Accepts three optional arguments: <code>index</code>, <code>leftBound</code>, and <code>rightBound</code>. If <code>index</code> is set to the name of a secondary index, <code>between</code> will return all documents where that index's value is in the specified range (it uses the primary key by default). <code>leftBound</code> or <code>rightBound</code> may be set to <code>open</code> or <code>closed</code> to indicate whether or not to include that endpoint of the range (by default, <code>leftBound</code> is closed and <code>rightBound</code> is open).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Find all users with primary key >= 10 and < 20 (a normal half-open interval).</para>
|
||||
/// <code>r.table('marvel').between(10, 20).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Between (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Get all documents between two keys. Accepts three optional arguments: <code>index</code>, <code>leftBound</code>, and <code>rightBound</code>. If <code>index</code> is set to the name of a secondary index, <code>between</code> will return all documents where that index's value is in the specified range (it uses the primary key by default). <code>leftBound</code> or <code>rightBound</code> may be set to <code>open</code> or <code>closed</code> to indicate whether or not to include that endpoint of the range (by default, <code>leftBound</code> is closed and <code>rightBound</code> is open).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Find all users with primary key >= 10 and < 20 (a normal half-open interval).</para>
|
||||
/// <code>r.table('marvel').between(10, 20).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Between (Arguments args, OptArgs optargs)
|
||||
: base(TermType.BETWEEN, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///<summary>
|
||||
/// "index": "T_STR",
|
||||
/// "left_bound": "E_BOUND",
|
||||
/// "right_bound": "E_BOUND"
|
||||
///</summary>
|
||||
public Between this[object optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Between (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "index": "T_STR",
|
||||
/// "left_bound": "E_BOUND",
|
||||
/// "right_bound": "E_BOUND"
|
||||
///</summary>
|
||||
public Between this[OptArgs optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Between (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "index": "T_STR",
|
||||
/// "left_bound": "E_BOUND",
|
||||
/// "right_bound": "E_BOUND"
|
||||
///</summary>
|
||||
public Between OptArg(string key, object val){
|
||||
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(key, val);
|
||||
|
||||
return new Between (this.Args, newOptArgs);
|
||||
}
|
||||
internal Between optArg(string key, object val){
|
||||
|
||||
return this.OptArg(key, val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7d82803a53fcb744b990bc45411897d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using RethinkDb.Driver.Net;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Binary : ReqlExpr {
|
||||
|
||||
|
||||
byte[] b64Data = null;
|
||||
|
||||
|
||||
|
||||
public Binary (byte[] bytes) : this(new Arguments()){
|
||||
b64Data = bytes;
|
||||
}
|
||||
public Binary (Object arg) : this(new Arguments(arg), null) {
|
||||
|
||||
}
|
||||
public Binary (Arguments args) : this(args, null){
|
||||
|
||||
}
|
||||
public Binary (Arguments args, OptArgs optargs) : this(TermType.BINARY, args, optargs) {
|
||||
|
||||
}
|
||||
protected Binary (TermType termType, Arguments args, OptArgs optargs) : base(termType, args, optargs){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected internal override object Build() {
|
||||
if( b64Data != null){
|
||||
return JObject.FromObject(b64Data, Converter.Serializer);
|
||||
}
|
||||
else{
|
||||
return base.Build();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eeec98913b0f76947a1700dc6c948a11
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Bracket : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: What was Iron Man's first appearance in a comic?</para>
|
||||
/// <code>r.table('marvel').get('IronMan')('firstAppearance').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Bracket (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: What was Iron Man's first appearance in a comic?</para>
|
||||
/// <code>r.table('marvel').get('IronMan')('firstAppearance').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Bracket (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: What was Iron Man's first appearance in a comic?</para>
|
||||
/// <code>r.table('marvel').get('IronMan')('firstAppearance').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Bracket (Arguments args, OptArgs optargs)
|
||||
: base(TermType.BRACKET, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 85e518f86fcdb7740b26bcfd79228796
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Branch : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Perform a branching conditional equivalent to <code>if-then-else</code>.</para>
|
||||
/// <para>The <code>branch</code> command takes 2n+1 arguments: pairs of conditional expressions and commands to be executed if the conditionals return any value but <code>false</code> or <code>null</code> (i.e., "truthy" values), with a final "else" command to be evaluated if all of the conditionals are <code>false</code> or <code>null</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Test the value of x.</para>
|
||||
/// <code>var x = 10;
|
||||
/// r.branch(r.expr(x).gt(5), 'big', 'small').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// "big"
|
||||
/// </code></example>
|
||||
public Branch (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Perform a branching conditional equivalent to <code>if-then-else</code>.</para>
|
||||
/// <para>The <code>branch</code> command takes 2n+1 arguments: pairs of conditional expressions and commands to be executed if the conditionals return any value but <code>false</code> or <code>null</code> (i.e., "truthy" values), with a final "else" command to be evaluated if all of the conditionals are <code>false</code> or <code>null</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Test the value of x.</para>
|
||||
/// <code>var x = 10;
|
||||
/// r.branch(r.expr(x).gt(5), 'big', 'small').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// "big"
|
||||
/// </code></example>
|
||||
public Branch (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Perform a branching conditional equivalent to <code>if-then-else</code>.</para>
|
||||
/// <para>The <code>branch</code> command takes 2n+1 arguments: pairs of conditional expressions and commands to be executed if the conditionals return any value but <code>false</code> or <code>null</code> (i.e., "truthy" values), with a final "else" command to be evaluated if all of the conditionals are <code>false</code> or <code>null</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Test the value of x.</para>
|
||||
/// <code>var x = 10;
|
||||
/// r.branch(r.expr(x).gt(5), 'big', 'small').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// "big"
|
||||
/// </code></example>
|
||||
public Branch (Arguments args, OptArgs optargs)
|
||||
: base(TermType.BRANCH, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7128464e5d72b744ab1bdb56ad23e1be
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Ceil : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Rounds the given value up, returning the smallest integer value greater than or equal to the given value (the value's ceiling).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return the ceiling of 12.345.</para>
|
||||
/// <code>r.ceil(12.345).run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// 13.0
|
||||
/// </code>
|
||||
/// <para>The <code>ceil</code> command can also be chained after an expression.</para></example>
|
||||
public Ceil (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Rounds the given value up, returning the smallest integer value greater than or equal to the given value (the value's ceiling).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return the ceiling of 12.345.</para>
|
||||
/// <code>r.ceil(12.345).run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// 13.0
|
||||
/// </code>
|
||||
/// <para>The <code>ceil</code> command can also be chained after an expression.</para></example>
|
||||
public Ceil (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Rounds the given value up, returning the smallest integer value greater than or equal to the given value (the value's ceiling).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return the ceiling of 12.345.</para>
|
||||
/// <code>r.ceil(12.345).run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// 13.0
|
||||
/// </code>
|
||||
/// <para>The <code>ceil</code> command can also be chained after an expression.</para></example>
|
||||
public Ceil (Arguments args, OptArgs optargs)
|
||||
: base(TermType.CEIL, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a93426b03697df541ba28166ed585a23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class ChangeAt : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Change a value in an array at a given index. Returns the modified array.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Bruce Banner hulks out.</para>
|
||||
/// <code>r.expr(["Iron Man", "Bruce", "Spider-Man"]).changeAt(1, "Hulk").run(conn, callback)
|
||||
/// </code></example>
|
||||
public ChangeAt (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Change a value in an array at a given index. Returns the modified array.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Bruce Banner hulks out.</para>
|
||||
/// <code>r.expr(["Iron Man", "Bruce", "Spider-Man"]).changeAt(1, "Hulk").run(conn, callback)
|
||||
/// </code></example>
|
||||
public ChangeAt (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Change a value in an array at a given index. Returns the modified array.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Bruce Banner hulks out.</para>
|
||||
/// <code>r.expr(["Iron Man", "Bruce", "Spider-Man"]).changeAt(1, "Hulk").run(conn, callback)
|
||||
/// </code></example>
|
||||
public ChangeAt (Arguments args, OptArgs optargs)
|
||||
: base(TermType.CHANGE_AT, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5e4aedd14cf06524e8b89fdccc7a987a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Changes : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Turn a query into a changefeed, an infinite stream of objects representing changes to the query's results as they occur. A changefeed may return changes to a table or an individual document (a "point" changefeed). Commands such as <code>filter</code> or <code>map</code> may be used before the <code>changes</code> command to transform or filter the output, and many commands that operate on sequences can be chained after <code>changes</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Subscribe to the changes on a table.</para>
|
||||
/// <para>Start monitoring the changefeed in one client:</para>
|
||||
/// <code>r.table('games').changes().run(conn, function(err, cursor) {
|
||||
/// cursor.each(console.log);
|
||||
/// });
|
||||
/// </code>
|
||||
/// <para>As these queries are performed in a second client, the first
|
||||
/// client would receive and print the following objects:</para>
|
||||
/// <code>> r.table('games').insert({id: 1}).run(conn, callback);
|
||||
/// {old_val: null, new_val: {id: 1}}
|
||||
///
|
||||
/// > r.table('games').get(1).update({player1: 'Bob'}).run(conn, callback);
|
||||
/// {old_val: {id: 1}, new_val: {id: 1, player1: 'Bob'}}
|
||||
///
|
||||
/// > r.table('games').get(1).replace({id: 1, player1: 'Bob', player2: 'Alice'}).run(conn, callback);
|
||||
/// {old_val: {id: 1, player1: 'Bob'},
|
||||
/// new_val: {id: 1, player1: 'Bob', player2: 'Alice'}}
|
||||
///
|
||||
/// > r.table('games').get(1).delete().run(conn, callback)
|
||||
/// {old_val: {id: 1, player1: 'Bob', player2: 'Alice'}, new_val: null}
|
||||
///
|
||||
/// > r.tableDrop('games').run(conn, callback);
|
||||
/// ReqlRuntimeError: Changefeed aborted (table unavailable)
|
||||
/// </code></example>
|
||||
public Changes (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Turn a query into a changefeed, an infinite stream of objects representing changes to the query's results as they occur. A changefeed may return changes to a table or an individual document (a "point" changefeed). Commands such as <code>filter</code> or <code>map</code> may be used before the <code>changes</code> command to transform or filter the output, and many commands that operate on sequences can be chained after <code>changes</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Subscribe to the changes on a table.</para>
|
||||
/// <para>Start monitoring the changefeed in one client:</para>
|
||||
/// <code>r.table('games').changes().run(conn, function(err, cursor) {
|
||||
/// cursor.each(console.log);
|
||||
/// });
|
||||
/// </code>
|
||||
/// <para>As these queries are performed in a second client, the first
|
||||
/// client would receive and print the following objects:</para>
|
||||
/// <code>> r.table('games').insert({id: 1}).run(conn, callback);
|
||||
/// {old_val: null, new_val: {id: 1}}
|
||||
///
|
||||
/// > r.table('games').get(1).update({player1: 'Bob'}).run(conn, callback);
|
||||
/// {old_val: {id: 1}, new_val: {id: 1, player1: 'Bob'}}
|
||||
///
|
||||
/// > r.table('games').get(1).replace({id: 1, player1: 'Bob', player2: 'Alice'}).run(conn, callback);
|
||||
/// {old_val: {id: 1, player1: 'Bob'},
|
||||
/// new_val: {id: 1, player1: 'Bob', player2: 'Alice'}}
|
||||
///
|
||||
/// > r.table('games').get(1).delete().run(conn, callback)
|
||||
/// {old_val: {id: 1, player1: 'Bob', player2: 'Alice'}, new_val: null}
|
||||
///
|
||||
/// > r.tableDrop('games').run(conn, callback);
|
||||
/// ReqlRuntimeError: Changefeed aborted (table unavailable)
|
||||
/// </code></example>
|
||||
public Changes (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Turn a query into a changefeed, an infinite stream of objects representing changes to the query's results as they occur. A changefeed may return changes to a table or an individual document (a "point" changefeed). Commands such as <code>filter</code> or <code>map</code> may be used before the <code>changes</code> command to transform or filter the output, and many commands that operate on sequences can be chained after <code>changes</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Subscribe to the changes on a table.</para>
|
||||
/// <para>Start monitoring the changefeed in one client:</para>
|
||||
/// <code>r.table('games').changes().run(conn, function(err, cursor) {
|
||||
/// cursor.each(console.log);
|
||||
/// });
|
||||
/// </code>
|
||||
/// <para>As these queries are performed in a second client, the first
|
||||
/// client would receive and print the following objects:</para>
|
||||
/// <code>> r.table('games').insert({id: 1}).run(conn, callback);
|
||||
/// {old_val: null, new_val: {id: 1}}
|
||||
///
|
||||
/// > r.table('games').get(1).update({player1: 'Bob'}).run(conn, callback);
|
||||
/// {old_val: {id: 1}, new_val: {id: 1, player1: 'Bob'}}
|
||||
///
|
||||
/// > r.table('games').get(1).replace({id: 1, player1: 'Bob', player2: 'Alice'}).run(conn, callback);
|
||||
/// {old_val: {id: 1, player1: 'Bob'},
|
||||
/// new_val: {id: 1, player1: 'Bob', player2: 'Alice'}}
|
||||
///
|
||||
/// > r.table('games').get(1).delete().run(conn, callback)
|
||||
/// {old_val: {id: 1, player1: 'Bob', player2: 'Alice'}, new_val: null}
|
||||
///
|
||||
/// > r.tableDrop('games').run(conn, callback);
|
||||
/// ReqlRuntimeError: Changefeed aborted (table unavailable)
|
||||
/// </code></example>
|
||||
public Changes (Arguments args, OptArgs optargs)
|
||||
: base(TermType.CHANGES, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///<summary>
|
||||
/// "squash": "T_BOOL",
|
||||
/// "include_states": "T_BOOL",
|
||||
/// "include_initial": "T_BOOL"
|
||||
///</summary>
|
||||
public Changes this[object optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Changes (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "squash": "T_BOOL",
|
||||
/// "include_states": "T_BOOL",
|
||||
/// "include_initial": "T_BOOL"
|
||||
///</summary>
|
||||
public Changes this[OptArgs optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Changes (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "squash": "T_BOOL",
|
||||
/// "include_states": "T_BOOL",
|
||||
/// "include_initial": "T_BOOL"
|
||||
///</summary>
|
||||
public Changes OptArg(string key, object val){
|
||||
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(key, val);
|
||||
|
||||
return new Changes (this.Args, newOptArgs);
|
||||
}
|
||||
internal Changes optArg(string key, object val){
|
||||
|
||||
return this.OptArg(key, val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e1ec8cfca8b60d847b4b3a7a9c2da36d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Circle : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Construct a circular line or polygon. A circle in RethinkDB is a polygon or line <em>approximating</em> a circle of a given radius around a given center, consisting of a specified number of vertices (default 32).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Define a circle.</para>
|
||||
/// <code>r.table('geo').insert({
|
||||
/// id: 300,
|
||||
/// name: 'Hayes Valley',
|
||||
/// neighborhood: r.circle([-122.423246,37.779388], 1000)
|
||||
/// }).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Circle (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Construct a circular line or polygon. A circle in RethinkDB is a polygon or line <em>approximating</em> a circle of a given radius around a given center, consisting of a specified number of vertices (default 32).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Define a circle.</para>
|
||||
/// <code>r.table('geo').insert({
|
||||
/// id: 300,
|
||||
/// name: 'Hayes Valley',
|
||||
/// neighborhood: r.circle([-122.423246,37.779388], 1000)
|
||||
/// }).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Circle (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Construct a circular line or polygon. A circle in RethinkDB is a polygon or line <em>approximating</em> a circle of a given radius around a given center, consisting of a specified number of vertices (default 32).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Define a circle.</para>
|
||||
/// <code>r.table('geo').insert({
|
||||
/// id: 300,
|
||||
/// name: 'Hayes Valley',
|
||||
/// neighborhood: r.circle([-122.423246,37.779388], 1000)
|
||||
/// }).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Circle (Arguments args, OptArgs optargs)
|
||||
: base(TermType.CIRCLE, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///<summary>
|
||||
/// "num_vertices": "T_EXPR",
|
||||
/// "geo_system": "E_GEO_SYSTEM",
|
||||
/// "unit": "E_UNIT",
|
||||
/// "fill": "T_BOOL"
|
||||
///</summary>
|
||||
public Circle this[object optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Circle (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "num_vertices": "T_EXPR",
|
||||
/// "geo_system": "E_GEO_SYSTEM",
|
||||
/// "unit": "E_UNIT",
|
||||
/// "fill": "T_BOOL"
|
||||
///</summary>
|
||||
public Circle this[OptArgs optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Circle (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "num_vertices": "T_EXPR",
|
||||
/// "geo_system": "E_GEO_SYSTEM",
|
||||
/// "unit": "E_UNIT",
|
||||
/// "fill": "T_BOOL"
|
||||
///</summary>
|
||||
public Circle OptArg(string key, object val){
|
||||
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(key, val);
|
||||
|
||||
return new Circle (this.Args, newOptArgs);
|
||||
}
|
||||
internal Circle optArg(string key, object val){
|
||||
|
||||
return this.OptArg(key, val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8e871819880abc742a1e4c0541eed00c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class CoerceTo : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Convert a value of one type into another.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Coerce a stream to an array to store its output in a field. (A stream cannot be stored in a field directly.)</para>
|
||||
/// <code>r.table('posts').map(function (post) {
|
||||
/// return post.merge({ comments: r.table('comments').getAll(post('id'), {index: 'postId'}).coerceTo('array')});
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public CoerceTo (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Convert a value of one type into another.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Coerce a stream to an array to store its output in a field. (A stream cannot be stored in a field directly.)</para>
|
||||
/// <code>r.table('posts').map(function (post) {
|
||||
/// return post.merge({ comments: r.table('comments').getAll(post('id'), {index: 'postId'}).coerceTo('array')});
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public CoerceTo (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Convert a value of one type into another.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Coerce a stream to an array to store its output in a field. (A stream cannot be stored in a field directly.)</para>
|
||||
/// <code>r.table('posts').map(function (post) {
|
||||
/// return post.merge({ comments: r.table('comments').getAll(post('id'), {index: 'postId'}).coerceTo('array')});
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public CoerceTo (Arguments args, OptArgs optargs)
|
||||
: base(TermType.COERCE_TO, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 51ce27b3b301be149b9cf6a4b76148c4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class ConcatMap : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Concatenate one or more elements into a single sequence using a mapping function.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Construct a sequence of all monsters defeated by Marvel heroes. The field "defeatedMonsters" is an array of one or more monster names.</para>
|
||||
/// <code>r.table('marvel').concatMap(function(hero) {
|
||||
/// return hero('defeatedMonsters')
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public ConcatMap (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Concatenate one or more elements into a single sequence using a mapping function.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Construct a sequence of all monsters defeated by Marvel heroes. The field "defeatedMonsters" is an array of one or more monster names.</para>
|
||||
/// <code>r.table('marvel').concatMap(function(hero) {
|
||||
/// return hero('defeatedMonsters')
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public ConcatMap (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Concatenate one or more elements into a single sequence using a mapping function.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Construct a sequence of all monsters defeated by Marvel heroes. The field "defeatedMonsters" is an array of one or more monster names.</para>
|
||||
/// <code>r.table('marvel').concatMap(function(hero) {
|
||||
/// return hero('defeatedMonsters')
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public ConcatMap (Arguments args, OptArgs optargs)
|
||||
: base(TermType.CONCAT_MAP, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5bc0b2beda5539f42a65b44b4cf30d2f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Config : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Query (read and/or update) the configurations for individual tables or databases.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get the configuration for the <code>users</code> table.</para>
|
||||
/// <code>> r.table('users').config().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Config (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Query (read and/or update) the configurations for individual tables or databases.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get the configuration for the <code>users</code> table.</para>
|
||||
/// <code>> r.table('users').config().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Config (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Query (read and/or update) the configurations for individual tables or databases.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get the configuration for the <code>users</code> table.</para>
|
||||
/// <code>> r.table('users').config().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Config (Arguments args, OptArgs optargs)
|
||||
: base(TermType.CONFIG, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 350d1add2e0247949a6135cb9d41b199
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Contains : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>When called with values, returns <code>true</code> if a sequence contains all the
|
||||
/// specified values. When called with predicate functions, returns <code>true</code>
|
||||
/// if for each predicate there exists at least one element of the stream
|
||||
/// where that predicate returns <code>true</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Has Iron Man ever fought Superman?</para>
|
||||
/// <code>r.table('marvel').get('ironman')('opponents').contains('superman').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Contains (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>When called with values, returns <code>true</code> if a sequence contains all the
|
||||
/// specified values. When called with predicate functions, returns <code>true</code>
|
||||
/// if for each predicate there exists at least one element of the stream
|
||||
/// where that predicate returns <code>true</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Has Iron Man ever fought Superman?</para>
|
||||
/// <code>r.table('marvel').get('ironman')('opponents').contains('superman').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Contains (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>When called with values, returns <code>true</code> if a sequence contains all the
|
||||
/// specified values. When called with predicate functions, returns <code>true</code>
|
||||
/// if for each predicate there exists at least one element of the stream
|
||||
/// where that predicate returns <code>true</code>.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Has Iron Man ever fought Superman?</para>
|
||||
/// <code>r.table('marvel').get('ironman')('opponents').contains('superman').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Contains (Arguments args, OptArgs optargs)
|
||||
: base(TermType.CONTAINS, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3c28d83d657e661468d4201919321188
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Count : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Counts the number of elements in a sequence or key/value pairs in an object, or returns the size of a string or binary object.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Count the number of users.</para>
|
||||
/// <code>r.table('users').count().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Count (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Counts the number of elements in a sequence or key/value pairs in an object, or returns the size of a string or binary object.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Count the number of users.</para>
|
||||
/// <code>r.table('users').count().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Count (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Counts the number of elements in a sequence or key/value pairs in an object, or returns the size of a string or binary object.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Count the number of users.</para>
|
||||
/// <code>r.table('users').count().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Count (Arguments args, OptArgs optargs)
|
||||
: base(TermType.COUNT, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d1e624b87a34d374285bcee7d6ff899c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Date : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Return a new time object only based on the day, month and year (ie. the same day at 00:00).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve all the users whose birthday is today.</para>
|
||||
/// <code>r.table("users").filter(function(user) {
|
||||
/// return user("birthdate").date().eq(r.now().date())
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Date (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return a new time object only based on the day, month and year (ie. the same day at 00:00).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve all the users whose birthday is today.</para>
|
||||
/// <code>r.table("users").filter(function(user) {
|
||||
/// return user("birthdate").date().eq(r.now().date())
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Date (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return a new time object only based on the day, month and year (ie. the same day at 00:00).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve all the users whose birthday is today.</para>
|
||||
/// <code>r.table("users").filter(function(user) {
|
||||
/// return user("birthdate").date().eq(r.now().date())
|
||||
/// }).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Date (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DATE, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ae97ee4cd9aad6442806c61a3f842201
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Datum : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
public Datum(object arg) : base(TermType.DATUM, null, null) {
|
||||
datum = arg;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
internal object datum;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected internal override object Build() {
|
||||
// Overridden because Datums are leaf-nodes and therefore
|
||||
// don't contain lower ReqlAst objects.
|
||||
return datum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 613d3a632cf33084e9a7fd723f18463f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Day : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Return the day of a time object as a number between 1 and 31.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return the users born on the 24th of any month.</para>
|
||||
/// <code>r.table("users").filter(
|
||||
/// r.row("birthdate").day().eq(24)
|
||||
/// ).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Day (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return the day of a time object as a number between 1 and 31.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return the users born on the 24th of any month.</para>
|
||||
/// <code>r.table("users").filter(
|
||||
/// r.row("birthdate").day().eq(24)
|
||||
/// ).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Day (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return the day of a time object as a number between 1 and 31.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return the users born on the 24th of any month.</para>
|
||||
/// <code>r.table("users").filter(
|
||||
/// r.row("birthdate").day().eq(24)
|
||||
/// ).run(conn, callback)
|
||||
/// </code></example>
|
||||
public Day (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DAY, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d6516873a602d1a41882d2b4e5374d38
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class DayOfWeek : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Return the day of week of a time object as a number between 1 and 7 (following ISO 8601 standard). For your convenience, the terms r.monday, r.tuesday etc. are defined and map to the appropriate integer.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return today's day of week.</para>
|
||||
/// <code>r.now().dayOfWeek().run(conn, callback)
|
||||
/// </code></example>
|
||||
public DayOfWeek (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return the day of week of a time object as a number between 1 and 7 (following ISO 8601 standard). For your convenience, the terms r.monday, r.tuesday etc. are defined and map to the appropriate integer.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return today's day of week.</para>
|
||||
/// <code>r.now().dayOfWeek().run(conn, callback)
|
||||
/// </code></example>
|
||||
public DayOfWeek (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return the day of week of a time object as a number between 1 and 7 (following ISO 8601 standard). For your convenience, the terms r.monday, r.tuesday etc. are defined and map to the appropriate integer.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return today's day of week.</para>
|
||||
/// <code>r.now().dayOfWeek().run(conn, callback)
|
||||
/// </code></example>
|
||||
public DayOfWeek (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DAY_OF_WEEK, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e8155c9543cb17740b6a01774aa749a4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class DayOfYear : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Return the day of the year of a time object as a number between 1 and 366 (following ISO 8601 standard).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve all the users who were born the first day of a year.</para>
|
||||
/// <code>r.table("users").filter(
|
||||
/// r.row("birthdate").dayOfYear().eq(1)
|
||||
/// )
|
||||
/// </code></example>
|
||||
public DayOfYear (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return the day of the year of a time object as a number between 1 and 366 (following ISO 8601 standard).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve all the users who were born the first day of a year.</para>
|
||||
/// <code>r.table("users").filter(
|
||||
/// r.row("birthdate").dayOfYear().eq(1)
|
||||
/// )
|
||||
/// </code></example>
|
||||
public DayOfYear (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Return the day of the year of a time object as a number between 1 and 366 (following ISO 8601 standard).</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve all the users who were born the first day of a year.</para>
|
||||
/// <code>r.table("users").filter(
|
||||
/// r.row("birthdate").dayOfYear().eq(1)
|
||||
/// )
|
||||
/// </code></example>
|
||||
public DayOfYear (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DAY_OF_YEAR, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b6ff27fa8d540c847ae712e7af6146cb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,302 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Db : ReqlAst {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Reference a database.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Explicitly specify a database for a query.</para>
|
||||
/// <code>r.db('heroes').table('marvel').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Db (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Reference a database.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Explicitly specify a database for a query.</para>
|
||||
/// <code>r.db('heroes').table('marvel').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Db (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Reference a database.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Explicitly specify a database for a query.</para>
|
||||
/// <code>r.db('heroes').table('marvel').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Db (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DB, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Return all documents in a table. Other commands may be chained after <code>table</code> to return a subset of documents (such as <a href="/api/javascript/get/">get</a> and <a href="/api/javascript/filter/">filter</a>) or perform further processing.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Return all documents in the table 'marvel' of the default database.</para>
|
||||
/// <code>r.table('marvel').run(conn, callback)
|
||||
/// </code></example>
|
||||
public Table Table ( Object expr )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
arguments.CoerceAndAdd(expr);
|
||||
return new Table (arguments );
|
||||
}
|
||||
internal Table table ( Object expr )
|
||||
{
|
||||
return Table ( expr );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Create a table. A RethinkDB table is a collection of JSON documents.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Create a table named 'dc_universe' with the default settings.</para>
|
||||
/// <code>> r.db('heroes').tableCreate('dc_universe').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "new_val": {
|
||||
/// "db": "test",
|
||||
/// "durability": "hard",
|
||||
/// "id": "20ea60d4-3b76-4817-8828-98a236df0297",
|
||||
/// "name": "dc_universe",
|
||||
/// "primary_key": "id",
|
||||
/// "shards": [
|
||||
/// {
|
||||
/// "primary_replica": "rethinkdb_srv1",
|
||||
/// "replicas": [
|
||||
/// "rethinkdb_srv1",
|
||||
/// "rethinkdb_srv2"
|
||||
/// ]
|
||||
/// }
|
||||
/// ],
|
||||
/// "write_acks": "majority"
|
||||
/// },
|
||||
/// "old_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "tables_created": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public TableCreate TableCreate ( Object expr )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
arguments.CoerceAndAdd(expr);
|
||||
return new TableCreate (arguments );
|
||||
}
|
||||
internal TableCreate tableCreate ( Object expr )
|
||||
{
|
||||
return TableCreate ( expr );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Drop a table from a database. The table and all its data will be deleted.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Drop a table named 'dc_universe'.</para>
|
||||
/// <code>> r.db('test').tableDrop('dc_universe').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "old_val": {
|
||||
/// "db": "test",
|
||||
/// "durability": "hard",
|
||||
/// "id": "20ea60d4-3b76-4817-8828-98a236df0297",
|
||||
/// "name": "dc_universe",
|
||||
/// "primary_key": "id",
|
||||
/// "shards": [
|
||||
/// {
|
||||
/// "primary_replica": "rethinkdb_srv1",
|
||||
/// "replicas": [
|
||||
/// "rethinkdb_srv1",
|
||||
/// "rethinkdb_srv2"
|
||||
/// ]
|
||||
/// }
|
||||
/// ],
|
||||
/// "write_acks": "majority"
|
||||
/// },
|
||||
/// "new_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "tables_dropped": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public TableDrop TableDrop ( Object expr )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
arguments.CoerceAndAdd(expr);
|
||||
return new TableDrop (arguments );
|
||||
}
|
||||
internal TableDrop tableDrop ( Object expr )
|
||||
{
|
||||
return TableDrop ( expr );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>List all table names in a database. The result is a list of strings.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: List all tables of the 'test' database.</para>
|
||||
/// <code>r.db('test').tableList().run(conn, callback)
|
||||
/// </code></example>
|
||||
public TableList TableList ( )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
return new TableList (arguments );
|
||||
}
|
||||
internal TableList tableList ( )
|
||||
{
|
||||
return TableList ( );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Query (read and/or update) the configurations for individual tables or databases.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get the configuration for the <code>users</code> table.</para>
|
||||
/// <code>> r.table('users').config().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Config Config ( )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
return new Config (arguments );
|
||||
}
|
||||
internal Config config ( )
|
||||
{
|
||||
return Config ( );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Wait for a table or all the tables in a database to be ready. A table may be temporarily unavailable after creation, rebalancing or reconfiguring. The <code>wait</code> command blocks until the given table (or database) is fully up to date.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Wait on a table to be ready.</para>
|
||||
/// <code>> r.table('superheroes').wait().run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// { "ready": 1 }
|
||||
/// </code></example>
|
||||
public Wait Wait_ ( )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
return new Wait (arguments );
|
||||
}
|
||||
internal Wait wait_ ( )
|
||||
{
|
||||
return Wait_ ( );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Reconfigure a table's sharding and replication.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Reconfigure a table.</para>
|
||||
/// <code>> r.table('superheroes').reconfigure({shards: 2, replicas: 1}).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Reconfigure Reconfigure ( )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
return new Reconfigure (arguments );
|
||||
}
|
||||
internal Reconfigure reconfigure ( )
|
||||
{
|
||||
return Reconfigure ( );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Rebalances the shards of a table. When called on a database, all the tables in that database will be rebalanced.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Rebalance a table.</para>
|
||||
/// <code>> r.table('superheroes').rebalance().run(conn, callback);
|
||||
/// </code></example>
|
||||
public Rebalance Rebalance ( )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
return new Rebalance (arguments );
|
||||
}
|
||||
internal Rebalance rebalance ( )
|
||||
{
|
||||
return Rebalance ( );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Grant or deny access permissions for a user account, globally or on a per-database or per-table basis.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Grant the <code>chatapp</code> user account read and write permissions on the <code>users</code> database.</para>
|
||||
/// <code>r.db('users').grant('chatapp', {read: true, write: true}).run(conn, callback);
|
||||
///
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "granted": 1,
|
||||
/// "permissions_changes": [
|
||||
/// {
|
||||
/// "new_val": { "read": true, "write": true },
|
||||
/// "old_val": { null }
|
||||
/// }
|
||||
/// ]
|
||||
/// </code></example>
|
||||
public Grant Grant ( Object expr, Object exprA )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
arguments.CoerceAndAdd(expr);
|
||||
arguments.CoerceAndAdd(exprA);
|
||||
return new Grant (arguments );
|
||||
}
|
||||
internal Grant grant ( Object expr, Object exprA )
|
||||
{
|
||||
return Grant ( expr, exprA );
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Get information about a ReQL value.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Get information about a table such as primary key, or cache size.</para>
|
||||
/// <code>r.table('marvel').info().run(conn, callback)
|
||||
/// </code></example>
|
||||
public Info Info ( )
|
||||
{
|
||||
Arguments arguments = new Arguments(this);
|
||||
return new Info (arguments );
|
||||
}
|
||||
internal Info info ( )
|
||||
{
|
||||
return Info ( );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e94984daa0f173149a8d13099d7fc1da
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class DbCreate : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Create a database. A RethinkDB database is a collection of tables, similar to
|
||||
/// relational databases.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Create a database named 'superheroes'.</para>
|
||||
/// <code>> r.dbCreate('superheroes').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "new_val": {
|
||||
/// "id": "e4689cfc-e903-4532-a0e6-2d6797a43f07",
|
||||
/// "name": "superheroes"
|
||||
/// },
|
||||
/// "old_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "dbs_created": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public DbCreate (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Create a database. A RethinkDB database is a collection of tables, similar to
|
||||
/// relational databases.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Create a database named 'superheroes'.</para>
|
||||
/// <code>> r.dbCreate('superheroes').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "new_val": {
|
||||
/// "id": "e4689cfc-e903-4532-a0e6-2d6797a43f07",
|
||||
/// "name": "superheroes"
|
||||
/// },
|
||||
/// "old_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "dbs_created": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public DbCreate (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Create a database. A RethinkDB database is a collection of tables, similar to
|
||||
/// relational databases.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Create a database named 'superheroes'.</para>
|
||||
/// <code>> r.dbCreate('superheroes').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "new_val": {
|
||||
/// "id": "e4689cfc-e903-4532-a0e6-2d6797a43f07",
|
||||
/// "name": "superheroes"
|
||||
/// },
|
||||
/// "old_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "dbs_created": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public DbCreate (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DB_CREATE, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e46ed03d7efa6c542866d9b4e1826db4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class DbDrop : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Drop a database. The database, all its tables, and corresponding data will be deleted.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Drop a database named 'superheroes'.</para>
|
||||
/// <code>> r.dbDrop('superheroes').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "old_val": {
|
||||
/// "id": "e4689cfc-e903-4532-a0e6-2d6797a43f07",
|
||||
/// "name": "superheroes"
|
||||
/// },
|
||||
/// "new_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "tables_dropped": 3,
|
||||
/// "dbs_dropped": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public DbDrop (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Drop a database. The database, all its tables, and corresponding data will be deleted.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Drop a database named 'superheroes'.</para>
|
||||
/// <code>> r.dbDrop('superheroes').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "old_val": {
|
||||
/// "id": "e4689cfc-e903-4532-a0e6-2d6797a43f07",
|
||||
/// "name": "superheroes"
|
||||
/// },
|
||||
/// "new_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "tables_dropped": 3,
|
||||
/// "dbs_dropped": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public DbDrop (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Drop a database. The database, all its tables, and corresponding data will be deleted.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Drop a database named 'superheroes'.</para>
|
||||
/// <code>> r.dbDrop('superheroes').run(conn, callback);
|
||||
/// // Result passed to callback
|
||||
/// {
|
||||
/// "config_changes": [
|
||||
/// {
|
||||
/// "old_val": {
|
||||
/// "id": "e4689cfc-e903-4532-a0e6-2d6797a43f07",
|
||||
/// "name": "superheroes"
|
||||
/// },
|
||||
/// "new_val": null
|
||||
/// }
|
||||
/// ],
|
||||
/// "tables_dropped": 3,
|
||||
/// "dbs_dropped": 1
|
||||
/// }
|
||||
/// </code></example>
|
||||
public DbDrop (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DB_DROP, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fe628c9ba2677c04fbebdc95f3585a36
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class DbList : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>List all database names in the system. The result is a list of strings.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: List all databases.</para>
|
||||
/// <code>r.dbList().run(conn, callback)
|
||||
/// </code></example>
|
||||
public DbList (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>List all database names in the system. The result is a list of strings.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: List all databases.</para>
|
||||
/// <code>r.dbList().run(conn, callback)
|
||||
/// </code></example>
|
||||
public DbList (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>List all database names in the system. The result is a list of strings.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: List all databases.</para>
|
||||
/// <code>r.dbList().run(conn, callback)
|
||||
/// </code></example>
|
||||
public DbList (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DB_LIST, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4b15a2441519884d893d04f2d270eb2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class December : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
public December (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
public December (Arguments args) : this(args, null) {
|
||||
}
|
||||
public December (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DECEMBER, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 53d6556e979264349be211450cc3f2c0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Default : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Provide a default value in case of non-existence errors. The <code>default</code> command evaluates its first argument (the value it's chained to). If that argument returns <code>null</code> or a non-existence error is thrown in evaluation, then <code>default</code> returns its second argument. The second argument is usually a default value, but it can be a function that returns a value.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve the titles and authors of the table <code>posts</code>.
|
||||
/// In the case where the author field is missing or <code>null</code>, we want to retrieve the string
|
||||
/// <code>Anonymous</code>.</para>
|
||||
/// <code>r.table("posts").map(function (post) {
|
||||
/// return {
|
||||
/// title: post("title"),
|
||||
/// author: post("author").default("Anonymous")
|
||||
/// }
|
||||
/// }).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Default (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Provide a default value in case of non-existence errors. The <code>default</code> command evaluates its first argument (the value it's chained to). If that argument returns <code>null</code> or a non-existence error is thrown in evaluation, then <code>default</code> returns its second argument. The second argument is usually a default value, but it can be a function that returns a value.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve the titles and authors of the table <code>posts</code>.
|
||||
/// In the case where the author field is missing or <code>null</code>, we want to retrieve the string
|
||||
/// <code>Anonymous</code>.</para>
|
||||
/// <code>r.table("posts").map(function (post) {
|
||||
/// return {
|
||||
/// title: post("title"),
|
||||
/// author: post("author").default("Anonymous")
|
||||
/// }
|
||||
/// }).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Default (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Provide a default value in case of non-existence errors. The <code>default</code> command evaluates its first argument (the value it's chained to). If that argument returns <code>null</code> or a non-existence error is thrown in evaluation, then <code>default</code> returns its second argument. The second argument is usually a default value, but it can be a function that returns a value.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Retrieve the titles and authors of the table <code>posts</code>.
|
||||
/// In the case where the author field is missing or <code>null</code>, we want to retrieve the string
|
||||
/// <code>Anonymous</code>.</para>
|
||||
/// <code>r.table("posts").map(function (post) {
|
||||
/// return {
|
||||
/// title: post("title"),
|
||||
/// author: post("author").default("Anonymous")
|
||||
/// }
|
||||
/// }).run(conn, callback);
|
||||
/// </code></example>
|
||||
public Default (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DEFAULT, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5e323839766f5d848abaccbfa01b21a0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Delete : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Delete one or more documents from a table.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Delete a single document from the table <code>comments</code>.</para>
|
||||
/// <code>r.table("comments").get("7eab9e63-73f1-4f33-8ce4-95cbea626f59").delete().run(conn, callback)
|
||||
/// </code></example>
|
||||
public Delete (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Delete one or more documents from a table.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Delete a single document from the table <code>comments</code>.</para>
|
||||
/// <code>r.table("comments").get("7eab9e63-73f1-4f33-8ce4-95cbea626f59").delete().run(conn, callback)
|
||||
/// </code></example>
|
||||
public Delete (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Delete one or more documents from a table.</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Delete a single document from the table <code>comments</code>.</para>
|
||||
/// <code>r.table("comments").get("7eab9e63-73f1-4f33-8ce4-95cbea626f59").delete().run(conn, callback)
|
||||
/// </code></example>
|
||||
public Delete (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DELETE, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///<summary>
|
||||
/// "durability": "E_DURABILITY",
|
||||
/// "return_changes": [
|
||||
/// "T_BOOL",
|
||||
/// "always"
|
||||
/// ]
|
||||
///</summary>
|
||||
public Delete this[object optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Delete (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "durability": "E_DURABILITY",
|
||||
/// "return_changes": [
|
||||
/// "T_BOOL",
|
||||
/// "always"
|
||||
/// ]
|
||||
///</summary>
|
||||
public Delete this[OptArgs optArgs] {
|
||||
get
|
||||
{
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(optArgs);
|
||||
|
||||
return new Delete (this.Args, newOptArgs);
|
||||
}
|
||||
}
|
||||
|
||||
///<summary>
|
||||
/// "durability": "E_DURABILITY",
|
||||
/// "return_changes": [
|
||||
/// "T_BOOL",
|
||||
/// "always"
|
||||
/// ]
|
||||
///</summary>
|
||||
public Delete OptArg(string key, object val){
|
||||
|
||||
var newOptArgs = OptArgs.FromMap(this.OptArgs).With(key, val);
|
||||
|
||||
return new Delete (this.Args, newOptArgs);
|
||||
}
|
||||
internal Delete optArg(string key, object val){
|
||||
|
||||
return this.OptArg(key, val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a9d46d2709182804d8d05fb997cf6c54
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class DeleteAt : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <para>Remove one or more elements from an array at a given index. Returns the modified array. (Note: <code>deleteAt</code> operates on arrays, not documents; to delete documents, see the <a href="/api/javascript/delete">delete</a> command.)</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Delete the second element of an array.</para>
|
||||
/// <code>> r(['a','b','c','d','e','f']).deleteAt(1).run(conn, callback)
|
||||
/// // result passed to callback
|
||||
/// ['a', 'c', 'd', 'e', 'f']
|
||||
/// </code></example>
|
||||
public DeleteAt (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Remove one or more elements from an array at a given index. Returns the modified array. (Note: <code>deleteAt</code> operates on arrays, not documents; to delete documents, see the <a href="/api/javascript/delete">delete</a> command.)</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Delete the second element of an array.</para>
|
||||
/// <code>> r(['a','b','c','d','e','f']).deleteAt(1).run(conn, callback)
|
||||
/// // result passed to callback
|
||||
/// ['a', 'c', 'd', 'e', 'f']
|
||||
/// </code></example>
|
||||
public DeleteAt (Arguments args) : this(args, null) {
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Remove one or more elements from an array at a given index. Returns the modified array. (Note: <code>deleteAt</code> operates on arrays, not documents; to delete documents, see the <a href="/api/javascript/delete">delete</a> command.)</para>
|
||||
/// </summary>
|
||||
/// <example><para>Example: Delete the second element of an array.</para>
|
||||
/// <code>> r(['a','b','c','d','e','f']).deleteAt(1).run(conn, callback)
|
||||
/// // result passed to callback
|
||||
/// ['a', 'c', 'd', 'e', 'f']
|
||||
/// </code></example>
|
||||
public DeleteAt (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DELETE_AT, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1861bcb9c570ffe4d838d6b49560bc76
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//AUTOGENERATED, DO NOTMODIFY.
|
||||
//Do not edit this file directly.
|
||||
|
||||
#pragma warning disable 1591 // Missing XML comment for publicly visible type or member
|
||||
// ReSharper disable CheckNamespace
|
||||
|
||||
using System;
|
||||
using RethinkDb.Driver.Ast;
|
||||
using RethinkDb.Driver.Model;
|
||||
using RethinkDb.Driver.Proto;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace RethinkDb.Driver.Ast {
|
||||
|
||||
public partial class Desc : ReqlExpr {
|
||||
|
||||
|
||||
|
||||
|
||||
public Desc (object arg) : this(new Arguments(arg), null) {
|
||||
}
|
||||
public Desc (Arguments args) : this(args, null) {
|
||||
}
|
||||
public Desc (Arguments args, OptArgs optargs)
|
||||
: base(TermType.DESC, args, optargs) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get a single field from an object. If called on a sequence, gets that field from every object in the sequence, skipping objects that lack it.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
public new Bracket this[string bracket] => base[bracket];
|
||||
|
||||
/// <summary>
|
||||
/// Get the nth element of a sequence, counting from zero. If the argument is negative, count from the last element.
|
||||
/// </summary>
|
||||
/// <param name="bracket"></param>
|
||||
/// <returns></returns>
|
||||
public new Bracket this[int bracket] => base[bracket];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue