<commit_before>import datetime

from .base import Database


class InsertVar:
    """
    A late-binding cursor variable that can be passed to Cursor.execute
    as a parameter, in order to receive the id of the row created by an
    insert statement.
    """
    types = {
        'FloatField': Database.NATIVE_FLOAT,
        'CharField': str,
        'DateTimeField': Database.TIMESTAMP,
        'DateField': Database.DATETIME,
        'DecimalField': Database.NUMBER,
    }

    def __init__(self, field):
        internal_type = getattr(field, 'target_field', field).get_internal_type()
        self.db_type = self.types.get(internal_type, int)

    def bind_parameter(self, cursor):
        param = cursor.cursor.var(self.db_type)
        cursor._insert_id_var = param
        return param<commit_msg>Refs #29444 -- Made db.backends.oracle.utils.InsertVar use str as default.<commit_after>import datetime

from .base import Database


class InsertVar:
    """
    A late-binding cursor variable that can be passed to Cursor.execute
    as a parameter, in order to receive the id of the row created by an
    insert statement.
    """
    types = {
        'AutoField': int,
        'BigAutoField': int,
        'SmallAutoField': int,
        'IntegerField': int,
        'BigIntegerField': int,
        'SmallIntegerField': int,
        'PositiveSmallIntegerField': int,
        'PositiveIntegerField': int,
        'FloatField': Database.NATIVE_FLOAT,
        'DateTimeField': Database.TIMESTAMP,
        'DateField': Database.DATETIME,
        'DecimalField': Database.NUMBER,
    }

    def __init__(self, field):
        internal_type = getattr(field, 'target_field', field).get_internal_type()
        self.db_type = self.types.get(internal_type, str)

    def bind_parameter(self, cursor):
        param = cursor.cursor.var(self.db_type)
        cursor._insert_id_var = param
        return param
{'fraction_non_alphanumeric': 0.09753539590980598, 'fraction_numerical': 0.0026219192448872575, 'mean_word_length': 2.7707509881422925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5880505', 'n_tokens_mistral': 555, 'n_tokens_neox': 540, 'n_words': 150}