create an INSERT statement to add a user-agent.
This is normally not needed since the agents.json file comes from
the database to which the data would be inserted.
972711
function addInsert(agent) {
/*
    `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `userAgent` VARCHAR(255) NOT NULL,
    `agentGroup_id` INT UNSIGNED NOT NULL DEFAULT '1',
    `agentSource_id` INT UNSIGNED NOT NULL DEFAULT '1',
    `timesReported` INT UNSIGNED NOT NULL DEFAULT '1',
    `status` TINYINT UNSIGNED NOT NULL DEFAULT '0',
    `description` TEXT,
    `created` DATETIME NULL,
    `modified` DATETIME NULL,
*/
    console.log("INSERT INTO `Agents` VALUES (NULL, '" + 
                quote(agent.agent) + "', '" +
                agent.groupId + "', '" +
                agent.sourceId + 
                "', '0', '0', '', NOW(), NOW());");
}
769782
def insert(self):
        """"""
        self.default_val = 0
        #fields = self.fields
        #fields = self.orm_class.depart(self.fields, is_update=False)
        #self.set_fields(fields)
        return self.interface.insert(
            self.schema,
            self.fields
        )

        return self.interface.insert(self.schema, self.fields)
740535
def create_user(self, name, password, is_super=False):
        
        statement = ddl.CreateUser(
            name=name, password=password, is_super=is_super
        )
        self._execute(statement)
247777
def create_db(self):
        
        self.add_role(self.auth_role_admin)
        self.add_role(self.auth_role_public)
        if self.count_users() == 0:
            log.warning(LOGMSG_WAR_SEC_NO_USER)
1094939
function insertPersonData(filename, tableSchema) {
  return getSampleData(filename).then(
      function(data) {
        var rows = data.map(function(obj) {
          obj.dateOfBirth = convertDate(obj.dateOfBirth);
          obj.dateOfDeath = convertDate(obj.dateOfDeath);
          return tableSchema.createRow(obj);
        });
        return db.insert().into(tableSchema).values(rows);
      });
}
470152
def add_session(session=None):
    
    """
    user_id, sid_s = session['user_id'], session.sid_s
    with db.session.begin_nested():
        session_activity = SessionActivity(
            user_id=user_id,
            sid_s=sid_s,
            ip=request.remote_addr,
            country=_ip2country(request.remote_addr),
            **_extract_info_from_useragent(
                request.headers.get('User-Agent', '')
            )
        )
        db.session.merge(session_activity)
981955
def create_insert():
    
    insert = upkey("insert").setResultsName("action")

    # VALUES
    attrs = Group(delimitedList(var)).setResultsName("attrs")
    value_group = Group(Suppress("(") + delimitedList(value) + Suppress(")"))
    values = Group(delimitedList(value_group)).setResultsName("list_values")
    values_insert = Suppress("(") + attrs + Suppress(")") + upkey("values") + values

    # KEYWORDS
    keyword = Group(var + Suppress("=") + value)
    item = Group(Suppress("(") + delimitedList(keyword) + Suppress(")"))
    keyword_insert = delimitedList(item).setResultsName("map_values")

    return insert + into + table + (values_insert | keyword_insert) + Optional(throttle)
137119
def add_job(self, job):
        
        self.cur.execute("INSERT INTO jobs VALUES(?,?,?,?,?)", (
            job["id"], job["description"], job["last-run"], job["next-run"], job["last-run-result"]))

        return True
439284
public void addPerson( final String name )
    {
        try ( Session session = driver.session() )
        {
            session.writeTransaction( new TransactionWork<Integer>()
            {
                @Override
                public Integer execute( Transaction tx )
                {
                    return createPersonNode( tx, name );
                }
            } );
        }
    }
32654
@Override
    public void createAgent(String agent_name, String path) {
        logger.fine("Creating agent " + agent_name + " in Main Container");
        Object reference = new Object();
        Object empty[] = new Object[1];
        empty[0] = reference;
        try {
            AgentController agentController = mainContainer.createNewAgent(
                    agent_name, path, empty);
            this.createdAgents.put(agent_name, agentController);
            agentController.start();
            logger.fine("Agent " + agent_name
                    + " created and started in Main Container");
            try {
                Thread.sleep(MILLIS_TO_WAIT_FOR_AGENT_STARTING);
            } catch (InterruptedException e) {
                logger.warning("It was not possible to wait for agent starting... Maybe, the agent is not completely started yet.");
            }
        } catch (StaleProxyException e) {
            logger.warning("Exception creating or starting agent in MainContainer... "
                    + e);
        }
        // Register the agent
    }
491838
def add_role(user, roles):
        
        def _add_role(role):
            user_role = UserRole()
            user_role.user_id = user.user_id
            user_role.role_id = role.role_id
            db.session.add(user_role)
            db.session.commit()
        [_add_role(role) for role in roles]
271768
def save(self, must_create=False):
        
        obj = Session(
            session_key=self._get_or_create_session_key(),
            session_data=self.encode(self._get_session(no_load=must_create)),
            expire_date=self.get_expiry_date(),
            user_agent=self.user_agent,
            user_id=self.user_id,
            ip=self.ip,
        )
        using = router.db_for_write(Session, instance=obj)
        try:
            with transaction.atomic(using):
                obj.save(force_insert=must_create, using=using)
        except IntegrityError as e:
            if must_create and 'session_key' in str(e):
                raise CreateError
            raise
27553
def add(self, instance):
        '''
        
        '''

        table = instance.__class__.__name__.lower()
        keys = ", ".join(vars(instance).keys())
        values = tuple(vars(instance).values())

        SQL = """INSERT INTO %s (%s) VALUES(""" % (table, keys)
        SQL += """ "%s",""" * len(values) % (values)
        SQL = SQL[:-1] + ")"

        if self.DEBUG: print(SQL)

        with Session(self.settings) as conn:
            try:
                c = conn.cursor()
                c.execute(SQL)
                conn.commit()
                return True
            except mysql.Error as e:
                if e.errno==1062:
                    print("Already saved to the database")
                    return True
                elif e.errno == 1146:
                    # Table does not exist
                    return True
                else:
                    raise e

                return True
301396
function insert()
    {
        $item = array();
        $item['owner'] = arg('owner', 'int');
        $item['name'] = arg('name', '/[^a-z0-9_]/i');
        $item['title'] = arg('title', 'dbsafe');
        $item['caption'] = arg('caption', 'dbsafe');
        $item['description'] = arg('description', 'dbsafe');
        $item['hint'] = arg('hint', 'dbsafe');
        $item['keywords'] = arg('keywords', 'dbsafe');
        $item['template'] = arg('template', 'dbsafe');
        $item['type'] = arg('type', 'dbsafe');
        $item['active'] = arg('active', 'int');
        $item['visible'] = arg('visible', 'int');
        $item['access'] = arg('access', 'int');
        $item['position'] = arg('position', 'int');
        $item['options'] = arg('options');
        $item['created'] = $item['updated'] = gettime('Y-m-d H:i:s');

        $temp = Eresus_CMS::getLegacyKernel()->sections->get("(`name`='" . $item['name'] .
        "') AND (`owner`='" . $item['owner'] . "')");
        if (count($temp) == 0)
        {
            Eresus_CMS::getLegacyKernel()->sections->add($item);
            dbReorderItems('pages', "`owner`='".arg('owner', 'int')."'");
            HTTP::redirect(Eresus_Kernel::app()->getPage()->url(array('id'=>'')));
        }
        else
        {
            Eresus_Kernel::app()->getPage()->addErrorMessage(
                sprintf(errItemWithSameName, $item['name']));
            saveRequest();
            HTTP::redirect(Eresus_CMS::getLegacyKernel()->request['referer']);
        }
    }
673182
def insertUserStore(siteStore, userStorePath):
    
    # The following may, but does not need to be in a transaction, because it
    # is merely an attempt to guess a reasonable filesystem name to use for
    # this avatar.  The user store being operated on is expected to be used
    # exclusively by this process.
    ls = siteStore.findUnique(LoginSystem)
    unattachedSubStore = Store(userStorePath)
    for lm in unattachedSubStore.query(LoginMethod,
                                       LoginMethod.account == unattachedSubStore.findUnique(LoginAccount),
                                       sort=LoginMethod.internal.descending):
        if ls.accountByAddress(lm.localpart, lm.domain) is None:
            localpart, domain = lm.localpart, lm.domain
            break
    else:
        raise AllNamesConflict()

    unattachedSubStore.close()

    insertLocation = siteStore.newFilePath('account', domain, localpart + '.axiom')
    insertParentLoc = insertLocation.parent()
    if not insertParentLoc.exists():
        insertParentLoc.makedirs()
    if insertLocation.exists():
        raise DatabaseDirectoryConflict()
    userStorePath.moveTo(insertLocation)
    ss = SubStore(store=siteStore, storepath=insertLocation)
    attachedStore = ss.open()
    # migrateUp() manages its own transactions because it interacts with two
    # different stores.
    attachedStore.findUnique(LoginAccount).migrateUp()
507893
function insert() {
		$args=[];
		$actr=0;
		$nctr=0;
		$fields='';
		$values='';
		$filter='';
		$pkeys=[];
		$nkeys=[];
		$ckeys=[];
		$inc=NULL;
		foreach ($this->fields as $key=>$field)
			if ($field['pkey'])
				$pkeys[$key]=$field['previous'];
		if (isset($this->trigger['beforeinsert']) &&
			\Base::instance()->call($this->trigger['beforeinsert'],
				[$this,$pkeys])===FALSE)
			return $this;
		foreach ($this->fields as $key=>&$field) {
			if ($field['pkey']) {
				$field['previous']=$field['value'];
				if (!$inc && $field['pdo_type']==\PDO::PARAM_INT &&
					empty($field['value']) && !$field['nullable'])
					$inc=$key;
				$filter.=($filter?' AND ':'').$this->db->quotekey($key).'=?';
				$nkeys[$nctr+1]=[$field['value'],$field['pdo_type']];
				$nctr++;
			}
			if ($field['changed'] && $key!=$inc) {
				$fields.=($actr?',':'').$this->db->quotekey($key);
				$values.=($actr?',':'').'?';
				$args[$actr+1]=[$field['value'],$field['pdo_type']];
				$actr++;
				$ckeys[]=$key;
			}
		}
		if ($fields) {
			$add=$aik='';
			if ($this->engine=='pgsql' && !empty($pkeys)) {
				$names=array_keys($pkeys);
				$aik=end($names);
				$add=' RETURNING '.$this->db->quotekey($aik);
			}
			$lID=$this->db->exec(
				(preg_match('/mssql|dblib|sqlsrv/',$this->engine) &&
				array_intersect(array_keys($pkeys),$ckeys)?
					'SET IDENTITY_INSERT '.$this->table.' ON;':'').
				'INSERT INTO '.$this->table.' ('.$fields.') '.
				'VALUES ('.$values.')'.$add,$args
			);
			if ($this->engine=='pgsql' && $lID && $aik)
				$this->_id=$lID[0][$aik];
			elseif ($this->engine!='oci')
				$this->_id=$this->db->lastinsertid();
			// Reload to obtain default and auto-increment field values
			if ($reload=(($inc && $this->_id) || $filter))
				$this->load($inc?
					[$inc.'=?',$this->db->value(
						$this->fields[$inc]['pdo_type'],$this->_id)]:
					[$filter,$nkeys]);
			if (isset($this->trigger['afterinsert']))
				\Base::instance()->call($this->trigger['afterinsert'],
					[$this,$pkeys]);
			// reset changed flag after calling afterinsert
			if (!$reload)
				foreach ($this->fields as $key=>&$field) {
					$field['changed']=FALSE;
					$field['initial']=$field['value'];
					unset($field);
				}
		}
		return $this;
	}
999405
function insertOrgAdminUser (job, next) {
    if (job.user) {
      const { id, name } = job.user
      const { id: organizationId } = job.organization

      userOps.insertUser(job.client, { id, name, organizationId }, (err, res) => {
        if (err) return next(err)
        job.user.id = res.rows[0].id

        userOps.insertPolicies(job.client, job.user.id, [{id: job.adminPolicyId, variables: {}}], utils.boomErrorWrapper(next))
      })

      return
    }

    next()
  }