invisal / libsql-studio

A lightweight LibSQL/rqlite graphical client on your browser
https://libsqlstudio.com
MIT License
162 stars 13 forks source link

Allow Editing String Primary Key #82

Closed zicklag closed 3 months ago

zicklag commented 3 months ago

Have a simple table:

CREATE TABLE kv ( key string primary key, value text );

But in the UI, I'm unable to add a row with a custom key in the table through the table editor, I believe because it's the primary key, and it assumes I'm only going to be inserting either DEFAULT, NULL, a Unix timestamp, or a UUID.

I can double-click the value cell to edit it, but not the key.

image

invisal commented 3 months ago

I am not able to reproduce this as I can double click it normally. @zicklag

https://github.com/invisal/libsql-studio/assets/4539653/4ee5184e-f3b0-4323-a2b7-5b71d131a11e

What is your browser and OS?

invisal commented 3 months ago

Oh wait. I can reproduce it. My bad. I will fix it as soon as possible.

invisal commented 3 months ago

@zicklag

Fixed and deploy. You can refresh to see the fixed.

invisal commented 3 months ago

The root cause is that the column type is STRING.

https://sqlite.org/datatype3.html

I try to map the column type using this document. And it does not mention STRING type. So my tool does not allow user to edit unknown type. I have added STRING into TEXT type.

image

zicklag commented 3 months ago

Awesome! It works, thanks!

image