> ## 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.

# Row

> Row — Kinetica Rust API

[gpudb\_api](https://docs.kinetica.com/content/api/rust/index.md)::<wbr />[sql](https://docs.kinetica.com/content/api/rust/sql/index.md)
[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L663-L665)&#x20;

<pre>`pub struct Row { /* private fields */ }`</pre>

A single row from a SQL result set.Provides type-safe access to column values by name.

## Example

```rust theme={null}
use gpudb_api::Row;

let id: i64 = row.get("id")?;
let name: String = row.get("name")?;
let score: Option<f64> = row.get_opt("score")?;
```

## Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L667-L760)
impl [Row](https://docs.kinetica.com/content/api/rust/sql/struct.Row.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L669-L671)
pub fn [new](#method.new)(values: [HashMap](https://doc.rust-lang.org/1.98.1/std/collections/hash/map/struct.HashMap.html)\<[String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), [Value](https://docs.rs/serde_json/1.0.149/serde_json/value/enum.Value.html)>) -> Self

Create a new row from a map of column values

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L696-L704)
pub fn [get](#method.get)\<T: [DeserializeOwned](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.DeserializeOwned.html)>(\&self, column: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html)) -> [SqlOpResult](https://docs.kinetica.com/content/api/rust/sql/type.SqlOpResult.md)\<T>

Get a column value, returning an error if the column doesn’t exist or can’t be converted.

##### Type Parameters

<ul>
  <li>
    `T` - The Rust type to convert to. Supported types:

    <ul>
      <li>Integers: `i8`, `i16`, `i32`, `i64`, `u8`, `u16`, `u32`, `u64`</li>
      <li>Floats: `f32`, `f64`</li>
      <li>Boolean: `bool`</li>
      <li>String: `String`</li>
      <li>Any type implementing `DeserializeOwned`</li>
    </ul>
  </li>
</ul>

##### Example

```rust theme={null}
use gpudb_api::Row;

let id: i64 = row.get("id")?;
let name: String = row.get("name")?;
let price: f64 = row.get("price")?;
```

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L723-L736)
pub fn [get\_opt](#method.get_opt)\<T: [DeserializeOwned](https://docs.rs/serde_core/1.0.228/serde_core/de/trait.DeserializeOwned.html)>( \&self, column: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), ) -> [SqlOpResult](https://docs.kinetica.com/content/api/rust/sql/type.SqlOpResult.md)\<[Option](https://doc.rust-lang.org/1.98.1/core/option/enum.Option.html)\<T>>

Get a column value as an Option, returning None if the value is null.Returns an error only if the column doesn’t exist.

##### Example

```rust theme={null}
use gpudb_api::Row;

let score: Option<f64> = row.get_opt("score")?;
if let Some(s) = score {
    println!("Score: {}", s);
}
```

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L739-L742)
pub fn [get\_raw](#method.get_raw)(\&self, column: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html)) -> [SqlOpResult](https://docs.kinetica.com/content/api/rust/sql/type.SqlOpResult.md)\<&[Value](https://docs.rs/serde_json/1.0.149/serde_json/value/enum.Value.html)>

Get the raw JSON value for a column

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L745-L747)
pub fn [has\_column](#method.has_column)(\&self, column: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html)) -> [bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)

Check if a column exists in this row

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L750-L752)
pub fn [columns](#method.columns)(\&self) -> [Vec](https://doc.rust-lang.org/1.98.1/alloc/vec/struct.Vec.html)\<&[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html)>

Get all column names in this row

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L755-L759)
pub fn [is\_null](#method.is_null)(\&self, column: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html)) -> [SqlOpResult](https://docs.kinetica.com/content/api/rust/sql/type.SqlOpResult.md)\<[bool](https://doc.rust-lang.org/1.98.1/std/primitive.bool.html)>

Check if a column value is null

## Trait Implementations

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L662)
impl [Clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html) for [Row](https://docs.kinetica.com/content/api/rust/sql/struct.Row.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L662)
fn [clone](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)(\&self) -> [Row](https://docs.kinetica.com/content/api/rust/sql/struct.Row.md)

Returns a duplicate of the value. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#tymethod.clone)

1.0.0 (const: [unstable](https://github.com/rust-lang/rust/issues/142757)) · [Source](https://doc.rust-lang.org/1.98.1/src/core/clone.rs.html#245-247)
fn [clone\_from](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)(\&mut self, source: \&Self)

Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html#method.clone_from)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L662)
impl [Debug](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html) for [Row](https://docs.kinetica.com/content/api/rust/sql/struct.Row.md)

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/sql.rs#L662)
fn [fmt](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)(\&self, f: \&mut [Formatter](https://doc.rust-lang.org/1.98.1/core/fmt/struct.Formatter.html)\<'\_>) -> [Result](https://doc.rust-lang.org/1.98.1/core/fmt/type.Result.html)

Formats the value using the given formatter. [Read more](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html#tymethod.fmt)


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