From 19e1057ead0c4434f456bafb4812de2812d51bf5 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 2 Aug 2018 08:26:38 -0700 Subject: [PATCH] Documentation for create_view() --- docs/table.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/table.rst b/docs/table.rst index df060ed..988501d 100644 --- a/docs/table.rst +++ b/docs/table.rst @@ -74,6 +74,17 @@ You can also specify a primary key by passing the ``pk=`` parameter to the ``.in "is_good_dog": True, }, pk="id") +Creating views +============== + +The ``.create_view()`` method on the database class can be used to create a view: + +.. code-block:: python + + db.create_view("good_dogs", """ + select * from dogs where is_good_dog = 1 + """) + Storing JSON ============