# select

The select() method for the SurrealDB Swift SDK selects all records in a table, or a specific record.

Selects all records of a model's table, a filtered subset, or a single record by id.

```swift title="Method Syntax"
try await client.select(Model.self, where: predicate, limit: limit,
    start: start)
```

## Arguments

<table>
    <thead>
        <tr>
            <th colspan="2" scope="col">Arguments</th>
            <th colspan="2" scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td colspan="2" scope="row" data-label="Arguments">
                <code>model</code>
                <label label="required" />
            </td>
            <td colspan="2" scope="row" data-label="Description">
                The model type to select, e.g. <code>Person.self</code>.
            </td>
        </tr>
        <tr>
            <td colspan="2" scope="row" data-label="Arguments">
                <code>where</code>
                <label label="optional" />
            </td>
            <td colspan="2" scope="row" data-label="Description">
                A [predicate](/docs/reference/swift/concepts/predicates.md) restricting which records are returned.
            </td>
        </tr>
        <tr>
            <td colspan="2" scope="row" data-label="Arguments">
                <code>limit</code> / <code>start</code>
                <label label="optional" />
            </td>
            <td colspan="2" scope="row" data-label="Description">
                Paginate the results by limiting the count and offsetting the start.
            </td>
        </tr>
        <tr>
            <td colspan="2" scope="row" data-label="Arguments">
                <code>recordID</code>
                <label label="optional" />
            </td>
            <td colspan="2" scope="row" data-label="Description">
                Select a single record by its [`SurrealRecordID`](/docs/reference/swift/data-types.md#surrealrecordid) instead of a table.
            </td>
        </tr>
    </tbody>
</table>

## Example usage

```swift
// Select all records
let people = try await client.select(Person.self)

// Select a filtered, paginated subset
let adults = try await client.select(
    Person.self,
    where: Person.Fields.age >= 18,
    limit: 20,
    start: 0
)

// Select a single record by id
let id = SurrealRecordID(table: "person", id: .string("ada"))
let person: Person? = try await client.select(recordID: id,
    as: Person.self)
```
