]> 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 19:06:29 +0000 (15:06 -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

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

index ea0c2aa42a034c533019f7da3f4c5a20caf7469b..7cd413e25ef2d78fef17912e3850df2f1d5d0ced 100644 (file)
@@ -92,6 +92,12 @@ construction arguments, are as follows:
 
 .. autoclass:: REGCLASS
 
+.. autoclass:: TIMESTAMP
+    :members: __init__
+
+.. autoclass:: TIME
+    :members: __init__
+
 .. autoclass:: TSVECTOR
 
 .. autoclass:: UUID
index 374adcac1ff88d6def31b15538e9e815617625e6..81b677187284b1edfbba64429954908fd90cc02f 100644 (file)
@@ -114,13 +114,39 @@ class REGCLASS(sqltypes.TypeEngine[str]):
 
 
 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