Add aliases from old documentation URLs

This commit is contained in:
Simon Binder 2023-09-24 15:39:38 +02:00
parent 8c42ce5049
commit b826391bcb
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
15 changed files with 41 additions and 48 deletions

View File

@ -45,9 +45,10 @@ class $TodoItemsTable extends i2.TodoItems
@override
List<i0.GeneratedColumn> get $columns => [id, title, content, category];
@override
String get aliasedName => _alias ?? 'todo_items';
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => 'todo_items';
String get actualTableName => $name;
static const String $name = 'todo_items';
@override
i0.VerificationContext validateIntegrity(i0.Insertable<i1.TodoItem> instance,
{bool isInserting = false}) {
@ -285,9 +286,10 @@ class $CategoriesTable extends i2.Categories
@override
List<i0.GeneratedColumn> get $columns => [id, name];
@override
String get aliasedName => _alias ?? 'categories';
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => 'categories';
String get actualTableName => $name;
static const String $name = 'categories';
@override
i0.VerificationContext validateIntegrity(i0.Insertable<i1.Category> instance,
{bool isInserting = false}) {

View File

@ -3,6 +3,9 @@ data:
title: Runtime schema inspection
description: Use generated table classes to reflectively inspect the schema of your database.
template: layouts/docs/single
aliases:
- docs/advanced-features/schema_inspection/
---
{% assign snippets = 'package:drift_docs/snippets/modular/schema_inspection.dart.excerpt.json' | readString | json_decode %}

View File

@ -4,6 +4,9 @@ data:
description: "Select rows or invidiual columns from tables in Dart"
weight: 2
template: layouts/docs/single
aliases:
- docs/getting-started/writing_queries/
---
{% assign tables = 'package:drift_docs/snippets/_shared/todo_tables.dart.excerpt.json' | readString | json_decode %}

View File

@ -4,9 +4,9 @@ data:
description: Options for `drift_dev` and `build_runner` to change the generated code.
weight: 7
template: layouts/docs/list
#path: docs/advanced-features/builder_options/
#aliases:
# - "options/"
path: docs/advanced-features/builder_options/
aliases:
- "options/"
---
The `drift_dev` package supports a range of options that control how code

View File

@ -6,6 +6,7 @@ data:
template: layouts/docs/list
aliases:
- /migrations
- /docs/advanced-features/migrations/
---
The strict schema of tables and columns is what enables type-safe queries to

View File

@ -4,6 +4,8 @@ data:
description: Use drift on encrypted databases
weight: 10
template: layouts/docs/single
aliases:
- docs/other-engines/encryption/
---
{% assign snippets = 'package:drift_docs/snippets/platforms/encryption.dart.excerpt.json' | readString | json_decode %}

View File

@ -4,6 +4,9 @@ data:
description: Run drift on both mobile and desktop
weight: 1
template: layouts/docs/single
aliases:
- docs/other-engines/vm/
---
## Supported platforms

View File

@ -5,6 +5,7 @@ data:
description: Write SQL for advanced queries that drift can't express in Dart yet.
aliases:
- /queries/custom
- /docs/using-sql/custom_queries/
template: layouts/docs/single
---

View File

@ -7,6 +7,7 @@ data:
aliases:
- /docs/using-sql/custom_tables/ # Redirect from outdated "custom tables" page which has been deleted
- /docs/using-sql/moor_files/
- /docs/using-sql/drift_files/
template: layouts/docs/single
---

View File

@ -4,6 +4,9 @@ data:
weight: 10
description: Information on json1 and fts5 support in drift files
template: layouts/docs/single
aliases:
- docs/using-sql/extensions/
---
When analyzing `.drift` files, the generator can consider sqlite3 extensions

View File

@ -5,6 +5,8 @@ data:
description: >-
Use your own classes as data classes for drift tables
template: layouts/docs/single
path: docs/advanced-features/custom_row_classes/
---
For each table declared in Dart or in a drift file, `drift_dev` generates a row class (sometimes also referred to as _data class_)

View File

@ -27,8 +27,6 @@ If you want to look at an example app for inspiration, a cross-platform Flutter
## The dependencies {#adding-dependencies}
First, lets add drift to your project's `pubspec.yaml`.
At the moment, the current version of `drift` is [![Drift version](https://img.shields.io/pub/v/drift.svg)](https://pub.dev/packages/drift)
and the latest version of `drift_dev` is [![Generator version](https://img.shields.io/pub/v/drift_dev.svg)](https://pub.dev/packages/drift_dev).
In addition to the core drift dependencies, we're also adding packages to find a suitable database
location on the device and to include a recent version of `sqlite3`, the database most commonly
used with drift.

View File

@ -5,7 +5,7 @@ data:
description: Store more complex data in columns with type converters
aliases:
- /type_converters
path: /docs/advanced_features/type_converters/
path: /docs/advanced-features/type_converters/
template: layouts/docs/single
---

View File

@ -1,38 +0,0 @@
{% block "blocks/markdown" %}
First, lets add drift to your project's `pubspec.yaml`.
At the moment, the current version of `drift` is [![Drift version](https://img.shields.io/pub/v/drift.svg)](https://pub.dev/packages/drift)
and the latest version of `drift_dev` is [![Generator version](https://img.shields.io/pub/v/drift_dev.svg)](https://pub.dev/packages/drift_dev).
{% assign versions = 'package:drift_docs/versions.json' | readString | json_decode %}
```yaml
dependencies:
drift: ^{{ versions.drift }}
sqlite3_flutter_libs: ^0.5.0
path_provider: ^2.0.0
path: ^{{ versions.path }}
dev_dependencies:
drift_dev: ^{{ versions.drift_dev }}
build_runner: ^{{ versions.build_runner }}
```
If you're wondering why so many packages are necessary, here's a quick overview over what each package does:
- `drift`: This is the core package defining the APIs you use to access drift databases.
- `sqlite3_flutter_libs`: Ships the latest `sqlite3` version with your Android or iOS app. This is not required when you're _not_ using Flutter,
but then you need to take care of including `sqlite3` yourself.
Note that the `sqlite3_flutter_libs` package will include the native sqlite3 library for the following
architectures: `armv8`, `armv7`, `x86` and `x86_64`.
Most Flutter apps don't run on 32-bit x86 devices without further setup, so you should
[add a snippet](https://github.com/simolus3/sqlite3.dart/tree/main/sqlite3_flutter_libs#included-platforms)
to your `build.gradle` if you don't need `x86` builds.
Otherwise, the Play Store might allow users on `x86` devices to install your app even though it is not
supported.
In Flutter's current native build system, drift unfortunately can't do that for you.
- `path_provider` and `path`: Used to find a suitable location to store the database. Maintained by the Flutter and Dart team.
- `drift_dev`: This development-only dependency generates query code based on your tables. It will not be included in your final app.
- `build_runner`: Common tool for code-generation, maintained by the Dart team.
{% endblock %}

View File

@ -21,6 +21,18 @@
status = 301
force = true
[[redirects]]
from = "/docs/getting-started/starting_with_sql/"
to = "/docs/sql-api/#setup"
status = 301
force = true
[[redirects]]
from = "/docs/advanced-features/joins/"
to = "/docs/dart-api/select/#joins"
status = 301
force = true
[[headers]]
for = "/*"
[headers.values]