title: Pad --- summary: The basic interface to querying the database. --- module: lektor.db --- type: class --- template_var: site --- body: The `Pad` is a helper class that provides basic access to querying the database. Inside templates an instance of it is available under the `site` variable automatically. To understand what the pad does you need to consider what it does. The pad is similar to a `connection` in a regular database. Whenever you load a record it's temporarily cached on the pad. So unless you overflow the cache, loading the object a second time will most likely return an already loaded instance from the pad. This also means that the pad is not threadsafe. So if you want (for whatever reason) use multiple threads you have to create a separate pad for each thread. This typically only comes up in the context of plugins or more complex command line scripts. ## Template Usage A ready-configured pad is always available under the `site` name which allows you to easily discover other pages. Here a basic example of how to do this through the [get :ref](get/) method: ```html+jinja {% set root = site.get('/') %}