]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixup
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Sep 2010 20:06:39 +0000 (16:06 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Sep 2010 20:06:39 +0000 (16:06 -0400)
doc/build/core/expression_api.rst
doc/build/orm/session.rst
lib/sqlalchemy/engine/reflection.py

index 8431fd6c8f15765a52ee684b6d3ad2ef8ed36ba6..c01f84c2cbf0766b90d4c0716695139a7a8536d4 100644 (file)
@@ -52,7 +52,10 @@ The expression package uses functions to construct SQL expressions.  The return
         >>> print func.count(1)
         count(:param_1)
 
-   Any name can be given to `func`.  If the function name is unknown to SQLAlchemy, it will be rendered exactly as is.  For common SQL functions which SQLAlchemy is aware of, the name may be interpreted as a *generic function* which will be compiled appropriately to the target database::
+   Any name can be given to `func`. If the function name is unknown to
+   SQLAlchemy, it will be rendered exactly as is. For common SQL functions
+   which SQLAlchemy is aware of, the name may be interpreted as a *generic
+   function* which will be compiled appropriately to the target database::
     
         >>> print func.current_timestamp()
         CURRENT_TIMESTAMP
@@ -62,13 +65,19 @@ The expression package uses functions to construct SQL expressions.  The return
         >>> print func.stats.yield_curve(5, 10)
         stats.yield_curve(:yield_curve_1, :yield_curve_2)
         
-   SQLAlchemy can be made aware of the return type of functions to enable type-specific lexical and result-based behavior.  For example, to ensure that a string-based function returns a Unicode value and is similarly treated as a string in expressions, specify :class:`~sqlalchemy.types.Unicode` as the type:
+   SQLAlchemy can be made aware of the return type of functions to enable
+   type-specific lexical and result-based behavior. For example, to ensure
+   that a string-based function returns a Unicode value and is similarly
+   treated as a string in expressions, specify
+   :class:`~sqlalchemy.types.Unicode` as the type:
     
         >>> print func.my_string(u'hi', type_=Unicode) + ' ' + \
         ... func.my_string(u'there', type_=Unicode)
         my_string(:my_string_1) || :my_string_2 || my_string(:my_string_3)
         
-   Functions which are interpreted as "generic" functions know how to calculate their return type automatically.   For a listing of known generic functions, see :ref:`generic_functions`.
+   Functions which are interpreted as "generic" functions know how to
+   calculate their return type automatically. For a listing of known generic
+   functions, see :ref:`generic_functions`.
    
 .. autofunction:: insert
 
@@ -204,10 +213,18 @@ Classes
 Generic Functions
 -----------------
 
-SQL functions which are known to SQLAlchemy with regards to database-specific rendering, return types and argument behavior.  Generic functions are invoked like all SQL functions, using the :attr:`func` attribute::
+SQL functions which are known to SQLAlchemy with regards to database-specific
+rendering, return types and argument behavior. Generic functions are invoked
+like all SQL functions, using the :attr:`func` attribute::
     
     select([func.count()]).select_from(sometable)
     
+Note that any name not known to :attr:`func` generates the function name as is
+- there is no restriction on what SQL functions can be called, known or
+unknown to SQLAlchemy, built-in or user defined. The section here only
+describes those functions where SQLAlchemy already knows what argument and
+return types are in use.
+    
 .. automodule:: sqlalchemy.sql.functions
    :members:
    :undoc-members:
index 29db3d5d6c17e42c8e57e729c3a997349714b82b..61fb2fb29e8fc51c12fb3599a61a7e08cd59c379 100644 (file)
@@ -811,10 +811,12 @@ transaction::
         item1.foo = 'bar'
         item2.bar = 'foo'
 
-        # commit- will immediately go into a new transaction afterwards
+        # commit- will immediately go into 
+        # a new transaction on next use.
         session.commit()
     except:
-        # rollback - will immediately go into a new transaction afterwards.
+        # rollback - will immediately go into 
+        # a new transaction on next use.
         session.rollback()
 
 A session which is configured with ``autocommit=True`` may be placed into a
index 4a34ef1c67dc010112ad37470585b6dab1158688..def889e6d99821c7b20acbeb87a29f2487a53652 100644 (file)
@@ -50,27 +50,27 @@ class Inspector(object):
     consistent interface as well as caching support for previously
     fetched metadata.
     
-    The preferred method to construct an :class:`Inspector` is via the
+    The preferred method to construct an :class:`.Inspector` is via the
     :meth:`Inspector.from_engine` method.   I.e.::
     
         engine = create_engine('...')
         insp = Inspector.from_engine(engine)
     
     Where above, the :class:`~sqlalchemy.engine.base.Dialect` may opt
-    to return an :class:`Inspector` subclass that provides additional
+    to return an :class:`.Inspector` subclass that provides additional
     methods specific to the dialect's target database.
     
     """
 
     def __init__(self, bind):
-        """Initialize a new :class:`Inspector`.
+        """Initialize a new :class:`.Inspector`.
 
         :param bind: a :class:`~sqlalchemy.engine.base.Connectable`, 
           which is typically an instance of 
           :class:`~sqlalchemy.engine.base.Engine` or 
           :class:`~sqlalchemy.engine.base.Connection`.
         
-        For a dialect-specific instance of :class:`Inspector`, see
+        For a dialect-specific instance of :class:`.Inspector`, see
         :meth:`Inspector.from_engine`
 
         """
@@ -98,12 +98,12 @@ class Inspector(object):
           :class:`~sqlalchemy.engine.base.Engine` or 
           :class:`~sqlalchemy.engine.base.Connection`.
         
-        This method differs from direct a direct constructor call of :class:`Inspector`
+        This method differs from direct a direct constructor call of :class:`.Inspector`
         in that the :class:`~sqlalchemy.engine.base.Dialect` is given a chance to provide
-        a dialect-specific :class:`Inspector` instance, which may provide additional
+        a dialect-specific :class:`.Inspector` instance, which may provide additional
         methods.
         
-        See the example at :class:`Inspector`.
+        See the example at :class:`.Inspector`.
         
         """
         if hasattr(bind.dialect, 'inspector'):