> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# insert_records

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/insert_records.rs#L38-L45)
pub async fn [insert\_records](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/insert-records.md#method.insert_records)\<T: [KineticaRecord](https://docs.kinetica.com/content/api/rust/trait.KineticaRecord.md)>( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), data: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<T>, ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[InsertRecordsResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Add records to specified tableAdds multiple records to the specified table. The operation is synchronous, meaning that a response will not be returned until all the records are fully inserted and available. The response payload provides the counts of the number of records actually inserted and/or updated, and can provide the unique identifier of each added record.The `options` parameter can be used to customize this function’s behavior.The update\_on\_existing\_pk option specifies the record collision policy for inserting into a table with a primary key, but is ignored if no primary key exists.The return\_record\_ids option indicates that the database should return the unique identifiers of inserted records.The records are encoded by the schema of the first.

##### Arguments

<ul>
  <li>`table_name` - Name of table to which the records are to be added, in \[schema\_name.]table\_name format, using standard name resolution rules. Must be an existing table.</li>
  <li>`data` - The records to send.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/insert_records.rs#L75-L95)
pub async fn [insert\_records\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/insert-records.md#method.insert_records_with_opts)\<T: [KineticaRecord](https://docs.kinetica.com/content/api/rust/trait.KineticaRecord.md)>( \&self, table\_name: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), data: [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<T>, options: [InsertRecordsRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[InsertRecordsResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Add records to specified tableAdds multiple records to the specified table. The operation is synchronous, meaning that a response will not be returned until all the records are fully inserted and available. The response payload provides the counts of the number of records actually inserted and/or updated, and can provide the unique identifier of each added record.The `options` parameter can be used to customize this function’s behavior.The update\_on\_existing\_pk option specifies the record collision policy for inserting into a table with a primary key, but is ignored if no primary key exists.The return\_record\_ids option indicates that the database should return the unique identifiers of inserted records.The records are encoded by the schema of the first.

##### Arguments

<ul>
  <li>`table_name` - Name of table to which the records are to be added, in \[schema\_name.]table\_name format, using standard name resolution rules. Must be an existing table.</li>
  <li>`data` - The records to send.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/insert_records.rs#L99-L117)
pub async fn [insert\_records\_request](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/insert-records.md#method.insert_records_request)\<T: [KineticaRecord](https://docs.kinetica.com/content/api/rust/trait.KineticaRecord.md)>( \&self, request: &[InsertRecordsRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsRequest.md)\<T>, ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[InsertRecordsResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`InsertRecordsRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsRequest) to the `/insert/records` endpoint, its records encoded by the schema of the first.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/insert_records.rs#L121-L132)
pub async fn [insert\_records\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/insert-records.md#method.insert_records_raw)( \&self, request: &[RawInsertRecordsRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.RawInsertRecordsRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[InsertRecordsResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`RawInsertRecordsRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.RawInsertRecordsRequest) to the `/insert/records` endpoint, returning the response as the server sends it.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/insert_records.rs#L136-L148)
pub async fn [insert\_records\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/insert-records.md#method.insert_records_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[RawInsertRecordsRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.RawInsertRecordsRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[InsertRecordsResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.InsertRecordsResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`RawInsertRecordsRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.RawInsertRecordsRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.