code: def canned_write_client(tmpdir):
      template_dir = tmpdir / "canned_write_templates"
      template_dir.mkdir()
      (template_dir / "query-data-update_name.html").write_text(
          """
      {% extends "query.html" %}
      {% block content %}!!!CUSTOM_UPDATE_NAME_TEMPLATE!!!{{ super() }}{% endblock %}
      """,
          "utf-8",
      )
      with make_app_client(
          extra_databases={"data.db": "create table names (name text)"},
          template_dir=str(template_dir),
          config={
              "databases": {
                  "data": {
                      "queries": {
                          "canned_read": {"sql": "select * from names"},
                          "add_name": {
                              "sql": "insert into names (name) values (:name)",
                              "write": True,
                              "on_success_redirect": "/data/add_name?success",
                          },
                          "add_name_specify_id": {
                              "sql": "insert into names (rowid, name) values (:rowid, :name)",
                              "on_success_message_sql": "select 'Name added: ' || :name || ' with rowid ' || :rowid",
                              "write": True,
                              "on_error_redirect": "/data/add_name_specify_id?error",
                          },
                          "add_name_specify_id_with_error_in_on_success_message_sql": {
                              "sql": "insert into names (rowid, name) values (:rowid, :name)",
                              "on_success_message_sql": "select this is bad SQL",
                              "write": True,
                          },
                          "delete_name": {
                              "sql": "delete from names where rowid = :rowid",
                              "write": True,
                              "on_success_message": "Name deleted",
                              "allow": {"id": "root"},
                          },
                          "update_name": {
                              "sql": "update names set name = :name where rowid = :rowid",
                              "params": ["rowid", "name", "extra"],
                              "write": True,
                          },
                      }
                  }
              }
          },
      ) as client:
          yield client
  
imports: from bs4 import BeautifulSoup
  import json
  import pytest
  import re
  from .fixtures import make_app_client, app_client
label_desc: Use image node_id 1 for calling a global function with example usage: canned_write_client(tmpdir) without return types