// Path: src/main/java/us/monoid/psql/async/converter/Converters.java
// public class Converters {
// 
// 	public static final StringConverter stringConverter = new StringConverter();
// 	public static final NumberConverter shortConverter = new NumberConverter(2);
// 	public static final NumberConverter intConverter = new NumberConverter(4);
// 	public static final NumberConverter longConverter = new NumberConverter(8);
// 	public static final JsonConverter jsonConverter = new JsonConverter();
// 
// }


import java.util.HashMap;
import java.util.Map;
import us.monoid.psql.async.converter.Converters;
package us.monoid.psql.async;



/**
 * Built-in PostgresQL types.  
 * 
 * @author beders
 * 
 */
// Some types are commented out as they are used internally mostly
/* Created via the following SQL:
 * 	SELECT n.nspname AS schema,
		t.oid,
		pg_catalog.format_type ( t.oid, NULL ) AS name,
		t.typname AS internal_name,
		CASE
		    WHEN t.typrelid != 0
		    THEN CAST ( 'tuple' AS pg_catalog.text )
		    WHEN t.typlen < 0
		    THEN CAST ( 'var' AS pg_catalog.text )
		    ELSE CAST ( t.typlen AS pg_catalog.text )
		END AS size,
		pg_catalog.array_to_string (
		    ARRAY( SELECT e.enumlabel
			    FROM pg_catalog.pg_enum e
			    WHERE e.enumtypid = t.oid
			    ORDER BY e.oid ), E'\n'
		    ) AS elements,
		pg_catalog.obj_description ( t.oid, 'pg_type' ) AS description
	    FROM pg_catalog.pg_type t
	    LEFT JOIN pg_catalog.pg_namespace n
		ON n.oid = t.typnamespace
	    WHERE ( t.typrelid = 0
		    OR ( SELECT c.relkind = 'c'
			    FROM pg_catalog.pg_class c
			    WHERE c.oid = t.typrelid
			)
		)
		AND NOT EXISTS
		    ( SELECT 1
			FROM pg_catalog.pg_type el
			WHERE el.oid = t.typelem
			    AND el.typarray = t.oid
		    )
	       
		AND pg_catalog.pg_type_is_visible ( t.oid )
	    ORDER BY 1, 2;
 * 
 * 
 */
public class Types {
	static Map<Integer,Type> types = new HashMap<>();
	
	// public static final Type "Any" = new Type(""any"",2276,4); //
	public static final Type Abstime = new Type("abstime", 702, 4); // absolute, limited-range date and time (Unix system time)
	public static final Type AbstimeArray = new Type("abstime[]", 1023, -1); //
	public static final Type Aclitem = new Type("aclitem", 1033, 12); // access control list
	public static final Type AclitemArray = new Type("aclitem[]", 1034, -1); //
	// public static final Type Anyarray = new Type("anyarray",2277,-1); //
	// public static final Type Anyelement = new Type("anyelement",2283,4); //
	// public static final Type Anyenum = new Type("anyenum",3500,4); //
	// public static final Type Anynonarray = new Type("anynonarray",2776,4); //
	// public static final Type Anyrange = new Type("anyrange",3831,-1); //
// Path: src/main/java/us/monoid/psql/async/converter/Converters.java
// public class Converters {
// 
// 	public static final StringConverter stringConverter = new StringConverter();
// 	public static final NumberConverter shortConverter = new NumberConverter(2);
// 	public static final NumberConverter intConverter = new NumberConverter(4);
// 	public static final NumberConverter longConverter = new NumberConverter(8);
// 	public static final JsonConverter jsonConverter = new JsonConverter();
// 
// }


// Path: src/main/java/us/monoid/psql/async/Types.java
import java.util.HashMap;
import java.util.Map;
import us.monoid.psql.async.converter.Converters;

package us.monoid.psql.async;



/**
 * Built-in PostgresQL types.  
 * 
 * @author beders
 * 
 */
// Some types are commented out as they are used internally mostly
/* Created via the following SQL:
 * 	SELECT n.nspname AS schema,
		t.oid,
		pg_catalog.format_type ( t.oid, NULL ) AS name,
		t.typname AS internal_name,
		CASE
		    WHEN t.typrelid != 0
		    THEN CAST ( 'tuple' AS pg_catalog.text )
		    WHEN t.typlen < 0
		    THEN CAST ( 'var' AS pg_catalog.text )
		    ELSE CAST ( t.typlen AS pg_catalog.text )
		END AS size,
		pg_catalog.array_to_string (
		    ARRAY( SELECT e.enumlabel
			    FROM pg_catalog.pg_enum e
			    WHERE e.enumtypid = t.oid
			    ORDER BY e.oid ), E'\n'
		    ) AS elements,
		pg_catalog.obj_description ( t.oid, 'pg_type' ) AS description
	    FROM pg_catalog.pg_type t
	    LEFT JOIN pg_catalog.pg_namespace n
		ON n.oid = t.typnamespace
	    WHERE ( t.typrelid = 0
		    OR ( SELECT c.relkind = 'c'
			    FROM pg_catalog.pg_class c
			    WHERE c.oid = t.typrelid
			)
		)
		AND NOT EXISTS
		    ( SELECT 1
			FROM pg_catalog.pg_type el
			WHERE el.oid = t.typelem
			    AND el.typarray = t.oid
		    )
	       
		AND pg_catalog.pg_type_is_visible ( t.oid )
	    ORDER BY 1, 2;
 * 
 * 
 */
public class Types {
	static Map<Integer,Type> types = new HashMap<>();
	
	// public static final Type "Any" = new Type(""any"",2276,4); //
	public static final Type Abstime = new Type("abstime", 702, 4); // absolute, limited-range date and time (Unix system time)
	public static final Type AbstimeArray = new Type("abstime[]", 1023, -1); //
	public static final Type Aclitem = new Type("aclitem", 1033, 12); // access control list
	public static final Type AclitemArray = new Type("aclitem[]", 1034, -1); //
	// public static final Type Anyarray = new Type("anyarray",2277,-1); //
	// public static final Type Anyelement = new Type("anyelement",2283,4); //
	// public static final Type Anyenum = new Type("anyenum",3500,4); //
	// public static final Type Anynonarray = new Type("anynonarray",2776,4); //
	// public static final Type Anyrange = new Type("anyrange",3831,-1); //
	public static final Type Bigint = new Type("bigint", 20, 8, Converters.longConverter); // ~18 digit integer, 8-byte storage