/// <summary>
        /// Data table version.
        /// </summary>
        /// <param name="destinationTableName"></param>
        /// <param name="connection"></param>
        /// <param name="sqlServerBulkInsertOptions"></param>
        /// <returns></returns>
        private static GenericBulkCopy GetBulkCopy(
            string destinationTableName,
            DbConnection connection,
            GenericBulkCopyOptions sqlServerBulkInsertOptions = null)
        {
            sqlServerBulkInsertOptions = sqlServerBulkInsertOptions ?? new GenericBulkCopyOptions();

            var bulkCopy = new GenericBulkCopy(connection, sqlServerBulkInsertOptions);

            return(bulkCopy);
        }
        //TODO: needs to support mapping columns

        /// <summary>
        /// Bulk upload enumerable by generating insert statements. If using sql server, use SqlServer extension methods instead.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="items"></param>
        /// <param name="dbConnection"></param>
        /// <param name="destinationTable"></param>
        /// <param name="databaseEngine"></param>
        /// <param name="bulkInsertOptions"></param>
        public static async Task BulkInsertUsingInsertStatements <T>(
            this IEnumerable <T> items,
            DbConnection dbConnection,
            string destinationTable,
            DatabaseEngine databaseEngine,
            GenericBulkCopyOptions bulkInsertOptions = null)
        {
            var d = new GenericBulkCopy(dbConnection, bulkInsertOptions);

            await d.WriteToServer(items.ToDataReader(), destinationTable, databaseEngine);
        }