Method to insert use requests to MIGRATION_REQUESTS table.
        request keys: migration_url, migration_input
326075
def insertMigrationRequest(self, request):
        
        conn = self.dbi.connection()
        # check if already queued.
        #If the migration_input is the same, but the src url is different,
        #We will consider it as a submitted request. YG 05-18-2012
        try:
            alreadyqueued = self.mgrlist.execute(conn,
                                                 migration_input=request["migration_input"])
            is_already_queued = len(alreadyqueued) > 0
            # close connection before returning json object
            if is_already_queued and conn:
                conn.close()
            #if the queued is not failed, then we don't need to do it again.
            #add a new migration_status=9 (terminal failure)
	    if is_already_queued and alreadyqueued[0]['migration_status'] == 2:
                return {"migration_report" : "REQUEST ALREADY QUEUED. Migration is finished",
                        "migration_details" : alreadyqueued[0] }
            elif is_already_queued and alreadyqueued[0]['migration_status'] != 9:
                return {"migration_report" : "REQUEST ALREADY QUEUED. Migration in progress",
                        "migration_details" : alreadyqueued[0] }
            elif is_already_queued and alreadyqueued[0]['migration_status'] == 9:
                return {"migration_report" : "REQUEST ALREADY QUEUED. Migration terminally failed. ",
                        "migration_details" : alreadyqueued[0] }
            else:
                # not already queued
                #Determine if its a dataset or block migration
                #The prepare list calls will check if the requested blocks/dataset already in destination.
                if request["migration_input"].find("#") != -1:
                    ordered_list = self.prepareBlockMigrationList(conn, request)
                else:
                    ordered_list = self.prepareDatasetMigrationList(conn, request)
            # now we have the blocks that need to be queued (ordered)
        except Exception as ex:
            if conn: conn.close()
            raise

        tran = conn.begin()
        try:
            # insert the request
            #request.update(migration_status=0)
            request['migration_request_id'] = self.sm.increment(conn, "SEQ_MR", tran)
            self.mgrin.execute(conn, request, tran)
            # INSERT the ordered_list
            totalQueued = 0
	    k = ordered_list.keys()
	    k.sort()
	    k.reverse()	
	    self.logger.debug("****************** ordered_list keys **********")
            self.logger.debug(k)
            #for iter in reversed(range(len(ordered_list))):
	    for iter in k:	
		self.logger.debug("length for Key: %s" %iter)
	        self.logger.debug(len(ordered_list[iter]))	
                if len(ordered_list[iter]) > 0:
                    daoinput = [{
                        "migration_block_id" :
                            self.sm.increment(conn, "SEQ_MB", tran),
                        "migration_request_id" :
                            request["migration_request_id"],
                        "migration_block_name" : blk,
                        "migration_order" : iter,
                        "migration_status" : 0,
                        "creation_date" : request['creation_date'],
                        "last_modification_date" : request['last_modification_date'],
                        "create_by" : request['create_by'],
                        "last_modified_by" : request['last_modified_by']
                        }
                             for blk in ordered_list[iter]]
                    self.mgrblkin.execute(conn, daoinput, tran)
                    totalQueued += len(ordered_list[iter])
            # all good ?, commit the transaction
            tran.commit()
            if conn: conn.close()
            # return things like (X blocks queued for migration)
            return {
                "migration_report" : "REQUEST QUEUED with total %d blocks to be migrated" %totalQueued,
                "migration_details" : request }
        except SQLAlchemyIntegrityError as ex:
	    e = "DBSMigration:  ENQUEUEING_FAILED1 from SQLAichemy Integrity Error. Reason may be (%s)" %(ex.statement + "; " + str(ex.params) + "; " + str(ex.orig))
	    self.logger.debug(e)		
	    import traceback
            tk = traceback.format_exc() 		
	    self.logger.debug(tk) 	
            tran.rollback()
            if conn: conn.close()
            if (str(ex).find("unique constraint") != -1 or
                str(ex).lower().find("duplicate") != -1):
                #FIXME: Need to check which unique key. YG 2/11/13
                #The unique constraints are: MIGRATION_REQUESTS(MIGRATION_INPUT)
                #MIGRATION_BLOCKS(MIGRATION_BLOCK_NAME, MIGRATION_REQUEST_ID)
                return {
                    "migration_report" : "REQUEST ALREADY QUEUED",
                    "migration_details" : request }
            else:
                if conn: conn.close()
		self.logger.error(tk)
                m = "DBSMigration:  ENQUEUEING_FAILED1."
                dbsExceptionHandler('dbsException-invalid-input2', m, self.logger.exception, e)
	except HTTPError as he:
	    raise he	
        except Exception as ex:
	    import traceback
            self.logger.error(traceback.format_exc())	
            if tran: tran.rollback()
            if conn: conn.close()
            m = "DBSMigration:  ENQUEUEING_FAILED."
            e = "DBSMigration:  ENQUEUEING_FAILED. General exception caught: Reason may be (%s)" %str(ex)
            dbsExceptionHandler('dbsException-invalid-input2', m, self.logger.exception, e)
        finally:
            if conn: conn.close()
1204764
def create_request(self, raw_request, **kwargs):
        
        r = self.request_class()
        for k, v in raw_request.items():
            if k.startswith('HTTP_'):
                r.set_header(k[5:], v)
            else:
                r.environ[k] = v

        r.method = raw_request['REQUEST_METHOD']
        r.path = raw_request['PATH_INFO']
        r.query = raw_request['QUERY_STRING']

        # handle headers not prefixed with http
        for k, t in {'CONTENT_TYPE': None, 'CONTENT_LENGTH': int}.items():
            v = r.environ.pop(k, None)
            if v:
                r.set_header(k, t(v) if t else v)

        if 'wsgi.input' in raw_request:

            if "CONTENT_LENGTH" in raw_request and int(r.get_header("CONTENT_LENGTH", 0)) <= 0:
                r.body_kwargs = {}

            else:
                if r.get_header('transfer-encoding', "").lower().startswith('chunked'):
                    raise IOError("Server does not support chunked requests")

                else:
                    r.body_input = raw_request['wsgi.input']

        else:
            r.body_kwargs = {}

        return r
876570
def insert(self, space_no, *args):
        
        d = self.replyQueue.get()
        packet = RequestInsert(self.charset, self.errors, d._ipro_request_id, space_no, Request.TNT_FLAG_ADD, *args)
        self.transport.write(bytes(packet))
        return d.addCallback(self.handle_reply, self.charset, self.errors, None)
1030018
def migrate_keys(self, host, port, keys, dest_db, timeout, *,
                     copy=False, replace=False):
        
        if not isinstance(host, str):
            raise TypeError("host argument must be str")
        if not isinstance(timeout, int):
            raise TypeError("timeout argument must be int")
        if not isinstance(dest_db, int):
            raise TypeError("dest_db argument must be int")
        if not isinstance(keys, (list, tuple)):
            raise TypeError("keys argument must be list or tuple")
        if not host:
            raise ValueError("Got empty host")
        if dest_db < 0:
            raise ValueError("dest_db must be greater equal 0")
        if timeout < 0:
            raise ValueError("timeout must be greater equal 0")
        if not keys:
            raise ValueError("keys must not be empty")

        flags = []
        if copy:
            flags.append(b'COPY')
        if replace:
            flags.append(b'REPLACE')
        flags.append(b'KEYS')
        flags.extend(keys)
        fut = self.execute(b'MIGRATE', host, port,
                           "", dest_db, timeout, *flags)
        return wait_ok(fut)
1194234
def insert(self, context):
	
		
		
		status_code, msg = self.__endpoint.post(
			"/resources/jdbc-connection-pool",
			data={
				"id": self.__name,
				"resType": self.__res_type,
				"datasourceClassname": self.__ds_classname,
				"property": props_value(self.__props)
			}
		)
		self.__available = True
1276206
public static InsertAllRequest of(String datasetId, String tableId, Iterable<RowToInsert> rows) {
    return newBuilder(datasetId, tableId, rows).build();
  }
1215280
def create_new_migration_record(self):
        
        migration_record = self.migration_model(
            name=self.name,
            version=self.latest_migration)
        self.session.add(migration_record)
        self.session.commit()
182
def add_migrations(self, migrations):
        
        if self.__closed:
            raise MigrationSessionError("Can't change applied session")
        self._to_apply.extend(migrations)
289756
def update_migration_info(direction)
      save, @verbose = @verbose, false

      create_migration_info_table_if_needed

      if direction.to_sym == :up
        execute("INSERT INTO #{migration_info_table} (#{migration_name_column}) VALUES (#{quoted_name})")
      elsif direction.to_sym == :down
        execute("DELETE FROM #{migration_info_table} WHERE #{migration_name_column} = #{quoted_name}")
      end
      @verbose = save
    end
924791
function (name, callback) {
    var formattedDate = name.split('-')[0].replace('/', '');
    formattedDate = moment(formattedDate, 'YYYY-MM-DD HH:mm:ss');
    formattedDate = moment(formattedDate).format('YYYY-MM-DD HH:mm:ss');
    var command = util.format('INSERT INTO %s  (name, ran_on) VALUES (\'%s\', \'%s\')', internals.migrationTable, name, formattedDate);
    return this.runSql(command).nodeify(callback);
  }
790768
def add_index(columns, index_name = nil)
      options = { name: index_name } if index_name
      migration.add_index(table_name, columns, options || {})
    end
954463
def apply_migrations(engine, connection, path):
    

    # Get migrations applied
    migrations_applied = get_migrations_applied(engine, connection)
    # print(migrationsApplied)

    # Get migrations folder
    for file in get_migrations_files(path):
        # Set vars
        basename = os.path.basename(os.path.dirname(file))

        # Skip migrations if they are already applied
        if is_applied(migrations_applied, basename):
            continue

        # Get migration source
        source = get_migration_source(file)
        # print (source);

        # Run migration
        run_migration(connection, source, engine)

        # Save migration
        save_migration(connection, basename)

        # Log
        print('   -> Migration `%s` applied' % (basename))

    # Log
    print(' * Migrations applied')

    return True
347987
def add_request(self, request):
        

        # Duplicate request name?
        if request.name in self.requests:
            raise ValueError('redefinition of request "{0}"'.format(request.name))
        self.requests[request.name] = request

        # Add the request URLs
        for method, url in request.urls:

            # URL with arguments?
            if RE_URL_ARG.search(url):
                request_regex = '^' + RE_URL_ARG_ESC.sub(r'/(?P<\1>[^/]+)', re.escape(url)) + '$'
                self.__request_regex.append((method, re.compile(request_regex), request))
            else:
                request_key = (method, url)
                if request_key in self.__request_urls:
                    raise ValueError('redefinition of request URL "{0}"'.format(url))
                self.__request_urls[request_key] = request
862911
def insert(self, key, column_parent, column, consistency_level):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_insert(key, column_parent, column, consistency_level)
    return d
82912
function importRequest(endpointSchema, id, parentId) {
  const name = endpointSchema.summary || `${endpointSchema.method} ${endpointSchema.path}`;
  return {
    _type: 'request',
    _id: id,
    parentId: parentId,
    name,
    method: endpointSchema.method.toUpperCase(),
    url: '{{ base_url }}' + pathWithParamsAsVariables(endpointSchema.path),
    body: prepareBody(endpointSchema),
    headers: prepareHeaders(endpointSchema),
    parameters: prepareQueryParams(endpointSchema),
  };
}
1108088
def insert(index, *args, &block)
      raise_if_locked
      index = assert_index(index)
      handler = self.class::Handler.new(*args, &block)
      @handlers.insert(index, handler)
    end
1028304
public static InsertAllRequest of(TableInfo tableInfo, Iterable<RowToInsert> rows) {
    return newBuilder(tableInfo.getTableId(), rows).build();
  }