skdb icon indicating copy to clipboard operation
skdb copied to clipboard

Cannot insert expressions

Open gregsexton opened this issue 1 year ago • 2 comments

skdb> select 'foo' || 'bar';
┌──────────┐
│  col<0>  │
├──────────┤
│ "foobar" │
└──────────┘
skdb> create table test (x text);
skdb> insert into test values ('foo');
skdb> insert into test values ('foo' || 'bar');
insert into test values ('foo' || 'bar'); 
^
|
 ----- ERROR
Error: line 1, character 0:
Arbitrary expressions not supported for INSERT

But this as a workaround does work.

skdb> insert into test select 'foo' || 'bar';
skdb> select * from test;
┌──────────┐
│    x     │
├──────────┤
│  "foo"   │
│ "foobar" │
└──────────┘

gregsexton avatar Mar 21 '24 10:03 gregsexton

Yes, this is on my radar. I'm hesitant to implement this as an expansion to a SELECT as it is needlessly inefficient and lifting the limitation should be possible with mostly just a bit of refactoring work.

jberdine avatar Mar 21 '24 11:03 jberdine

For sure. Just pointing out that users can work around the limitation.

gregsexton avatar Mar 21 '24 11:03 gregsexton

Closing skdb-specific issues as skdb in its current form is being deprecated.

beauby avatar Sep 30 '24 18:09 beauby