Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dy admin create table should update the table cache #203

Open
StoneDot opened this issue Mar 28, 2024 · 0 comments
Open

dy admin create table should update the table cache #203

StoneDot opened this issue Mar 28, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@StoneDot
Copy link
Contributor

StoneDot commented Mar 28, 2024

We should update the table cache after creating a table and delete the cache after deleting a table.

Due to the lack of the above update, dynein raises an unintended error when you take the following steps:

  1. Execute dy admin create table issue --keys pk,S.
  2. Execute dy use issue.
  3. Execute dy admin delete table --yes issue.
  4. Execute dy admin create table issue --keys pk,N.
  5. Execute dy put 1.

The above steps raise the following error message.

[2024-03-28T14:45:41Z ERROR dy::data] One or more parameter values were invalid: Type mismatch for key

The final state is as follows:

❯ cat ~/.dynein/config.yml
---
using_region: local
using_table: issue
using_port: 8000

❯ cat ~/.dynein/cache.yml
---
tables:
  local/issue:
    region: local
    name: issue
    pk:
      name: pk
      kind: S
    sk: ~
    indexes: ~
    mode: OnDemand

To reveal the root cause, change the ~/.dynein/cache.yml.

❯ cat ~/.dynein/cache.yml
---
tables:
  local/issue:
    region: local
    name: issue
    pk:
      name: pk
      kind: N
    sk: ~
    indexes: ~
    mode: OnDemand

❯ dy put 1
Successfully put an item to the table 'issue'.
@StoneDot StoneDot added the bug Something isn't working label Mar 28, 2024
@StoneDot StoneDot added the good first issue Good for newcomers label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant