github.com/hasnat/dolt/go@v0.0.0-20210628190320-9eb5d843fbb7/libraries/doltcore/sqle/lookup/belowall.go (about)

     1  // Copyright 2020 Dolthub, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package lookup
    16  
    17  import "github.com/dolthub/dolt/go/store/types"
    18  
    19  // BelowAll represents the position beyond the minimum possible value.
    20  type BelowAll struct{}
    21  
    22  var _ Cut = BelowAll{}
    23  
    24  // Compare implements Cut.
    25  func (BelowAll) Compare(Cut) (int, error) {
    26  	return -1, nil
    27  }
    28  
    29  // Equals implements Cut.
    30  func (BelowAll) Equals(c Cut) bool {
    31  	_, ok := c.(BelowAll)
    32  	return ok
    33  }
    34  
    35  // Format implements Cut.
    36  func (ba BelowAll) Format() *types.NomsBinFormat {
    37  	return types.Format_Default
    38  }
    39  
    40  // Less implements Cut.
    41  func (BelowAll) Less(types.Tuple) (bool, error) {
    42  	return true, nil
    43  }
    44  
    45  // String implements Cut.
    46  func (BelowAll) String() string {
    47  	return "BelowAll"
    48  }
    49  
    50  // TypeAsLowerBound implements Cut.
    51  func (BelowAll) TypeAsLowerBound() BoundType {
    52  	panic("BelowAll TypeAsLowerBound should be unreachable")
    53  }
    54  
    55  // TypeAsUpperBound implements Cut.
    56  func (BelowAll) TypeAsUpperBound() BoundType {
    57  	panic("BelowAll TypeAsUpperBound should be unreachable")
    58  }