Insert a packet into the database

        Arguments
            packet
                The :class:`ait.core.tlm.Packet` instance to insert into
                the database
556207
def insert(self, packet, **kwargs):
        ''' 

        '''
        values = [ ]
        pd     = packet._defn

        for defn in pd.fields:
            val = getattr(packet.raw, defn.name)

            if val is None and defn.name in pd.history:
                val = getattr(packet.history, defn.name)
            
            values.append(val)

        qmark = ['?'] * len(values)
        sql   = 'INSERT INTO %s VALUES (%s)' % (pd.name, ', '.join(qmark))


        self._conn.execute(sql, values)
911258
def insert(self, context):
	
		
		
		status_code, msg = self.__endpoint.post(
			"/resources/connector-connection-pool",
			data={
				"id": self.__name,
				"resourceAdapterName": self.__res_adapter_name,
				"connectiondefinitionname": self.__conn_def_name,
				"property": props_value(self.__props)
			}
		)
		self.__available = True
546256
def insert(self, table, value, ignore=False, commit=True):
        
        value_q, _args = self._value_parser(value, columnname=False)
        _sql = ''.join(['INSERT', ' IGNORE' if ignore else '', ' INTO ', self._backtick(table),
                        ' (', self._backtick_columns(value), ') VALUES (', value_q, ');'])

        if self.debug:
            return self.cur.mogrify(_sql, _args)

        self.cur.execute(_sql, _args)
        if commit:
            self.conn.commit()
        return self.cur.lastrowid
40817
def db_insert_record(self, table_name, columns):
        
        bindings = ('?,' * len(columns)).strip(',')
        values = [None] * len(columns)
        sql = 'INSERT INTO {} ({}) VALUES ({})'.format(table_name, ', '.join(columns), bindings)
        cur = self.db_conn.cursor()
        cur.execute(sql, values)
1019542
def insert_into_table(table, data):
    

    fields = data['fields']
    fields['date'] = datetime.datetime.now().date()

    query = '('

    for key in fields.keys():
        query += key + ','

    query = query[:-1:] + ")"

    client.execute(f"INSERT INTO {table} {query} VALUES", [tuple(fields.values())])
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
941563
def queuedb_append(path, queue_id, name, data):
    
    sql = "INSERT INTO queue VALUES (?,?,?);"
    args = (name, queue_id, data)

    db = queuedb_open(path)
    if db is None:
        raise Exception("Failed to open %s" % path)

    cur = db.cursor()
    res = queuedb_query_execute(cur, sql, args)

    db.commit()
    db.close()
    return True
315699
def _create_table(self, packet_defn):
        ''' 
        '''
        cols = ('%s %s' % (defn.name, self._getTypename(defn)) for defn in packet_defn.fields)
        sql  = 'CREATE TABLE IF NOT EXISTS %s (%s)' % (packet_defn.name, ', '.join(cols))

        self._conn.execute(sql)
        self._conn.commit()
935415
def insert(self):
    """"""
    if not self.curs:
      raise LIGOLwDBError, "Database connection not initalized"
    if len(self.table) == 0:
      raise LIGOLwDBError, 'attempt to insert empty table'
    for tab in self.table.keys():
      # find and add any missing unique ids
      generate = []
      missingcols = [k for k in self.ldb.uniqueids[tab] 
        if k not in self.table[tab]['column']]
      for m in missingcols:
        generate.append(',BLOB(GENERATE_UNIQUE())')
        self.table[tab]['orderedcol'].append(m)
      # and construct the sql query
      self.table[tab]['query'] = ' '.join( 
        ['INSERT INTO', tab, '(', ','.join(self.table[tab]['orderedcol']), 
        ') VALUES (', ','.join(['?' for x in self.table[tab]['column']]) , 
        ''.join(generate), ')'])
    for tabtup in self.ldb.tables:
      tab = tabtup[0].lower()
      try:
        try: 
          self.curs.executemany(self.table[tab]['query'],
            self.table[tab]['stream'])
          rowcount = self.curs.rowcount
        except DB2.Error, e:
          self.curs.execute('rollback')
          msg = e[2] 
          msg += self.xml() + '\n' 
          msg += str(self.table[tab]['query']) + '\n' 
          msg += str(self.table[tab]['stream']) + '\n'
          raise LIGOLwDBError, msg
        except DB2.Warning, e:
          self.curs.execute('rollback')
          raise LIGOLwDBError, e[2]
        #except Exception, e:
        #  self.curs.execute('rollback')
        #  raise LIGOLwDBError, e[2]
      except KeyError:
        pass
    self.curs.execute('commit')
    return rowcount
200056
def put(self, *args, **kwargs):
        
        return self.session.put(*args, **self.get_kwargs(**kwargs))
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)
322791
def insert(self, **kwargs):
        
        if self.is_valid:
            before = self.before_insert()
            if before:
                return before

            try:
                self._document['_id'] = self.insert_one(self._document)

                self.after_insert()

                return self._document
            except PyMongoException as exc:
                return PyMongoError(
                    error_message=exc.details.get(
                        'errmsg', exc.details.get('err', 'PyMongoError.')
                    ),
                    operation='insert', collection=type(self).__name__,
                    document=self._document,
                )

        return self._errors
945266
def _insert(self, name, value, timestamp, intervals, **kwargs):
    '''
    
    '''
    # TODO: confirm that this is in fact using the indices correctly.
    for interval,config in self._intervals.items():
      timestamps = self._normalize_timestamps(timestamp, intervals, config)
      for tstamp in timestamps:
        self._insert_data(name, value, tstamp, interval, config, **kwargs)
451494
function insertData(filename, tableSchema) {
  return getSampleData(filename).then(
      function(data) {
        var rows = data.map(function(obj) {
          return tableSchema.createRow(obj);
        });
        return db.insert().into(tableSchema).values(rows);
      });
}
925716
public function insertMtIntoDb()
    {
        $this->getMtDataToDb();
        $db       = $this->connectDatabase($this->sdkConfig[self::SDP_DATABASE_CONFIG_KEY]);
        $insertId = $db
            ->setTable(self::TABLE_SMS_LOG . date(self::TABLE_SMS_LOG_SUFFIX))
            ->add($this->mtDataToDb);
        $this->logger->debug(__FUNCTION__, 'Insert MT Into DB Data: ' . json_encode($this->mtDataToDb));
        $this->logger->debug(__FUNCTION__, 'Insert MT Into DB InsertID: ' . json_encode($insertId));

        return $insertId;
    }
170621
async def insert(query):
    
    assert isinstance(query, peewee.Insert),\
        ("Error, trying to run insert coroutine"
         "with wrong query class %s" % str(query))

    cursor = await _execute_query_async(query)

    try:
        if query._returning:
            row = await cursor.fetchone()
            result = row[0]
        else:
            database = _query_db(query)
            last_id = await database.last_insert_id_async(cursor)
            result = last_id
    finally:
        await cursor.release()

    return result
978502
def insert_param(self, param):
        
        self._current_params = tuple([param] + list(self._current_params))