Documented internals API for use in plugins #576
Quite a few of the plugin hooks make a
This means it should provide a documented, stable API so that plugin authors can rely on it.
The text was updated successfully, but these errors were encountered:
OK, I've made a start on this now in 3ffb8f3 - still plenty more methods to document. More importantly that class has a LOT of junk methods on that no-one should ever call from a plugin, so I need to decide what to do about those.
I need to document the
__init__(self, files, immutables=None, cache_headers=True, cors=False, inspect_data=None, metadata=None, sqlite_extensions=None, template_dir=None, plugins_dir=None, static_mounts=None, memory=False, config=None, version_note=None, config_dir=None)
absolute_url(self, request, path)
add_database(self, name, db)
execute(self, db_name, sql, params=None, truncate=False, custom_time_limit=None, page_size=None, log_sql_errors=True)
expand_foreign_keys(self, database, table, column, values)
get_canned_query(self, database_name, query_name)
metadata(self, key=None, database=None, table=None, fallback=True)
plugin_config(self, plugin_name, database=None, table=None, fallback=True)
prepare_connection(self, conn, database)
render_template(self, templates, context=None, request=None, view_name=None)
table_metadata(self, database, table)
I should also think about the class properties (as opposed to methods) that are setup in the Datasette constructor. Many of these should be private, some should be documented.