Insert a new record into the array.  Return TRUE if successful.
Prior data with the same key is NOT overwritten
357653
static function Configtable_insert(PHP_ParserGenerator_Config $data)
    {
        $h = self::confighash($data);
        if (isset(self::$x4a[$h])) {
            $np = self::$x4a[$h];
        } else {
            $np = 0;
        }
        while ($np) {
            if (self::Configcmp($np->data, $data) == 0) {
                /* An existing entry with the same key is found. */
                /* Fail because overwrite is not allows. */
                return 0;
            }
            $np = $np->next;
        }
        /* Insert the new data */
        $np = array('data' => $data, 'next' => 0, 'from' => 0);
        $np = new PHP_ParserGenerator_StateNode;
        $np->data = $data;
        if (isset(self::$x4a[$h])) {
            self::$x4a[$h]->from = $np->next;
            $np->next = self::$x4a[$h];
        }
        $np->from = $np;
        self::$x4a[$h] = $np;
        return 1;
    }
1277169
public function create_record(array $data) {
		if(is_array($data) && count($data)) {
			$params = array();
			$sqlFields = "";
			$sqlValues = "";
			foreach($data as $field=>$value) {
				$sqlFields = ToolBox::create_list($sqlFields, $field, ", ");
				$sqlValues = ToolBox::create_list($sqlValues, ':'. $field, ", ");
				$params[$field] = $value;
			}
			
			$sql = 'INSERT INTO '. $this->tableName .' ('. $sqlFields .') VALUES ('. $sqlValues .')';			
			
			try {
				$newId = $this->dbObj->run_insert($sql, $params, $this->seqName);
			}
			catch(Exception $e) {
				throw new Exception(__METHOD__ .":: failed to create record, DETAILS::: ". $e->getMessage());
			}
		}
		else {
			throw new Exception(__METHOD__ .":: no data passed");
		}
		return($newId);
	}
42903
private Row insertNoCheck(Session session, PersistentStore store,
                              Object[] data) {

        Row row = (Row) store.getNewCachedObject(session, data);

        store.indexRow(session, row);
        session.addInsertAction(this, row);

        return row;
    }
1099413
def insert_values(self):
        
        if self._insert_values is None:
            self._insert_values = self._prepare_insert(
                tmpl=self._insert_values_tmpl,
                placeholder_for_id=True,
                record_class=self.record_class,
                field_names=self.field_names,
            )
        return self._insert_values
1320294
def []=(key, value)
      hashed_key = hash_key(key)
      @store.transaction do
        entry = @store.new(Entry, key, value)

        if (existing_entry = @btree.get(hashed_key))
          # There is already an existing entry for this hashed key.
          if existing_entry.is_a?(Collisions)
            # Find the right index to insert the new entry. If there is
            # already an entry with the same key overwrite that entry.
            index_to_insert = 0
            overwrite = false
            existing_entry.each do |ae|
              if ae.key == key
                overwrite = true
                break
              end
              index_to_insert += 1
            end
            self.entry_counter += 1 unless overwrite
            existing_entry[index_to_insert] = entry
          elsif existing_entry.key == key
            # The existing value is for the identical key. We can safely
            # overwrite
            @btree.insert(hashed_key, entry)
          else
            # There is a single existing entry, but for a different key. Create
            # a new PEROBS::Array and store both entries.
            array_entry = @store.new(Collisions)
            array_entry << existing_entry
            array_entry << entry
            @btree.insert(hashed_key, array_entry)
            self.entry_counter += 1
          end
        else
          # No existing entry. Insert the new entry.
          @btree.insert(hashed_key, entry)
          self.entry_counter += 1
        end
      end
    end
1222360
public void insertData(PersistentStore store, Object[] data) {

        Row row = (Row) store.getNewCachedObject(null, data);

        store.indexRow(null, row);
        store.commitPersistence(row);
    }
1287800
public function insertRecord(array $data, $returnData = false)
    {
        $countedRecords = count($this->getRecords());
        $data[$this->primaryKey] = $countedRecords > 1 ? $countedRecords + 1 : 1;
        $this->database->getReference()
            ->getChild($this->table)
            ->getChild($countedRecords)
            ->set($data);

        if ($returnData) {
            return $this->getRecord($data[$this->primaryKey]);
        }

        return $this;
    }
542013
def _add_record(table, data, buffer_size):
    
    fields = table.fields
    # remove any keys that aren't relation fields
    for invalid_key in set(data).difference([f.name for f in fields]):
        del data[invalid_key]
    table.append(Record.from_dict(fields, data))
    # write if requested and possible
    if buffer_size is not None and table.is_attached():
        # for now there isn't a public method to get the number of new
        # records, so use private members
        if (len(table) - 1) - table._last_synced_index > buffer_size:
            table.commit()
1143496
protected function insert_object() {
		// If the "prev_create" filter returns false we'll bail out of the create and return
		// false, indicating that the save failed. This provides a chance for any
		// hooks to cancel create operations if validations fail or whatever.
		if ( false === apply_filters( $this->prefix( 'prev_create' ), true ) ) {
			return false;
		}

		/**
		 * Fires creating action.
		 *
		 * @param static $wp_object Current object instance.
		 */
		do_action( $this->prefix( 'creating' ), $this );

		$insert_id = $this->perform_insert();

		if ( is_int( $insert_id ) && $insert_id > 0 ) {
			// Set new ID after insert success.
			$this->id = $insert_id;

			$this->exists = true;

			$this->recently_created = true;

			/**
			 * Fires after wp-object is created.
			 *
			 * @param static $wp_object Current object instance.
			 */
			do_action( $this->prefix( 'created' ), $this );

			return true;
		}

		return false;
	}
1259501
def insert_record(self,
                      table: str,
                      fields: Sequence[str],
                      values: Sequence[Any],
                      update_on_duplicate_key: bool = False) -> int:
        """"""
        self.ensure_db_open()
        if len(fields) != len(values):
            raise AssertionError("Field/value mismatch")
        if update_on_duplicate_key:
            sql = get_sql_insert_or_update(table, fields, self.get_delims())
        else:
            sql = get_sql_insert(table, fields, self.get_delims())
        sql = self.localize_sql(sql)
        log.debug("About to insert_record with SQL template: " + sql)
        try:
            cursor = self.db.cursor()
            debug_sql(sql, values)
            cursor.execute(sql, values)
            # ... binds the placeholders (?, %s) to values in the process
            new_pk = get_pk_of_last_insert(cursor)
            log.debug("Record inserted.")
            return new_pk
        except:  # nopep8
            log.exception("insert_record: Failed to insert record.")
            raise
489150
public function dbInsert() {
		BLog::addToLog('[Items.Item.' . $this->tableName . ']: Inserting data...');
		if (!$db = \Brilliant\BFactory::getDBO()) {
			return false;
		}
		//Forming query...
		$this->modified = new \Brilliant\BDateTime();
		//For import we need ability to set `created`
		if (empty($this->created)) {
			$this->created = new \Brilliant\BDateTime();
		}
		$qr = $this->dbInsertQuery();
		//Running query...
		$q = $db->query($qr);
		if (empty($q)) {
			return false;
		}
		$this->{$this->primaryKeyName} = $db->insertId();
		$this->isNew = false;
		//Updating cache...
		$this->updateCache();
		//Return result
		return true;
	}
130656
protected function _insert(array $data)
    {
        $data = $this->_setData($data);
        $sql = Sql::createSql($this->getAdapter())->insert($this->getTableName());
        $event = new Save([
            'action' => Save::INSERT,
            'data' => $data,
            'abort' => false
        ]);
        $this->getEventManager()->trigger(Save::BEFORE_SAVE, $this, $event);
        if ($event->abort) {
            return false;
        }
        $result = $sql->set($event->data)->execute();

        if ($result > 0) {
            $pmk = $this->getPrimaryKey();
            $this->$pmk = $this->getAdapter()->getLastInsertId();
            $this->getEventManager()->trigger(Save::AFTER_SAVE, $this, $event);
        }
        return $result > 0;
    }
548406
public function insertRecord($name, $value)
    {
        if ($this->isRecordZero($value)) {
            return false;
        }

        $tableName = $this->getTableNameToInsert($value);
        $fields    = $this->getInsertFields();
        $record    = $this->getInsertRecordBind();

        $this->getModel()->insertRecord($tableName, $fields, $record, $name, $value);

        return true;
    }
1199864
def save(options={:validate => true})
      context = self.new_record? ? :create : :update
      return false if options[:validate] && !valid?(context)
      
      run_callbacks(context) do
        if context == :create
          key = self.class.persistence.insert(self)
        else
          key = self.class.persistence.update(self)
        end
        self.persist!
        key
      end
    end
218376
def insert(self, loc, column, value, allow_duplicates=False,
               inplace=False):
        
        out = self if inplace else self.copy()
        out._frame.insert(loc, column, value,
                          allow_duplicates=allow_duplicates)
        if not inplace:
            return out
9442
def addRecord(self, record):
        
        if self._destroyed:
            return
        
        if not self.uiRecordBTN.isChecked():
            return
        
        self._queue.append(record)
314478
public int[] insert(Connection conn, Collection<Entity> records) throws SQLException {
		return insert(conn, records.toArray(new Entity[records.size()]));
	}