]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
8152: add documentation for postgresql dialect time and timestamp types
authorDaniel Hall <daniel.hall@moesol.com>
Tue, 28 Jun 2022 19:03:34 +0000 (15:03 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 28 Jun 2022 23:03:33 +0000 (19:03 -0400)
add documentation for postgresql dialect time and timestamp types

This pull request is:

- [ X] A documentation / typographical error fix
- Good to go, no issue or tests are needed

**Have a nice day!**

Closes: #8185
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8185
Pull-request-sha: 2b76fe080babd72f8e5615b34cb544abbc446a28

Change-Id: Ib71b35d106d0d0686e5551f07b88486b6c59624d
(cherry picked from commit 300ce85463474c0264b37c0f2a8baa5f3cf3d822)

doc/build/dialects/postgresql.rst
lib/sqlalchemy/dialects/postgresql/base.py

index d30c03885d5d69aa8096903e372f5fbdedfcbf15..c58aaee9b48a3d0fb522c86ac6d8bc73a57b1c3d 100644 (file)
@@ -89,6 +89,12 @@ construction arguments, are as follows:
 
 .. autoclass:: REGCLASS
 
+.. autoclass:: TIMESTAMP
+    :members: __init__
+
+.. autoclass:: TIME
+    :members: __init__
+
 .. autoclass:: TSVECTOR
 
 .. autoclass:: UUID
index db88d9e6a898b4c2f54407f113de180dc9850d7d..dbaced5db533e8a9977e7334e13c1c4376da4333 100644 (file)
@@ -1682,13 +1682,39 @@ class REGCLASS(sqltypes.TypeEngine):
 
 
 class TIMESTAMP(sqltypes.TIMESTAMP):
+
+    """Provide the PostgreSQL TIMESTAMP type."""
+
+    __visit_name__ = "TIMESTAMP"
+
     def __init__(self, timezone=False, precision=None):
+        """Construct a TIMESTAMP.
+
+        :param timezone: boolean value if timezone present, default False
+        :param precision: optional integer precision value
+
+         .. versionadded:: 1.4
+
+        """
         super(TIMESTAMP, self).__init__(timezone=timezone)
         self.precision = precision
 
 
 class TIME(sqltypes.TIME):
+
+    """PostgreSQL TIME type."""
+
+    __visit_name__ = "TIME"
+
     def __init__(self, timezone=False, precision=None):
+        """Construct a TIME.
+
+        :param timezone: boolean value if timezone present, default False
+        :param precision: optional integer precision value
+
+         .. versionadded:: 1.4
+
+        """
         super(TIME, self).__init__(timezone=timezone)
         self.precision = precision