<commit_before>﻿using System.Data;
using System.Data.Common;

namespace DevExpress.DataAccess.BigQuery {
    public class BigQueryCommandBuilder : DbCommandBuilder {
        public BigQueryDataAdapter DataDataAdapter
        {
            get { return (BigQueryDataAdapter) base.DataAdapter; }
            set { this.DataDataAdapter = value; }
        }

        public BigQueryCommandBuilder() {
            this.QuotePrefix = "[";
            this.QuoteSuffix = "]";
        }

        public BigQueryCommandBuilder(BigQueryDataAdapter dataAdapter) {
            DataDataAdapter = dataAdapter;
        }

        public override string QuoteIdentifier(string unquotedIdentifier) {
            unquotedIdentifier = unquotedIdentifier.Replace("\\", "\\\\").Replace("[", "\\[").Replace("]", "\\]");
            return string.Concat(QuotePrefix, unquotedIdentifier, QuoteSuffix);
        }

        public override string UnquoteIdentifier(string quotedIdentifier) {
            string unquotedIdentifier;
            if(string.IsNullOrEmpty(quotedIdentifier)) {
                unquotedIdentifier = quotedIdentifier;
            } else {
                if(quotedIdentifier[0] == '[') {
                    quotedIdentifier = quotedIdentifier.Substring(1, quotedIdentifier.Length - 2);
                    quotedIdentifier = quotedIdentifier.Replace("\\[", "[").Replace("\\]", "]").Replace("\\\\", "\\");
                }
                unquotedIdentifier = quotedIdentifier;
            }
            return unquotedIdentifier;
        }


        public BigQueryCommand GetDeleteCommand() {
            return (BigQueryCommand) base.GetDeleteCommand();
        }

        public BigQueryCommand GetDeleteCommand(bool useColumnsForParameterNames) {
            return (BigQueryCommand) base.GetDeleteCommand(useColumnsForParameterNames);
        }

        public BigQueryCommand GetInsertCommand() {
            return (BigQueryCommand) base.GetInsertCommand();
        }

        public BigQueryCommand GetInsertCommand(bool useColumnsForParameterNames) {
            return (BigQueryCommand) base.GetInsertCommand(useColumnsForParameterNames);
        }

        protected override DataTable GetSchemaTable(DbCommand sourceCommand) {
            using(IDataReader dataReader = sourceCommand.ExecuteReader(CommandBehavior.SchemaOnly)) {
                return dataReader.GetSchemaTable();
            }
        }

        protected override void ApplyParameterInfo(DbParameter parameter, DataRow row, StatementType statementType, bool whereClause) {
        }

        protected override string GetParameterName(int parameterOrdinal) {
            return "@p" + parameterOrdinal;
        }

        protected override string GetParameterName(string parameterName) {
            return "@" + parameterName;
        }

        protected override string GetParameterPlaceholder(int parameterOrdinal) {
            return GetParameterName(parameterOrdinal);
        }

        protected override void SetRowUpdatingHandler(DbDataAdapter dataAdapter) {
            if(this.DataDataAdapter == dataAdapter) {
                ((BigQueryDataAdapter) dataAdapter).RowUpdating -= OnRowUpdatingHandler;
            }
            else {
                ((BigQueryDataAdapter) dataAdapter).RowUpdating += OnRowUpdatingHandler;
            }
        }

        void OnRowUpdatingHandler(object sender, RowUpdatingEventArgs e) {
            this.RowUpdatingHandler(e);
        }
    }
}
<commit_msg>fix warnings<commit_after>﻿using System.Data;
using System.Data.Common;

namespace DevExpress.DataAccess.BigQuery {
    public class BigQueryCommandBuilder : DbCommandBuilder {
        public BigQueryDataAdapter DataDataAdapter
        {
            get { return (BigQueryDataAdapter) base.DataAdapter; }
            set { this.DataDataAdapter = value; }
        }

        public BigQueryCommandBuilder() {
            this.QuotePrefix = "[";
            this.QuoteSuffix = "]";
        }

        public BigQueryCommandBuilder(BigQueryDataAdapter dataAdapter) {
            DataDataAdapter = dataAdapter;
        }

        public override string QuoteIdentifier(string unquotedIdentifier) {
            unquotedIdentifier = unquotedIdentifier.Replace("\\", "\\\\").Replace("[", "\\[").Replace("]", "\\]");
            return string.Concat(QuotePrefix, unquotedIdentifier, QuoteSuffix);
        }

        public override string UnquoteIdentifier(string quotedIdentifier) {
            string unquotedIdentifier;
            if(string.IsNullOrEmpty(quotedIdentifier)) {
                unquotedIdentifier = quotedIdentifier;
            } else {
                if(quotedIdentifier[0] == '[') {
                    quotedIdentifier = quotedIdentifier.Substring(1, quotedIdentifier.Length - 2);
                    quotedIdentifier = quotedIdentifier.Replace("\\[", "[").Replace("\\]", "]").Replace("\\\\", "\\");
                }
                unquotedIdentifier = quotedIdentifier;
            }
            return unquotedIdentifier;
        }


        public new BigQueryCommand GetDeleteCommand() {
            return (BigQueryCommand) base.GetDeleteCommand();
        }

        public new BigQueryCommand GetDeleteCommand(bool useColumnsForParameterNames) {
            return (BigQueryCommand) base.GetDeleteCommand(useColumnsForParameterNames);
        }

        public new BigQueryCommand GetInsertCommand() {
            return (BigQueryCommand) base.GetInsertCommand();
        }

        public new BigQueryCommand GetInsertCommand(bool useColumnsForParameterNames) {
            return (BigQueryCommand) base.GetInsertCommand(useColumnsForParameterNames);
        }

        protected override DataTable GetSchemaTable(DbCommand sourceCommand) {
            using(IDataReader dataReader = sourceCommand.ExecuteReader(CommandBehavior.SchemaOnly)) {
                return dataReader.GetSchemaTable();
            }
        }

        protected override void ApplyParameterInfo(DbParameter parameter, DataRow row, StatementType statementType, bool whereClause) {
        }

        protected override string GetParameterName(int parameterOrdinal) {
            return "@p" + parameterOrdinal;
        }

        protected override string GetParameterName(string parameterName) {
            return "@" + parameterName;
        }

        protected override string GetParameterPlaceholder(int parameterOrdinal) {
            return GetParameterName(parameterOrdinal);
        }

        protected override void SetRowUpdatingHandler(DbDataAdapter dataAdapter) {
            if(this.DataDataAdapter == dataAdapter) {
                ((BigQueryDataAdapter) dataAdapter).RowUpdating -= OnRowUpdatingHandler;
            }
            else {
                ((BigQueryDataAdapter) dataAdapter).RowUpdating += OnRowUpdatingHandler;
            }
        }

        void OnRowUpdatingHandler(object sender, RowUpdatingEventArgs e) {
            this.RowUpdatingHandler(e);
        }
    }
}

{'fraction_non_alphanumeric': 0.0875661754185148, 'fraction_numerical': 0.0008584919158677923, 'mean_word_length': 2.36381135707411, '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': '2222764', 'n_tokens_mistral': 1678, 'n_tokens_neox': 1611, 'n_words': 315}