This repository was archived by the owner on Jan 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ pending_inserts: PendingInserts,
4747row_group_creator : RowGroupCreator ,
4848dirty : bool ,
4949
50+ warned_update_delete_not_supported : bool = false ,
51+
5052pub const InitError = error {
5153 NoColumns ,
5254 UnsupportedDb ,
@@ -300,7 +302,8 @@ pub fn update(
300302 rowid : * i64 ,
301303 change_set : ChangeSet ,
302304) ! void {
303- if (change_set .changeType () == .Insert ) {
305+ const change_type = change_set .changeType ();
306+ if (change_type == .Insert ) {
304307 rowid .* = self .pending_inserts .insert (cb_ctx .arena , change_set ) catch | e | {
305308 cb_ctx .setErrorMessage ("failed insert insert entry: {any}" , .{e });
306309 return e ;
@@ -311,7 +314,10 @@ pub fn update(
311314 return ;
312315 }
313316
314- @panic ("delete and update are not supported" );
317+ if (! self .warned_update_delete_not_supported ) {
318+ std .log .warn ("stanchion tables do not (yet) support UPDATE or DELETE" , .{});
319+ self .warned_update_delete_not_supported = true ;
320+ }
315321}
316322
317323const BestIndexError = error {} || Allocator .Error || vtab .BestIndexError ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pub fn init(values: []?*c.sqlite3_value) Self {
1818}
1919
2020pub fn changeType (self : Self ) ChangeType {
21- if (self .values .len == 0 ) {
21+ if (self .values .len == 1 ) {
2222 return .Delete ;
2323 }
2424 if ((ValueRef { .value = self .values [0 ] }).isNull ()) {
You can’t perform that action at this time.
0 commit comments