{"ok": true, "next": null, "rows": [{"id": "writing_plugins:writing-plugins-one-off", "page": "writing_plugins", "ref": "writing-plugins-one-off", "title": "Writing one-off plugins", "content": "The quickest way to start writing a plugin is to create a  my_plugin.py  file and drop it into your  plugins/  directory. Here is an example plugin, which adds a new custom SQL function called  hello_world()  which takes no arguments and returns the string  Hello world! . \n             from datasette import hookimpl\n\n\n@hookimpl\ndef prepare_connection(conn):\n    conn.create_function(\n        \"hello_world\", 0, lambda: \"Hello world!\"\n    ) \n             If you save this in  plugins/my_plugin.py  you can then start Datasette like this: \n             datasette serve mydb.db --plugins-dir=plugins/ \n             Now you can navigate to  http://localhost:8001/mydb  and run this SQL: \n             select hello_world(); \n             To see the output of your plugin.", "breadcrumbs": "[\"Writing plugins\"]", "references": "[{\"href\": \"http://localhost:8001/mydb\", \"label\": \"http://localhost:8001/mydb\"}]"}], "truncated": false}