1- Categories and Query Libraries
2- ******************************
1+ Categories and Libraries
2+ ************************
33
44This chapter discusses the usage and implementation of connection categories and
5- query libraries.
5+ libraries.
66
77.. note::
88 First-time users are encouraged to read the `Audience and Motivation`_
99 section first.
1010
11- Query libraries are a collection of SQL statements that can be bound to a
11+ Libraries are a collection of SQL statements that can be bound to a
1212connection. Libraries are *normally* bound directly to the connection object as
1313an attribute using a name specified by the library.
1414
@@ -24,19 +24,19 @@ statement is to be used. The user may state the default execution method of
2424the statement object, or whether the symbol is to be preloaded at bind
2525time--these properties are Symbol Annotations.
2626
27- The purpose of query libraries is to provide a means to manage statements on
27+ The purpose of libraries are to provide a means to manage statements on
2828disk and at runtime. ILFs provide a means to reference a collection
2929of statements on disk, and, when loaded, the symbol bindings provides means to
3030reference a statement already prepared for use on a given connection.
3131
3232The `postgresql.lib` package-module provides fundamental classes for supporting
33- categories and query libraries.
33+ categories and libraries.
3434
3535
36- Writing Query Libraries
37- =======================
36+ Writing Libraries
37+ =================
3838
39- ILF files are the recommended way to build a query library. These files use the
39+ ILF files are the recommended way to build a library. These files use the
4040naming convention "lib{NAME}.sql". The prefix and suffix are used describe the
4141purpose of the file and to provide a hint to editors that SQL highlighting
4242should be used. The format of an ILF takes the form::
@@ -179,8 +179,8 @@ In use::
179179 will be returned.
180180
181181
182- Using Query Libraries
183- =====================
182+ Using Libraries
183+ ===============
184184
185185After a library is created, it must be loaded before it can be bound using
186186programmer interfaces. The `postgresql.lib.load` interface provides the
@@ -297,11 +297,10 @@ that can be used in ILF libraries:
297297Symbol Execution Methods
298298========================
299299
300- One of the primary features of query libraries is the ability to state how a
301- statement is going to be used. Specifically, which
302- `postgresql.api.PreparedStatement` method should be executed when a Bound Symbol
303- is called. The following is a list of the symbol execution methods and the
304- effect it will have when invoked:
300+ The Symbol Execution Method provides a way to specify how a statement is going
301+ to be used. Specifically, which `postgresql.api.PreparedStatement` method
302+ should be executed when a Bound Symbol is called. The following is a list of
303+ the symbol execution methods and the effect it will have when invoked:
305304
306305 ``<default>`` (Empty component)
307306 Returns the entire result set in a single list object. If the statement does
@@ -434,7 +433,7 @@ Audience and Motivation
434433=======================
435434
436435This chapter covers advanced material. It is **not** recommended that categories
437- and query libraries be used for trivial applications or introductory projects.
436+ and libraries be used for trivial applications or introductory projects.
438437
439438.. note::
440439 Libraries and categories are not likely to be of interest to ORM or DB-API users.
@@ -473,9 +472,9 @@ simple, but it will be exhausting if repeated and error prone if the
473472initialization condition is not factored out. Additionally, if access to statement
474473metadata is needed, the above example is still lacking as it would require
475474execution of the statement and further protocol expectations to be established.
476- This is the province of query libraries: direct database interface management.
475+ This is the province of libraries: direct database interface management.
477476
478- Query libraries and categories are used to factor out and simplify
477+ Categories and Libraries are used to factor out and simplify
479478the above functionality so re-implementation is unnecessary. For example, an
480479ILF library containing the symbol::
481480
@@ -532,6 +531,6 @@ The following terms are used throughout this chapter:
532531
533532 Category
534533 An object supporting a classification for connectors that provides database
535- initialization facilities for produced connections. For query libraries,
534+ initialization facilities for produced connections. For libraries,
536535 `postgresql.lib.Category` objects are a set of Libraries,
537536 `postgresql.lib.Library`.
0 commit comments