You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
699 B

1 year ago
1 year ago
  1. -- name: ListScripts :many
  2. SELECT * FROM script;
  3. -- name: SaveScript :exec
  4. REPLACE INTO script (name, data) VALUES (?, ?);
  5. -- name: DeleteScript :exec
  6. DELETE FROM script WHERE name = ?;
  7. -- name: ListScriptVariables :many
  8. SELECT * FROM script_variable;
  9. -- name: UpdateScriptVariables :exec
  10. REPLACE INTO script_variable (scope, name, value) VALUES (?, ?, ?);
  11. -- name: ListScriptTriggers :many
  12. SELECT * FROM script_trigger;
  13. -- name: ReplaceScriptTrigger :exec
  14. REPLACE INTO script_trigger (id, name, event, device_match, parameter, script_target, script_name, script_pre, script_post)
  15. VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
  16. -- name: DeleteScriptTrigger :exec
  17. DELETE FROM script_trigger WHERE id = ?;