antares icon indicating copy to clipboard operation
antares copied to clipboard

Sqlite: Unable to view trigger code

Open klaseca opened this issue 11 months ago • 1 comments

Describe the bug After creation trigger unable to view it code in ui

To Reproduce Steps to reproduce the behavior:

  1. Create sqlite database
  2. Create table:
create table
  test (
    id integer primary key,
    description text,
    updated_at text not null default current_timestamp
  );
  1. Create trigger:
create TRIGGER tg_test_updated_at_update after
update on test for each row begin
update test
set
  updated_at = current_timestamp
where
  id = old.id;
end;
  1. Try open created trigger in ui
  2. Get error: TypeError: Cannot read properties of null (reading '0')

Expected behavior I can look at trigger code

Application (please complete the following information):

  • App client: sqlite
  • App version: 0.7.30
  • Installation source: exe

Environment (please complete the following information):

  • OS name: Windows 10
  • OS version: 22H2
  • DB name: sqlite
  • DB version: 3.45.3

Additional context As I understand it, for better-sqlite3 you need to use get method instead of run to get trigger code

klaseca avatar Jan 27 '25 15:01 klaseca

At first glance, it appears that the problem does not occur when the trigger is created via GUI, even though the query that creates it is identical. I will do further testing.

Fabio286 avatar Jan 30 '25 17:01 Fabio286