Open
Description
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:
- Execute
dy admin create table issue --keys pk,S
. - Execute
dy use issue
. - Execute
dy admin delete table --yes issue
. - Execute
dy admin create table issue --keys pk,N
. - 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'.