/// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="parameters">The object to copy values from</param>
 public Parameters([NotNull] Parameters parameters)
 {
     CBDebug.MustNotBeNull(Log.To.Query, Tag, nameof(parameters), parameters);
     _params = new Dictionary <string, object>(parameters._params);
 }
Example #2
0
 public static IExpression Radians([NotNull] IExpression expression) =>
 new QueryCompoundExpression("RADIANS()", CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
Example #3
0
 public static IExpression Trunc([NotNull] IExpression expression, [NotNull] IExpression digits) =>
 new QueryCompoundExpression("TRUNC()",
                             CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression),
                             CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(digits), digits));
Example #4
0
 public static IExpression Degrees([NotNull] IExpression expression) =>
 new QueryCompoundExpression("DEGREES()", CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
Example #5
0
 public static IExpression MillisToString([NotNull] IExpression expression) =>
 new QueryCompoundExpression("MILLIS_TO_STR()", CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
Example #6
0
 public IWhere Where([NotNull] IExpression expression)
 {
     CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression);
     return(new Where(this, expression));
 }
 public IExpression Satisfies([NotNull] IExpression expression)
 {
     CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression);
     _predicate = Misc.TryCast <IExpression, QueryExpression>(expression);
     return(this);
 }
 public IExpression Or([NotNull] IExpression expression) =>
 new QueryCompoundExpression("OR", this, CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
 public IExpression Regex([NotNull] IExpression expression) =>
 GetOperator(BinaryOpType.RegexLike, CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
 public IExpression GreaterThan([NotNull] IExpression expression) =>
 GetOperator(BinaryOpType.GreaterThan, CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
 public IExpression NotEqualTo([NotNull] IExpression expression) =>
 GetOperator(BinaryOpType.NotEqualTo, CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
 public IExpression Match([NotNull] string query)
 {
     CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(query), query);
     _subpredicates[_subpredicates.Length - 1] = Expression.String(query);
     return(this);
 }
Example #13
0
 public static IValueIndexItem Expression([NotNull] IExpression expression) =>
 new QueryIndexItem(CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
Example #14
0
 public IFrom From([NotNull] IDataSource dataSource)
 {
     CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(dataSource), dataSource);
     return(new From(this, dataSource));
 }
Example #15
0
 public IJoins Join([ItemNotNull] params IJoin[] joins)
 {
     CBDebug.ItemsMustNotBeNull(WriteLog.To.Query, Tag, nameof(joins), joins);
     ValidateParams(joins);
     return(new QueryJoin(this, joins));
 }
 public IExpression Match([NotNull] IExpression expression) =>
 GetOperator(BinaryOpType.Matches, CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
Example #17
0
 public IOrderBy OrderBy([ItemNotNull] params IOrdering[] orderings)
 {
     CBDebug.ItemsMustNotBeNull(WriteLog.To.Query, Tag, nameof(orderings), orderings);
     ValidateParams(orderings);
     return(new QueryOrderBy(this, orderings));
 }
Example #18
0
 /// <summary>
 /// Constructs a replicator based on the given <see cref="ReplicatorConfiguration"/>
 /// </summary>
 /// <param name="config">The configuration to use to create the replicator</param>
 public Replicator([NotNull] ReplicatorConfiguration config)
 {
     Config = CBDebug.MustNotBeNull(WriteLog.To.Sync, Tag, nameof(config), config).Freeze();
     _databaseThreadSafety = Config.Database.ThreadSafety;
 }
 public IArrayExpressionSatisfies In([NotNull] IExpression expression)
 {
     CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression);
     _in = expression;
     return(this);
 }
Example #20
0
        /// <summary>
        /// Adds a documents ended listener on this replication object (similar to a C# event)
        /// </summary>
        /// <remarks>
        /// Make sure add documents ended listener on this replication object before starting the replicator.
        /// </remarks>
        /// <param name="handler">The logic to run during the callback</param>
        /// <returns>A token to remove the handler later</returns>
        public ListenerToken AddDocumentReplicationListener([NotNull] EventHandler <DocumentReplicationEventArgs> handler)
        {
            CBDebug.MustNotBeNull(WriteLog.To.Sync, Tag, nameof(handler), handler);

            return(AddDocumentReplicationListener(null, handler));
        }
Example #21
0
 public static IExpression Contains([NotNull] IExpression expression, [NotNull] IExpression substring) =>
 new QueryCompoundExpression("CONTAINS()",
                             CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression),
                             CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(substring), substring));
 public static IFullTextIndex FullTextIndex([ItemNotNull] params IFullTextIndexItem[] items) =>
 new QueryIndex((IFullTextIndexItem[])CBDebug.ItemsMustNotBeNull(WriteLog.To.Query, Tag, nameof(items), items));
Example #23
0
 public static IExpression Length([NotNull] IExpression expression) =>
 new QueryCompoundExpression("LENGTH()", CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
 /// <summary>
 /// Constructor using the given cookie name
 /// </summary>
 /// <param name="sessionID"><see cref="SessionID"/></param>
 /// <param name="cookieName"><see cref="CookieName"/></param>
 public SessionAuthenticator([NotNull] string sessionID, [NotNull] string cookieName)
 {
     SessionID  = CBDebug.MustNotBeNull(Log.To.Sync, Tag, nameof(sessionID), sessionID);
     CookieName = CBDebug.MustNotBeNull(Log.To.Sync, Tag, nameof(cookieName), cookieName);
 }
Example #25
0
 public static IExpression Power([NotNull] IExpression b, [NotNull] IExpression exponent) =>
 new QueryCompoundExpression("POWER()",
                             CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(b), b),
                             CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(exponent), exponent));
Example #26
0
 /// <inheritdoc />
 public bool Contains([NotNull] string key)
 {
     CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(key), key);
     return(IndexForColumnName(key) >= 0);
 }
Example #27
0
 public static IExpression StringToUTC([NotNull] IExpression expression) =>
 new QueryCompoundExpression("STR_TO_UTC()", CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
Example #28
0
 public IGroupBy GroupBy([ItemNotNull] params IExpression[] expressions)
 {
     CBDebug.ItemsMustNotBeNull(WriteLog.To.Query, Tag, nameof(expressions), expressions);
     ValidateParams(expressions);
     return(new QueryGroupBy(this, expressions));
 }
Example #29
0
 public static IExpression Atan([NotNull] IExpression expression) =>
 new QueryCompoundExpression("ATAN()", CBDebug.MustNotBeNull(WriteLog.To.Query, Tag, nameof(expression), expression));
Example #30
0
 /// <summary>
 /// Creates a blob given a type and streaming content
 /// </summary>
 /// <param name="contentType">The binary type of the blob</param>
 /// <param name="stream">The stream containing the blob content</param>
 /// <returns>An instantiated <see cref="Blob" /> object</returns>
 /// <exception cref="ArgumentNullException">Thrown if <c>stream</c> is <c>null</c></exception>
 public Blob(string contentType, [NotNull] Stream stream)
 {
     ContentType           = contentType;
     _initialContentStream = CBDebug.MustNotBeNull(Log.To.Database, Tag, nameof(stream), stream);
 }