• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 10848586679
88%

Build:
DEFAULT BRANCH: master
Ran 13 Sep 2024 12:03PM UTC
Jobs 1
Files 514
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Sep 2024 11:51AM UTC coverage: 87.314% (+0.003%) from 87.311%
10848586679

push

github

locker
schema: introduce the `index:offset_of` method

The method is used to get the (potential) 1-based iterator-relative
position in the index of a tuple matching a key.

Closes #8204

@TarantoolBot document
Title: A new `index:offset_of` method introduced
Product: Tarantool
Since: 3.3.0

The method returns 0-based offset in the index of a first tuple
matching the provided key and iterator. The position is counted from
the beginning or end of the space depending on the iterator direction,
for example:

``` lua
-- index: {{1}, {3}}
index:offset_of({3}, {iterator = 'eq'})  -- returns 1: [1, <3>]
index:offset_of({3}, {iterator = 'req'}) -- returns 0: [<3>, 1]
```

In case there's no tuple matching the key and iterator in the index the
function returns the position a matching tuple would be placed at if
existed, for example:

``` lua
-- index: {{1}, {3}}
index:offset_of({2}, {iterator = 'eq'})  -- 1: [1, <2>, 3]
index:offset_of({4}, {iterator = 'req'}) -- 0: [<4>, 3, 1]
```

This works with any iterator:

``` lua
-- index: {{1}, {3}}
index:offset_of({0}, {iterator = 'ge'}) -- 0: [<1>, 3]
index:offset_of({1}, {iterator = 'lt'}) -- 2: [3, 1, <...>]

-- index: {{'b'}, {'bb'}, {'bc'}, {'c'}, {'cc'}}
index:offset_of({'b'},  {iterator = 'np'}) -- 3: [b, bb, bc, <c>, cc]
index:offset_of({'cc'}, {iterator = 'pp'}) -- 1: [cc, <c>, bc, bb, b]
```

68870 of 122275 branches covered (56.32%)

101653 of 116422 relevant lines covered (87.31%)

2579596.06 hits per line

Jobs
ID Job ID Ran Files Coverage
1 10848586679.1 13 Sep 2024 12:03PM UTC 0
87.31
GitHub Action Run
Source Files on build 10848586679
Detailed source file information is not available for this build.
  • Back to Repo
  • 21e428ea on github
  • Prev Build on master (#10847910331)
  • Next Build on master (#10849632069)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc