Skip to content

Commit

Permalink
Merge pull request isar-community#26 from isar-community/autoversioning
Browse files Browse the repository at this point in the history
Adapt quickstart guide for all languages
  • Loading branch information
mrclauss authored Mar 9, 2024
2 parents 9f7eced + f850982 commit d1bc6be
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 92 deletions.
14 changes: 11 additions & 3 deletions docs/docs/de/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Dieser Schnellstart wird wenig um den heißen Brei herumreden und direkt mit dem
Bevor es losgeht, müssen wir ein paar Pakete zur `pubspec.yaml` hinzufügen. Damit es schneller geht lassen wir pub das für uns erledigen.

```bash
dart pub add isar:^4.0.0-dev.15 isar_flutter_libs:^4.0.0-dev.15 --hosted-url=https://isar-community.dev
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. Klassen annotieren
Expand All @@ -35,7 +35,15 @@ class User {

IDs identifizieren Objekte in einer Collection eindeutig und erlauben es dir, sie später wiederzufinden.

## 3. Isar-Instanz öffnen
## 3. Code-Generator ausführen

Führe den folgenden Befehl aus, um den `build_runner` zu starten:

```
dart run build_runner build
```

## 4. Isar-Instanz öffnen

Öffne eine neue Isar-Instanz und übergebe alle Collection-Schemata. Optional kannst du einen Instanznamen und ein Verzeichnis angeben.

Expand All @@ -47,7 +55,7 @@ final isar = await Isar.open(
);
```

## 4. Schreiben und lesen
## 5. Schreiben und lesen

Wenn deine Instanz geöffnet ist, hast du Zugriff auf die Collections.

Expand Down
14 changes: 4 additions & 10 deletions docs/docs/es/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Vamos a ser cortos en palabras para ir inmediatamente al código en esta guía d
Antes de empezar la parte divertida, necesitamos agregar algunos paquetes al `pubspec.yaml`. Podemos usar pub para hacer el trabajo pesado por nosotros.

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. Anota las clases
Expand Down Expand Up @@ -44,12 +43,6 @@ Ejecuta el siguiente comando para iniciar el `build_runner`:
dart run build_runner build
```

Si estás usando Flutter, puedes usar el siguiente:

```
flutter pub run build_runner build
```

## 4. Abre una instancia Isar

Abre una nueva instalcia Isar y pásale todos los esquemas de tu colección. Opcionalmente puedes especificar un nombre para la instancia y un directorio.
Expand All @@ -71,13 +64,14 @@ Todas las operaciones CRUD básicas están disponibles a través del `IsarCollec
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser); // insert & update
});
final existingUser = await isar.users.get(newUser.id); // get
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!); // delete
});
```
Expand Down
14 changes: 4 additions & 10 deletions docs/docs/fr/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Nous allons être brefs en mots et rapides en code dans ce démarrage rapide.
Avant de débuter, nous devons ajouter quelques dépendances au fichier `pubspec.yaml`. Nous pouvons utiliser la commande `pub` pour faire le gros du travail à notre place.

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. Annotation de classes
Expand Down Expand Up @@ -44,12 +43,6 @@ Exécutez la commande suivante pour démarrer le `build_runner`:
dart run build_runner build
```

Si vous utilisez Flutter:

```sh
flutter pub run build_runner build
```

## 4. Ouverture l'instance Isar

Ouvrez une nouvelle instance d'Isar et passez tous vos schémas de collection. En option, vous pouvez spécifier un nom d'instance et un dossier.
Expand All @@ -71,13 +64,14 @@ Toutes les opérations CRUD de base sont disponibles via `IsarCollection`.
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser); // Insertion & modification
});
final existingUser = await isar.users.get(newUser.id); // Obtention
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!); // Suppression
});
```
Expand Down
14 changes: 4 additions & 10 deletions docs/docs/it/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ In questa guida introduttiva saremo a corto di parole e veloci nel codice.
Prima che inizii il divertimento, dobbiamo aggiungere alcuni pacchetti a `pubspec.yaml`. Possiamo usare il pub per facilitarci il lavoro pesante.

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. Annota le classi
Expand Down Expand Up @@ -44,12 +43,6 @@ Esegui il seguente comando per avviare `build_runner`:
dart run build_runner build
```

Se stai usando Flutter, usa quanto segue:

```
flutter pub run build_runner build
```

## 4. Apri l'istanza Isar

Apri una nuova istanza Isar e passa tutti i tuoi schemi di raccolte. Facoltativamente, puoi specificare un nome di istanza e una directory.
Expand All @@ -71,13 +64,14 @@ Tutte le operazioni CRUD di base sono disponibili tramite "IsarCollection".
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser); // insert & update
});
final existingUser = await isar.users.get(newUser.id); // get
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!); // delete
});
```
Expand Down
14 changes: 4 additions & 10 deletions docs/docs/ja/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ title: クイックスタート
Isarを使用する前に、いくつかのパッケージを `pubspec.yaml` に追加する必要があります。pubを使用する事で、面倒な作業を簡単に済ませることが出来ます。

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. クラスの注釈(アノテーション)
Expand Down Expand Up @@ -45,12 +44,6 @@ idはコレクション内のオブジェクトを一意に識別して、後で
dart run build_runner build
```

Flutterを使用している場合は、代わりに次のコマンドを使用してください:

```
flutter pub run build_runner build
```

## 4. Isarインスタンスを開く

新規のIsarインスタンスを開き、コレクションのスキーマを渡します。必要に応じて、インスタンス名とディレクトリを指定することができます。
Expand All @@ -72,13 +65,14 @@ Isarインスタンスを開いたら, コレクションを利用すること
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser); // 挿入と更新
});
final existingUser = await isar.users.get(newUser.id); // 取得
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!); // 削除
});
```
Expand Down
14 changes: 4 additions & 10 deletions docs/docs/ko/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ title: 빠른 시작
재미있는 부분을 보기 전에 `pubspec.yaml` 에 몇 개의 패키지를 추가해야 합니다. 우리는 펍을 이용해서 힘든 일을 쉽게 할 수 있습니다.

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. 클래스에 주석 추가(어노테이션)
Expand Down Expand Up @@ -44,12 +43,6 @@ Id는 컬렉션에서 개체를 고유하게 식별하고 나중에 개체를
dart run build_runner build
```

플러터를 사용하고 있다면, 다음 명령을 사용합니다.

```
flutter pub run build_runner build
```

## 4. Isar 인스턴스 열기

새 Isar 인스턴스를 열고 모든 컬렉션 스키마를 전달합니다. 선택적으로 인스턴스 이름과 디렉토리를 지정할 수도 있습니다.
Expand All @@ -71,13 +64,14 @@ final isar = await Isar.open(
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser); // 삽입 & 업데이트
});
final existingUser = await isar.users.get(newUser.id); // 가져오기
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!); // 삭제
});
```
Expand Down
14 changes: 4 additions & 10 deletions docs/docs/pt/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Seremos curtos em palavras e rápidos em código neste início rápido.
Antes que a diversão comece, precisamos adicionar alguns pacotes ao `pubspec.yaml`. Podemos usar o pub para fazer o trabalho complexo para nós.

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. Anotar classes
Expand Down Expand Up @@ -44,12 +43,6 @@ Execute o seguinte comando para iniciar o `build_runner`:
dart run build_runner build
```

Se você estiver usando o Flutter, use o seguinte:

```
flutter pub run build_runner build
```

## 4. Abrir instância Isar

Abra uma nova instância Isar e passe todos os seus esquemas de coleção. Opcionalmente, você pode especificar um nome de instância e um diretório.
Expand All @@ -71,13 +64,14 @@ Todas as operações básicas de CRUD estão disponíveis via `IsarCollection`.
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser); // inserir & atualizar
});
final existingUser = await isar.users.get(newUser.id); // get
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!); // delete
});
```
Expand Down
14 changes: 11 additions & 3 deletions docs/docs/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We're going to be short on words and quick on code in this quickstart.
Before the fun begins, we need to add a few packages to the `pubspec.yaml`. We can use pub to do the heavy lifting for us.

```bash
dart pub add isar:^4.0.0-dev.15 isar_flutter_libs:^4.0.0-dev.15 --hosted-url=https://isar-community.dev
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. Annotate classes
Expand All @@ -37,7 +37,15 @@ class User {

Ids uniquely identify objects in a collection and allow you to find them again later.

## 3. Open Isar instance
## 3. Run code generator

Execute the following command to start the `build_runner`:

```
dart run build_runner build
```

## 4. Open Isar instance

Open a new Isar instance and pass all of your collection schemas. Optionally you can specify an instance name and directory.

Expand All @@ -49,7 +57,7 @@ final isar = await Isar.open(
);
```

## 4. Write and read
## 5. Write and read

Once your instance is open, you can start using the collections.

Expand Down
14 changes: 4 additions & 10 deletions docs/docs/ur/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ title: فورا شروع کریں
تفریح کا آغاز کرنےسے پہلےہمیں "پب سپیک۔یمل" میں چند پیکجز شامل کرنے کی ضرورت ہے۔ہم اپنے لیے بھاری سامان اٹھانے کے لیے پب کا استعمال کر سکتے ہیں۔

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. کلاسوں کی تشریح کریں۔
Expand Down Expand Up @@ -41,12 +40,6 @@ class User {
dart run build_runner build
```

اگر آپ فلٹر استعمال کر رہے ہیں تو درج ذیل استعمال کریں؛

```
flutter pub run build_runner build
```

## 4. ای زار مثال کھولیں۔

ایک نیا ای زار مثال کھولیں اور اپنے تمام کلیکشن اسکیموں کو پاس کریں۔ اختیاری طور پر آپ مثال کا نام اور ڈائریکٹری بتا سکتے ہیں۔
Expand All @@ -69,14 +62,15 @@ final isar = await Isar.open(
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser);
داخل کریں اور تروتازہ کریں۔//
});
final existingUser = await isar.users.get(newUser.id);
حاصل کریں۔//
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!);
حذف کریں//
});
Expand Down
14 changes: 4 additions & 10 deletions docs/docs/zh/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ title: 快速开始
在开始之前,我们需要在 `pubspec.yaml` 文件中添加若干依赖,可以运行以下命令帮助我们完成:

```bash
flutter pub add isar isar_flutter_libs
flutter pub add -d isar_generator build_runner
dart pub add isar:^0.0.0-placeholder isar_flutter_libs:^0.0.0-placeholder --hosted-url=https://isar-community.dev
```

## 2. 给类添加注解
Expand Down Expand Up @@ -44,12 +43,6 @@ Id 唯一指向了 Collection 中的对象,之后我们可通过 Id 来查询
dart run build_runner build
```

倘若你的项目用到了 Flutter,可用下方命令来代替:

```
flutter pub run build_runner build
```

## 4. 创建一个 Isar 实例

创建一个新的 Isar 实例,并将你想保存到 Isar 的所有 collection 的 schema(它在上一步由 Isar Generator 根据你定义的 collection 自动生成) 作为参数传入。你还可以指定实例的名称以及它所存储数据的文件路径。
Expand All @@ -71,13 +64,14 @@ final isar = await Isar.open(
```dart
final newUser = User()..name = 'Jane Doe'..age = 36;
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
newUser.id = isar.users.autoIncrement();
await isar.users.put(newUser); // 将新用户数据写入到 Isar
});
final existingUser = await isar.users.get(newUser.id); // 通过 Id 读取用户数据
await isar.writeTxn(() async {
await isar.writeAsync((isar) async {
await isar.users.delete(existingUser.id!); // 通过 Id 删除指定用户
});
```
Expand Down
4 changes: 4 additions & 0 deletions packages/isar/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 4.0.1

Adapted quickstart guide to get started with version 4

## 4.0.0-dev.15

Switch deployment to isar-community
Expand Down
Loading

0 comments on commit d1bc6be

Please sign in to comment.