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

Can not get raw key putted by tikv golang client #3

Open
jiashiwen opened this issue Dec 6, 2021 · 2 comments
Open

Can not get raw key putted by tikv golang client #3

jiashiwen opened this issue Dec 6, 2021 · 2 comments

Comments

@jiashiwen
Copy link

hi:

I put rawkey use golang client , and my code is

	cli, err := rawkv.NewClient(context.TODO(), []string{"xx.xx.xx.xx:2379"}, config.DefaultConfig().Security)
	if err != nil {
		panic(err)
	}
	defer cli.Close()
       	var prefix = "prefix"
	for i := 0; i < 10; i++ {

		key := []byte(prefix + strconv.Itoa(i))
		val := []byte("PingCAP" + strconv.Itoa(i))
		err = cli.Put(context.TODO(), key, val)
		if err != nil {
			panic(err)
		}
		fmt.Printf("Successfully put %s:%s to tikv\n", key, val)
		val, err = cli.Get(context.TODO(), key)
		if err != nil {
			panic(err)
		}
		fmt.Printf("found val: %s for key: %s\n", val, key)
	}

I can get the key like "prefix0",but can not get from tcli

@c4pt0r
Copy link
Owner

c4pt0r commented Dec 7, 2021

Thank you for your report.
tcli only supports transactional API now.
maybe in the future, we can provide a rawkv mode.

@c4pt0r
Copy link
Owner

c4pt0r commented Aug 6, 2022

working on it.

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

No branches or pull requests

2 participants