mirror of https://github.com/AMT-Cheif/drift.git
Fix missing quotes in drift files docs
This commit is contained in:
parent
6efe6de3ba
commit
573bd20eb8
|
@ -77,7 +77,7 @@ At the moment, drift supports these options:
|
|||
* `new_sql_code_generation`: Generates SQL statements from the parsed AST instead of replacing substrings. This will also remove
|
||||
unnecessary whitespace and comments.
|
||||
If enabling this option breaks your queries, please file an issue!
|
||||
* `scoped_dart_components`: Generates a function parameter for [Dart placeholders]({{ '../Using SQL/moor_files.md#dart-components-in-sql' | pageUrl }}) in SQL.
|
||||
* `scoped_dart_components`: Generates a function parameter for [Dart placeholders]({{ '../Using SQL/drift_files.md#dart-components-in-sql' | pageUrl }}) in SQL.
|
||||
The function has a parameter for each table that is available in the query, making it easier to get aliases right when using
|
||||
Dart placeholders.
|
||||
* `null_aware_type_converters`: Consider the type of applied type converters to determine nullability of columns in Dart.
|
||||
|
|
|
@ -169,7 +169,7 @@ further guides to help you learn more:
|
|||
- [Schema migrations]({{ "../Advanced Features/migrations.md" | pageUrl }})
|
||||
- Writing [queries]({{ "writing_queries.md" | pageUrl }}) and
|
||||
[expressions]({{ "../Advanced Features/expressions.md" | pageUrl }}) in Dart
|
||||
- A more [in-depth guide]({{ "../Using SQL/moor_files.md" | pageUrl }})
|
||||
- A more [in-depth guide]({{ "../Using SQL/drift_files.md" | pageUrl }})
|
||||
on `drift` files, which explains `import` statements and the Dart-SQL interop.
|
||||
|
||||
{% block "blocks/alert" title="Using the database" %}
|
||||
|
|
|
@ -47,7 +47,7 @@ To use this feature, it's helpful to know how Dart tables are named in sql. For
|
|||
override `tableName`, the name in sql will be the `snake_case` of the class name. So a Dart table
|
||||
called `Categories` will be named `categories`, a table called `UserAddressInformation` would be
|
||||
called `user_address_information`. The same rule applies to column getters without an explicit name.
|
||||
Tables and columns declared in [Drift files]({{ "moor_files.md" | pageUrl }}) will always have the
|
||||
Tables and columns declared in [Drift files]({{ "drift_files.md" | pageUrl }}) will always have the
|
||||
name you specified.
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ data:
|
|||
|
||||
aliases:
|
||||
- /docs/using-sql/custom_tables/ # Redirect from outdated "custom tables" page which has been deleted
|
||||
- /docs/using-sql/moor_files/
|
||||
|
||||
template: layouts/docs/single
|
||||
---
|
||||
|
||||
|
@ -174,12 +176,12 @@ CREATE TABLE saved_routes (
|
|||
id INTEGER NOT NULL PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
"from" INTEGER NOT NULL REFERENCES coordinates (id),
|
||||
to INTEGER NOT NULL REFERENCES coordinates (id)
|
||||
"to" INTEGER NOT NULL REFERENCES coordinates (id)
|
||||
);
|
||||
|
||||
routesWithPoints: SELECT r.id, r.name, f.*, t.* FROM routes r
|
||||
INNER JOIN coordinates f ON f.id = r."from"
|
||||
INNER JOIN coordinates t ON t.id = r.to;
|
||||
INNER JOIN coordinates t ON t.id = r."to";
|
||||
```
|
||||
|
||||
To match the returned column names while avoiding name clashes in Dart, drift
|
||||
|
@ -191,7 +193,7 @@ again? Let's rewrite the query, this time using nested results:
|
|||
```sql
|
||||
routesWithNestedPoints: SELECT r.id, r.name, f.**, t.** FROM routes r
|
||||
INNER JOIN coordinates f ON f.id = r."from"
|
||||
INNER JOIN coordinates t ON t.id = r.to;
|
||||
INNER JOIN coordinates t ON t.id = r."to";
|
||||
```
|
||||
|
||||
As you can see, we can nest a result simply by using the drift-specific
|
|
@ -25,7 +25,7 @@ path: v2
|
|||
The rewritten compiler is faster than ever, supports more SQL features and gives you
|
||||
more flexibility when writing database code.
|
||||
|
||||
[Check the updated documentation]({{ "docs/Using SQL/moor_files.md" | pageUrl }})
|
||||
[Check the updated documentation]({{ "docs/Using SQL/drift_files.md" | pageUrl }})
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue