2020
2121__all__ = [
2222 'Message' ,
23- 'PreparedStatement ' ,
23+ 'Statement ' ,
2424 'Chunks' ,
2525 'Rows' ,
2626 'Cursor' ,
@@ -193,7 +193,7 @@ def parameters(self) -> (tuple, None):
193193
194194 @propertydoc
195195 @abstractproperty
196- def statement (self ) -> ("PreparedStatement " , None ):
196+ def statement (self ) -> ("Statement " , None ):
197197 """
198198 The query object used to create the cursor. `None`, if unknown.
199199
@@ -218,7 +218,7 @@ class Cursor(
218218 set. Cursors publish a file-like interface for reading tuples from a cursor
219219 declared on the database.
220220
221- `Cursor` objects are created by invoking the `PreparedStatement .declare`
221+ `Cursor` objects are created by invoking the `Statement .declare`
222222 method or by opening a cursor using an identifier via the
223223 `Database.cursor_from_id` method.
224224 """
@@ -299,18 +299,19 @@ def seek(self, offset, whence = 'ABSOLUTE'):
299299 FROM_END will effectively be ABSOLUTE.
300300 """
301301
302- class PreparedStatement (
302+ class Statement (
303303 Element ,
304304 collections .Callable ,
305305 collections .Iterable ,
306306):
307307 """
308- Instances of `PreparedStatement ` are returned by the `prepare` method of
308+ Instances of `Statement ` are returned by the `prepare` method of
309309 `Database` instances.
310310
311- A PreparedStatement is an Iterable as well as Callable. This feature is
312- supported for queries that have the default arguments filled in or take no
313- arguments at all. It allows for things like:
311+ A Statement is an Iterable as well as Callable.
312+
313+ The Iterable interface is supported for queries that take no arguments at
314+ all. It allows the syntax::
314315
315316 >>> for x in db.prepare('select * FROM table'):
316317 ... pass
@@ -415,7 +416,7 @@ def parameter_types(self) -> [type]:
415416 """
416417
417418 @abstractmethod
418- def clone (self ) -> "PreparedStatement " :
419+ def clone (self ) -> "Statement " :
419420 """
420421 Create a new statement object using the same factors as `self`.
421422
@@ -561,6 +562,7 @@ def close(self) -> None:
561562 """
562563 Close the prepared statement releasing resources associated with it.
563564 """
565+ PreparedStatement = Statement
564566
565567class StoredProcedure (
566568 Element ,
@@ -882,9 +884,9 @@ def execute(sql) -> None:
882884 """
883885
884886 @abstractmethod
885- def prepare (self , sql : str ) -> PreparedStatement :
887+ def prepare (self , sql : str ) -> Statement :
886888 """
887- Create a new `PreparedStatement ` instance bound to the connection
889+ Create a new `Statement ` instance bound to the connection
888890 using the given SQL.
889891
890892 >>> s = db.prepare("SELECT 1")
@@ -896,9 +898,9 @@ def prepare(self, sql : str) -> PreparedStatement:
896898 @abstractmethod
897899 def statement_from_id (self ,
898900 statement_id : "The statement's identification string." ,
899- ) -> PreparedStatement :
901+ ) -> Statement :
900902 """
901- Create a `PreparedStatement ` object that was already prepared on the
903+ Create a `Statement ` object that was already prepared on the
902904 server. The distinction between this and a regular query is that it
903905 must be explicitly closed if it is no longer desired, and it is
904906 instantiated using the statement identifier as opposed to the SQL
@@ -916,7 +918,7 @@ def cursor_from_id(self,
916918 `Cursor` objects created this way must *not* be closed when the object
917919 is garbage collected. Rather, the user must explicitly close it for
918920 the server resources to be released. This is in contrast to `Cursor`
919- objects that are created by invoking a `PreparedStatement ` or a SRF
921+ objects that are created by invoking a `Statement ` or a SRF
920922 `StoredProcedure`.
921923 """
922924
0 commit comments