-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added parameters test and IMeta implementation
- Loading branch information
Showing
7 changed files
with
170 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// IMetaExpression.cs | ||
// | ||
// Author: | ||
// Jim Borden <[email protected]> | ||
// | ||
// Copyright (c) 2017 Couchbase, Inc All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
namespace Couchbase.Lite.Query | ||
{ | ||
/// <summary> | ||
/// Represents an expression that is meant to retrieve metadata information | ||
/// inside of an <see cref="IQuery"/> | ||
/// </summary> | ||
public interface IMetaExpression : IExpression | ||
{ | ||
#region Public Methods | ||
|
||
/// <summary> | ||
/// Specifies the source to retrieve the information from | ||
/// if multiple sources are used in a query | ||
/// </summary> | ||
/// <param name="alias">The name of the data source</param> | ||
/// <returns>The expression with the alias added</returns> | ||
IExpression From(string alias); | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// IPropertySource.cs | ||
// IPropertyExpression.cs | ||
// | ||
// Author: | ||
// Jim Borden <[email protected]> | ||
|
@@ -21,19 +21,19 @@ | |
|
||
namespace Couchbase.Lite.Query | ||
{ | ||
/// <summary> | ||
/// <summary> | ||
/// An interface for an expression that will retrieve a property | ||
/// from a keypath | ||
/// from a keypath | ||
/// </summary> | ||
public interface IPropertySource : IExpression | ||
public interface IPropertyExpression : IExpression | ||
{ | ||
#region Public Methods | ||
|
||
/// <summary> | ||
/// <summary> | ||
/// Specifies where to retrieve the property from (necessary | ||
/// in instances where the query is coming from multiple sources) | ||
/// </summary> | ||
/// <param name="alias">The alias of the source to retrieve from</param> | ||
/// in instances where the query is coming from multiple sources) | ||
/// </summary> | ||
/// <param name="alias">The alias of the source to retrieve from</param> | ||
/// <returns>The expression, for further processing</returns> | ||
IExpression From(string alias); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// QueryMeta.cs | ||
// | ||
// Author: | ||
// Jim Borden <[email protected]> | ||
// | ||
// Copyright (c) 2017 Couchbase, Inc All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
using Couchbase.Lite.Query; | ||
|
||
namespace Couchbase.Lite.Internal.Query | ||
{ | ||
internal sealed class QueryMeta : IMeta | ||
{ | ||
#region Properties | ||
|
||
public IMetaExpression DocumentID => new QueryTypeExpression("_id", ExpressionType.KeyPath); | ||
|
||
public IMetaExpression Sequence => new QueryTypeExpression("_sequence", ExpressionType.KeyPath); | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters