# SDK methods

The Swift SDK for SurrealDB enables simple and advanced querying of a remote database.

The Swift SDK exposes its functionality through the `SurrealHTTPClient` and `SurrealWebSocketClient` types, which share the same API. This page lists the methods available on a connected client.

## Initialisation methods

<table>
    <thead>
        <tr>
            <th scope="col">Method</th>
            <th scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/connect.md"> <code>client.connect()</code></a></td>
            <td scope="row" data-label="Description">Connects the client to the underlying endpoint</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/use.md"> <code>client.use(namespace, database)</code></a></td>
            <td scope="row" data-label="Description">Switch to a specific namespace and database</td>
        </tr>
    </tbody>
</table>

## Authentication methods

<table>
    <thead>
        <tr>
            <th scope="col">Method</th>
            <th scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/signup.md"> <code>client.signup(credentials)</code></a></td>
            <td scope="row" data-label="Description">Signs this connection up to a specific authentication access</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/signin.md"> <code>client.signin(credentials)</code></a></td>
            <td scope="row" data-label="Description">Signs this connection in to a specific authentication level</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/authenticate.md"> <code>client.authenticate(token)</code></a></td>
            <td scope="row" data-label="Description">Authenticates the current connection with a JWT token</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/invalidate.md"> <code>client.invalidate()</code></a></td>
            <td scope="row" data-label="Description">Invalidates the authentication for the current connection</td>
        </tr>
    </tbody>
</table>

## Query methods

<table>
    <thead>
        <tr>
            <th scope="col">Method</th>
            <th scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/select.md"> <code>client.select(model)</code></a></td>
            <td scope="row" data-label="Description">Selects all records in a table, or a specific record</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/query.md"> <code>client.query(query)</code></a></td>
            <td scope="row" data-label="Description">Runs a query built with the query DSL or macros</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/query-raw.md"> <code>client.queryRaw(sql, bindings)</code></a></td>
            <td scope="row" data-label="Description">Runs a raw SurrealQL query with bound parameters</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/live.md"> <code>client.live(query)</code></a></td>
            <td scope="row" data-label="Description">Subscribes to changes via a live query (WebSocket only)</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/kill.md"> <code>client.kill(liveQueryID)</code></a></td>
            <td scope="row" data-label="Description">Kills a running live query</td>
        </tr>
    </tbody>
</table>

## Mutation methods

<table>
    <thead>
        <tr>
            <th scope="col">Method</th>
            <th scope="col">Description</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/create.md"> <code>client.create(model)</code></a></td>
            <td scope="row" data-label="Description">Creates a record in the database</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/update.md"> <code>client.update(model)</code></a></td>
            <td scope="row" data-label="Description">Updates matching records, or a specific record</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/upsert.md"> <code>client.upsert(model)</code></a></td>
            <td scope="row" data-label="Description">Creates or updates matching records</td>
        </tr>
        <tr>
            <td scope="row" data-label="Method"><a href="/docs/reference/swift/methods/delete.md"> <code>client.delete(model)</code></a></td>
            <td scope="row" data-label="Description">Deletes matching records, or a specific record</td>
        </tr>
    </tbody>
</table>
