Skip to content

Conversation

Totktonada
Copy link
Member

@Totktonada Totktonada commented May 6, 2022

Basic usage:

$ ./doc/playground.lua
tarantool> crud.select('developers', nil, {first = 6})
tarantool> crud.<something else>(<...>)

What the script is doing, step by step:

  • Configure the database to don't leave WAL and snapshot files.
  • Configure and bootstrap vshard storage and router on the single
    instance.
  • Create a space and fill it with data.
  • Start a console.

@Totktonada
Copy link
Member Author

Created for myself to experiment around crud, but decided to share for comments. If it'll look useful for somebody, I'll merge it. If not, I'll close the pull request.

@Totktonada Totktonada force-pushed the Totktonada/add-playground branch from 4c407c1 to 2617c25 Compare May 6, 2022 05:39
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pull request! It seems to me that this is a good idea. Now from README.md it is not clear how to manually test the crud. For example, I didn't understand how to run it manyally and tested it only with the luatest.

Manual testing will be very easy with this script.

I haven't looked at the code very carefully because it is a proposal. So I made my opinion and I noted only the obvious things:

  1. Need a section in README.md as entry point.
  2. Need autotests.

@Totktonada Totktonada marked this pull request as draft May 6, 2022 17:01
@Totktonada Totktonada force-pushed the Totktonada/add-playground branch from 2617c25 to 9226654 Compare May 22, 2022 01:30
@Totktonada
Copy link
Member Author

Still in the draft state, but updated a bit.

Changes:

  • Removed help() / prev(). It does not feel very convenient for me. I would rather show a list of sections / examples to read, enumerate them and let a user to choose what to look. Commands would look like help list, help show 1. I'll not dig into this direction within this pull request. Let's look into docs in a separate window. But I opened PR Tiny documentation enhancements #291 to ease navigation over the documentation. BTW, we can expand the idea with help list / help show to make the examples testable.
  • Added customers space. Its format and content more or less corresponds to what we can see in README.md. However there is no consistency in the readme itself: different examples assume different data (and even different bucket_count value). I decided to don't polish the readme in this pull request.
  • Changed bucket_id values in the developers space to bucket_id_strcrc32() values calculated using primary keys. I would update them in doc/select.md and doc/pairs.md later. See Added new examples of select and pairs queries. #109 (comment).
  • Added bucket_id indexes. It does not change anything for playground, but a real sharded space should have this index to allow vshard rebalancer doing its work.
  • Created a PoC patch to fix annoying prompt/log mixing: console: don't mix stdout/stderr with readline prompt tarantool#7170.

TODO list:

  • Mention in README.md.
  • Add several simple tests: run playground, do some crud requests, check output.

@Totktonada Totktonada force-pushed the Totktonada/add-playground branch from 9226654 to 48d037a Compare May 24, 2022 19:14
@Totktonada
Copy link
Member Author

Changes:

  • Added 'Quickstart' section into README.md.
  • Added a test.

It is ready for review now, but I need to choose between two variants of the test.

@Totktonada Totktonada marked this pull request as ready for review May 24, 2022 19:24
@oleg-jukovec oleg-jukovec self-requested a review May 25, 2022 07:00
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, I made a few notes, but they are not critical and can be easily corrected. So LGTM after resolving the notes.

@Totktonada Totktonada force-pushed the Totktonada/add-playground branch 3 times, most recently from 67c45b5 to f918eb2 Compare May 25, 2022 11:38
Copy link
Member

@DifferentialOrange DifferentialOrange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after resolving remaining comments.

Basic usage:

```shell
$ ./doc/playground.lua
tarantool> crud.select('customers', {{'<=', 'age', 35}})
tarantool> crud.select('developers', nil, {first = 6})
tarantool> crud.<something else>(<...>)
```

What the script is doing, step by step:

* Configure the database to don't leave WAL and snapshot files.
* Configure and bootstrap vshard storage and router on the single
  instance.
* Create `customers` and `developers` spaces and fill them with data.
* Start a console.
My wish is to let a user know how to experiment with crud API and what
to do next.
@Totktonada Totktonada force-pushed the Totktonada/add-playground branch from f918eb2 to b23df0b Compare May 26, 2022 17:26
@Totktonada Totktonada merged commit 1635f16 into master May 26, 2022
@Totktonada Totktonada deleted the Totktonada/add-playground branch May 26, 2022 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants