Output the SQL type for a Java String.
350554
protected void appendStringType(StringBuilder sb, FieldType fieldType, int fieldWidth) {
		if (isVarcharFieldWidthSupported()) {
			sb.append("VARCHAR(").append(fieldWidth).append(')');
		} else {
			sb.append("VARCHAR");
		}
	}
615228
def full_datatype_to_mysql(d: str) -> str:
    """"""
    d = d.upper()
    (s, length) = split_long_sqltype(d)
    if d in ["VARCHAR(MAX)", "NVARCHAR(MAX)"]:
        # http://wiki.ispirer.com/sqlways/mysql/data-types/longtext
        return "LONGTEXT"
    elif d in ["VARBINARY(MAX)"] or s in ["IMAGE"]:
        # http://wiki.ispirer.com/sqlways/mysql/data-types/varbinary
        return "LONGBLOB"
    else:
        return d
954516
def _get_sql(filename):
    """"""
    with open(os.path.join(SQL_DIR, filename), 'r') as f:
        return f.read()
854451
public static String getDefaultJdbcTypeFor(String javaType)
    {
        return _jdbcMappings.containsKey(javaType) ? (String)_jdbcMappings.get(javaType) : JDBC_DEFAULT_TYPE;
    }
732618
@Override
	public JavaType getJavaType(final JDBCType jdbcType, final String jdbcTypeName) {
		if (JDBCType.OTHER.equals(jdbcType)) {
			if ("json".equalsIgnoreCase(jdbcTypeName) || "jsonb".equalsIgnoreCase(jdbcTypeName)) {
				// JSON型の場合、文字列として扱う
				return super.getJavaType(JDBCType.NVARCHAR, jdbcTypeName);
			}
		}
		return super.getJavaType(jdbcType, jdbcTypeName);
	}
1372729
public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException
    {
        if (this.isNull())
            statement.setNull(iParamColumn, Types.BIT);
        else
        {
            String strBitSupported = DBConstants.TRUE;
            if (this.getRecord() != null)
                if (this.getRecord().getTable() != null)
                    if (this.getRecord().getTable().getDatabase().getProperties() != null)
                strBitSupported = (String)this.getRecord().getTable().getDatabase().getProperties().get(SQLParams.BIT_TYPE_SUPPORTED);
            if (DBConstants.TRUE.equals(strBitSupported))
                statement.setBoolean(iParamColumn, this.getState());
            else
                statement.setByte(iParamColumn, (this.getState() ? (byte)1 : (byte)0));
        }
    }
640187
private void init_jdbcTypes() throws SQLException
    {
        ReportQuery q = (ReportQuery) getQueryObject().getQuery();
        m_jdbcTypes = new int[m_attributeCount];
        
        // try to get jdbcTypes from Query
        if (q.getJdbcTypes() != null)
        {
            m_jdbcTypes = q.getJdbcTypes();
        }
        else
        {
            ResultSetMetaData rsMetaData = getRsAndStmt().m_rs.getMetaData();
            for (int i = 0; i < m_attributeCount; i++)
            {
                m_jdbcTypes[i] = rsMetaData.getColumnType(i + 1);
            }
            
        }
    }
178123
function GetSqliteType()
	{
		$rt = $this->Type;
		switch ($this->Type)
		{
			case "int":
				$rt = "integer";
				break;
			case "smallint":
				$rt = "integer";
				break;
			case "tinyint":
				$rt = "integer";
				break;
			case "varchar":
				$rt = "text";
				break;
			case "text":
				$rt = "text";
				break;
			case "tinytext":
				$rt = "text";
				break;
			case "date":
				$rt = "datetime";
				break;
			case "datetime":
				$rt = "datetime";
				break;
			case "mediumint":
				$rt = "integer";
				break;
			case "bigint":
				$rt = "integer";
				break;
			case "decimal":
				$rt = "real";
				break;
			case "float":
				$rt = "real";
				break;
			default;
				break;
		}

		return $rt;
	}
1276520
public static int getJDBCTypeCode(int type) {

        switch (type) {

            case Types.SQL_BLOB :
                return Types.BLOB;

            case Types.SQL_CLOB :
                return Types.CLOB;

            case Types.SQL_BIGINT :
                return Types.BIGINT;

            case Types.SQL_BINARY :
                return Types.BINARY;

            case Types.SQL_VARBINARY :
                return Types.VARBINARY;

            case Types.SQL_BIT :
            case Types.SQL_BIT_VARYING :
                return Types.BIT;

            default :
                return type;
        }
    }
890946
def sql(self):
        
        assert self.in_key and not self.nullable   # primary key attributes are never nullable
        return '`{name}` {type} NOT NULL COMMENT "{comment}"'.format(
            name=self.name, type=self.type, comment=self.comment)
617709
def value_to_sql_str(v):
    
    if v is None:
        return 'null'

    if type(v) in (types.IntType, types.FloatType, types.LongType):
        return str(v)

    if type(v) in (types.StringType, types.UnicodeType):
        return "'%s'" %(v.replace(u"'", u"\\'"))

    if isinstance(v, datetime):
        return "'%s'" %(v.strftime("%Y-%m-%d %H:%M:%S"))

    if isinstance(v, date):
        return "'%s'" %(v.strftime("%Y-%m-%d"))

    return str(v)
476640
public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) 
    {
        String strType = (String)properties.get(DBSQLTypes.FLOAT);
        if (strType == null)
            strType = DBSQLTypes.FLOAT;     // The default SQL Type (Byte)
        return  strType;        // The default SQL Type
    }
1008293
static int mysqlToJavaType(int type, final int meta, boolean isBinary) {
        int javaType;

        if (type == LogEvent.MYSQL_TYPE_STRING) {
            if (meta >= 256) {
                int byte0 = meta >> 8;
                if ((byte0 & 0x30) != 0x30) {
                    /* a long CHAR() field: see #37426 */
                    type = byte0 | 0x30;
                } else {
                    switch (byte0) {
                        case LogEvent.MYSQL_TYPE_SET:
                        case LogEvent.MYSQL_TYPE_ENUM:
                        case LogEvent.MYSQL_TYPE_STRING:
                            type = byte0;
                    }
                }
            }
        }

        switch (type) {
            case LogEvent.MYSQL_TYPE_LONG:
                javaType = Types.INTEGER;
                break;

            case LogEvent.MYSQL_TYPE_TINY:
                javaType = Types.TINYINT;
                break;

            case LogEvent.MYSQL_TYPE_SHORT:
                javaType = Types.SMALLINT;
                break;

            case LogEvent.MYSQL_TYPE_INT24:
                javaType = Types.INTEGER;
                break;

            case LogEvent.MYSQL_TYPE_LONGLONG:
                javaType = Types.BIGINT;
                break;

            case LogEvent.MYSQL_TYPE_DECIMAL:
                javaType = Types.DECIMAL;
                break;

            case LogEvent.MYSQL_TYPE_NEWDECIMAL:
                javaType = Types.DECIMAL;
                break;

            case LogEvent.MYSQL_TYPE_FLOAT:
                javaType = Types.REAL; // Types.FLOAT;
                break;

            case LogEvent.MYSQL_TYPE_DOUBLE:
                javaType = Types.DOUBLE;
                break;

            case LogEvent.MYSQL_TYPE_BIT:
                javaType = Types.BIT;
                break;

            case LogEvent.MYSQL_TYPE_TIMESTAMP:
            case LogEvent.MYSQL_TYPE_DATETIME:
            case LogEvent.MYSQL_TYPE_TIMESTAMP2:
            case LogEvent.MYSQL_TYPE_DATETIME2:
                javaType = Types.TIMESTAMP;
                break;

            case LogEvent.MYSQL_TYPE_TIME:
            case LogEvent.MYSQL_TYPE_TIME2:
                javaType = Types.TIME;
                break;

            case LogEvent.MYSQL_TYPE_NEWDATE:
            case LogEvent.MYSQL_TYPE_DATE:
                javaType = Types.DATE;
                break;

            case LogEvent.MYSQL_TYPE_YEAR:
                javaType = Types.VARCHAR;
                break;

            case LogEvent.MYSQL_TYPE_ENUM:
                javaType = Types.INTEGER;
                break;

            case LogEvent.MYSQL_TYPE_SET:
                javaType = Types.BINARY;
                break;

            case LogEvent.MYSQL_TYPE_TINY_BLOB:
            case LogEvent.MYSQL_TYPE_MEDIUM_BLOB:
            case LogEvent.MYSQL_TYPE_LONG_BLOB:
            case LogEvent.MYSQL_TYPE_BLOB:
                if (meta == 1) {
                    javaType = Types.VARBINARY;
                } else {
                    javaType = Types.LONGVARBINARY;
                }
                break;

            case LogEvent.MYSQL_TYPE_VARCHAR:
            case LogEvent.MYSQL_TYPE_VAR_STRING:
                if (isBinary) {
                    // varbinary在binlog中为var_string类型
                    javaType = Types.VARBINARY;
                } else {
                    javaType = Types.VARCHAR;
                }
                break;

            case LogEvent.MYSQL_TYPE_STRING:
                if (isBinary) {
                    // binary在binlog中为string类型
                    javaType = Types.BINARY;
                } else {
                    javaType = Types.CHAR;
                }
                break;

            case LogEvent.MYSQL_TYPE_GEOMETRY:
                javaType = Types.BINARY;
                break;

            // case LogEvent.MYSQL_TYPE_BINARY:
            // javaType = Types.BINARY;
            // break;
            //
            // case LogEvent.MYSQL_TYPE_VARBINARY:
            // javaType = Types.VARBINARY;
            // break;

            default:
                javaType = Types.OTHER;
        }

        return javaType;
    }
1255942
def datatype(dbtype, description, cursor):
    """"""
    dt = cursor.db.introspection.get_field_type(dbtype, description)
    if type(dt) is tuple:
        return dt[0]
    else:
        return dt
445509
def debug_sql(sql: str, *args: Any) -> None:
    """"""
    log.debug("SQL: %s" % sql)
    if args:
        log.debug("Args: %r" % args)
891624
function stringToGraphQLType(type) {
  switch (type) {
    case 'String':
      return GraphQLString;
    case 'Number':
      return GraphQLFloat;
    case 'Date':
      return GraphQLDate;
    case 'Buffer':
      return GraphQLBuffer;
    case 'Boolean':
      return GraphQLBoolean;
    case 'ObjectID':
      return GraphQLID;
    default:
      return GraphQLGeneric;
  }
}
138676
def type_str(self, short=False):
        
        if short:
            return javabridge.static_call(
                "weka/core/Attribute", "typeToStringShort", "(Lweka/core/Attribute;)Ljava/lang/String;",
                self.jobject)
        else:
            return javabridge.static_call(
                "weka/core/Attribute", "typeToString", "(Lweka/core/Attribute;)Ljava/lang/String;",
                self.jobject)