Skip to content

Commit 550f02d

Browse files
authored
Merge pull request piccolo-orm#49 from piccolo-orm/documentation_improvements
Documentation improvements
2 parents 653fcd9 + aa5772b commit 550f02d

File tree

7 files changed

+24
-17
lines changed

7 files changed

+24
-17
lines changed

docs/src/piccolo/features/syntax.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ For example:
1515
Get the SQL at any time
1616
-----------------------
1717

18-
At any time you can access the __str__ method of a query, to see the
18+
At any time you can access the ``__str__`` method of a query, to see the
1919
underlying SQL - making the ORM feel less magic.
2020

2121
.. code-block:: python
2222
23-
query = Band.select(Band.name).where(Band.popularity >= 100)
24-
25-
print(query)
23+
>>> query = Band.select(Band.name).where(Band.popularity >= 100)
24+
>>> print(query)
2625
'SELECT name from band where popularity > 100'

docs/src/piccolo/getting_started/database_support.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Database Support
44
================
55

6-
Postgres is the primary database which Piccolo was designed for.
6+
`Postgres <https://www.postgresql.org/>`_ is the primary database which Piccolo
7+
was designed for.
78

8-
Limited SQLite support is available, mostly to enable tooling like the
9-
playground. Postgres is the only database we recommend for use in production
10-
with Piccolo.
9+
Limited `SQLite <https://www.sqlite.org/index.html>`_ support is available,
10+
mostly to enable tooling like the :ref:`playground <Playground>`. Postgres is the only database we
11+
recommend for use in production with Piccolo.

docs/src/piccolo/getting_started/what_is_piccolo.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ Some of it's stand out features are:
99
* A builtin playground, which makes learning a breeze - see :ref:`Playground`.
1010
* Works great with `iPython <https://ipython.org/>`_ and
1111
`VSCode <https://code.visualstudio.com/>`_ - see :ref:`tab_completion`.
12-
* Batteries included - a User model, authentication, migrations, an admin,
12+
* Batteries included - a :ref:`User model and authentication <Authentication>`, :ref:`migrations <migrations>`, an :ref:`admin <ecosystem>`,
1313
and more.
14+
* Templates for creating your own :ref:`ASGI web app <ASGICommand>`.

docs/src/piccolo/query_types/create_table.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ This creates the table and columns in the database.
1111
1212
>>> Band.create_table().run_sync()
1313
[]
14+
15+
16+
To prevent an error from being raised if the table already exists:
17+
18+
.. code-block:: python
19+
20+
>>> Band.create_table(if_not_exists=True).run_sync()
21+
[]

docs/src/piccolo/query_types/django_comparison.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ Database Settings
114114
-----------------
115115

116116
In Django you configure your database in ``settings.py``. With Piccolo, you
117-
definte an ``Engine`` in ``piccolo_conf.py``. See :ref:`Engines`.
117+
define an ``Engine`` in ``piccolo_conf.py``. See :ref:`Engines`.

docs/src/piccolo/query_types/select.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ One of the most powerful things about select is it's support for joins.
5050

5151
.. code-block:: python
5252
53-
b = Band
54-
b.select(
55-
b.name,
56-
b.manager.name
57-
).run_sync()
53+
>>> b = Band
54+
>>> b.select(b.name, b.manager.name).run_sync()
55+
[{'name': 'Pythonistas', 'manager.name': 'Guido'}, {'name': 'Rustaceans', 'manager.name': 'Graydon'}]
5856
5957
6058
The joins can go several layers deep.
@@ -163,7 +161,7 @@ To return the data as a JSON string:
163161
Piccolo can use `orjson <https://github.com/ijl/orjson>`_ for JSON serialisation,
164162
which is blazing fast, and can handle most Python types, including dates,
165163
datetimes, and UUIDs. To install Piccolo with orjson support use
166-
`pip install piccolo[orjson]`.
164+
``pip install piccolo[orjson]``.
167165

168166
where
169167
~~~~~

docs/src/piccolo/query_types/transactions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inbetween state.
1111
Atomic
1212
------
1313

14-
This is useful when you want to programitcally add some queries to the
14+
This is useful when you want to programmatically add some queries to the
1515
transaction before running it.
1616

1717
.. code-block:: python

0 commit comments

Comments
 (0)