mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 14:04:21 +08:00
74 lines
945 B
Plaintext
74 lines
945 B
Plaintext
---
|
|
id: single
|
|
title: "single()"
|
|
slug: single
|
|
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabsPanel from '@theme/TabsPanel';
|
|
|
|
Retrieves only one row from the result. Result must be one row (e.g. using limit), otherwise this will result in an error.
|
|
|
|
|
|
<Tabs
|
|
defaultActiveId="dart"
|
|
groupId="reference/dart"
|
|
values={[{ label: 'Dart', value: 'dart' }]}>
|
|
|
|
<TabsPanel id="dart" label="dart">
|
|
|
|
```dart
|
|
final res = await supabase
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.single()
|
|
.execute();
|
|
```
|
|
|
|
|
|
</TabsPanel>
|
|
|
|
</Tabs>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
### With `select()`
|
|
|
|
|
|
|
|
<Tabs
|
|
defaultActiveId="dart"
|
|
groupId="reference/dart"
|
|
values={[{ label: 'Dart', value: 'dart' }]}>
|
|
|
|
<TabsPanel id="dart" label="dart">
|
|
|
|
```dart
|
|
final res = await supabase
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.single()
|
|
.execute();
|
|
```
|
|
|
|
|
|
</TabsPanel>
|
|
|
|
</Tabs> |