]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
edits
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 25 Nov 2007 23:34:26 +0000 (23:34 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 25 Nov 2007 23:34:26 +0000 (23:34 +0000)
doc/build/content/types.txt

index 8f9cb1f7c53c57ed3085487939fdb43cc4a5063d..364599f0be0e01cd0ca35c5872e374ad25308bdb 100644 (file)
@@ -19,7 +19,7 @@ Following is a rundown of the standard types.
 
 #### String
 
-This type is the base type for all string and character types, such as `Unicode`, `Text`, `CLOB`, etc.  By default it generates a VARCHAR in DDL.  It includes an argument `length`, which indicates the length in characters of the type, as well as `convert_unicode` and `assert_unicode`, which are booleans.  `length` will be used as the length argument when generating DDL.  If `length` is omitted, the `String` type resolves into the `Text` type.
+This type is the base type for all string and character types, such as `Unicode`, `TEXT`, `CLOB`, etc.  By default it generates a VARCHAR in DDL.  It includes an argument `length`, which indicates the length in characters of the type, as well as `convert_unicode` and `assert_unicode`, which are booleans.  `length` will be used as the length argument when generating DDL.  If `length` is omitted, the `String` type resolves into the `TEXT` type.
 
 `convert_unicode=True` indicates that incoming strings, if they are Python `unicode` strings, will be encoded into a raw bytestring using the `encoding` attribute of the dialect (defaults to `utf-8`).  Similarly, raw bytestrings coming back from the database will be decoded into `unicode` objects on the way back.
 
@@ -43,6 +43,10 @@ TODO
 
 TODO
 
+#### Interval
+
+TODO
+
 #### Binary
 
 TODO
@@ -51,46 +55,13 @@ TODO
 
 TODO
 
-#### Summary of Types
-    {python title="package sqlalchemy.types"}
-    class String(TypeEngine):
-        def __init__(self, length=None)
-        
-    class Integer(TypeEngine)
-    
-    class SmallInteger(Integer)
-    
-    class Numeric(TypeEngine): 
-        def __init__(self, precision=10, length=2)
-    
-    class Float(Numeric):
-        def __init__(self, precision=10)
-    
-    # DateTime, Date and Time types deal with datetime objects from the Python datetime module
-    class DateTime(TypeEngine)
-    
-    class Date(TypeEngine)
-    
-    class Time(TypeEngine)
-    
-    class Binary(TypeEngine): 
-        def __init__(self, length=None)
-        
-    class Boolean(TypeEngine)
-    
-    # converts unicode strings to raw bytes
-    # as bind params, raw bytes to unicode as 
-    # rowset values, using the unicode encoding 
-    # setting on the engine (defaults to 'utf-8')
-    class Unicode(TypeDecorator):
-        impl = String
-    
-    # uses the pickle protocol to serialize data
-    # in/out of Binary columns
-    class PickleType(TypeDecorator):
-        impl = Binary
+#### PickleType
 
-More specific subclasses of these types are available, which various database engines may choose to implement specifically, allowing finer grained control over types:
+TODO
+
+#### SQL-Specific Types {@name=sqlspecific}
+
+These are subclasses of the generic types and include:
 
     {python}
     class FLOAT(Numeric)
@@ -106,9 +77,6 @@ More specific subclasses of these types are available, which various database en
     class BLOB(Binary)
     class BOOLEAN(Boolean)
 
-When using a specific database engine, these types are adapted even further via a set of database-specific subclasses defined by the database engine.
-There may eventually be more type objects that are defined for specific databases.  An example of this would be Postgres' Array type.
-
 ### Dialect Specific Types {@name=dialect}
 
 Each dialect has its own set of types, many of which are available only within that dialect.  For example, MySQL has a `BigInteger` type and Postgres has an `Inet` type.  To use these, import them from the module explicitly:
@@ -173,4 +141,4 @@ Once you make your type, its immediately useable:
         Column('data', MyType(16))
         )
         
-        
\ No newline at end of file
+