Skip to content

Commit

Permalink
docs: fix timestampz typo (#5047)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Dec 27, 2023
1 parent 3ceb83c commit b523ae4
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion docs/docs/cascading.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ In this example, no `Book` would be removed with simple `Cascade.REMOVE` as no r
As opposed to the application level cascading controlled by the `cascade` option, we can also define database level referential integrity actions: `on update` and `on delete`.

Their values are automatically inferred from the `cascade` option value. You can also control the value manually via `updateRule` and `deleteRule` options.
Their values are automatically inferred from the `cascade` option value. You can also control the value manually via `updateRule` and `deleteRule` options.

```ts
@Entity()
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/dataloaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ If you're using GraphQL you won't have to use `Promise.all`. Issuing a normal qu
}
```

Assuming you've enabled the dataloaders MikroORM will coalesce all individual loads which occur within a single frame of execution (a single tick of the event loop) and automatically batch them.
Assuming you've enabled the dataloaders MikroORM will coalesce all individual loads which occur within a single frame of execution (a single tick of the event loop) and automatically batch them.
2 changes: 1 addition & 1 deletion docs/docs/decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ title: Decorators
| `collection` | `string` | yes | Alias for `tableName`. |
| `comment` | `string` | yes | Specify comment to table. **(SQL only)** |
| `repository` | `() => EntityRepository` | yes | Set [custom repository class](repositories.md#custom-repository). |
| `discriminatorColumn` | `string` | yes | For [Single Table Inheritance](inheritance-mapping.md#single-table-inheritance). |
| `discriminatorColumn` | `string` | yes | For [Single Table Inheritance](inheritance-mapping.md#single-table-inheritance). |
| `discriminatorMap` | `Dictionary<string>` | yes | For [Single Table Inheritance](inheritance-mapping.md#single-table-inheritance). |
| `discriminatorValue` | `number` &#124; `string` | yes | For [Single Table Inheritance](inheritance-mapping.md#single-table-inheritance). |
| `forceConstructor` | `boolean` | yes | Enforce use of constructor when creating managed entity instances |
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/defining-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -1399,13 +1399,13 @@ export const User = new EntitySchema<IUser>({
id: { type: 'number', primary: true },
firstName: { type: 'string', length: 50 },
lastName: { type: 'string', length: 50 },
fullName: {
fullName: {
type: 'string',
length: 100,
length: 100,
generated: cols => `(concat(${cols.firstName}, ' ', ${cols.lastName})) stored`,
},
fullName2: {
type: 'string',
fullName2: {
type: 'string',
columnType: `varchar(100) generated always as (concat(first_name, ' ', last_name)) virtual`,
},
},
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { GeneratedCacheAdapter, MikroORM } from '@mikro-orm/core';
await MikroORM.init({
metadataCache: {
enabled: true,
adapter: GeneratedCacheAdapter,
adapter: GeneratedCacheAdapter,
options: { data: require('./temp/metadata.json') },
},
// ...
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/entity-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ $ ts-node generate-entities

## Advanced configuration

The behaviour of the entity generator can be adjusted either via `entityGenerator` section in the ORM config, or with the `GenerateOptions` object (parameter of the `generate` method), which takes precedence over the global configuration.
The behaviour of the entity generator can be adjusted either via `entityGenerator` section in the ORM config, or with the `GenerateOptions` object (parameter of the `generate` method), which takes precedence over the global configuration.

Available options:

| Option | Description |
|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `schema: string` | The target schema to generate entities for. Defaults to what the main config would use. |
| `skipTables: string[]` | Ignore some database tables. Accepts array of table names. If there is a foreign key reference to a skipped table, the generated code will be as if that foreign key did not exist. |
| `skipColumns` | Ignore some database tables columns. Accepts an object, where keys are table names with schema prefix if available, values are arrays of column names. If a skipped column is the target of a foreign key reference, the generated code will look as if that foreign key did not exist. |
| `skipColumns` | Ignore some database tables columns. Accepts an object, where keys are table names with schema prefix if available, values are arrays of column names. If a skipped column is the target of a foreign key reference, the generated code will look as if that foreign key did not exist. |
| `save: boolean` | Whether to save the generated entities as files. |
| `path: string` | Folder to save the generated entities in, if saving is enabled. Defaults to a folder called `generated-entities` inside the `baseDir` of the main config. |
| `fileName: (className: string) => string` | Callback to override the entity file name. Defaults to the entity name. |
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/entity-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ console.log(author.email); // undefined
This works also for nested relations:

```ts
const author = await em.findOne(Author, '...', {
const author = await em.findOne(Author, '...', {
fields: ['name', 'books.title', 'books.author', 'books.price'],
});
```
Expand All @@ -279,15 +279,15 @@ const author = await em.findOne(Author, '...', {
> The Same problem can occur in mongo with M:N collections—those are stored as array property on the owning entity, so you need to make sure to mark such properties too.
```ts
const author = await em.findOne(Author, '...', {
const author = await em.findOne(Author, '...', {
fields: ['name', 'books.title', 'books.author', 'books.price'],
});
```

Alternatively, you can use the `exclude` option, which will omit the provided properties and select everything else:

```ts
const author = await em.findOne(Author, '...', {
const author = await em.findOne(Author, '...', {
exclude: ['email', 'books.price'],
populate: ['books'], // unlike with `fields`, you need to explicitly populate the relation here
});
Expand Down Expand Up @@ -496,16 +496,16 @@ const [author1, author2, author3] = await em.upsertMany(Author, [{ ... }, { ...
This will generate query similar to the following:

```sql
insert into "author"
insert into "author"
("id", "current_age", "email", "foo")
values
(1, 41, 'a1', true),
(2, 42, 'a2', true),
(5, 43, 'a3', true)
on conflict ("email")
on conflict ("email")
do update set
"current_age" = excluded."current_age",
"foo" = excluded."foo"
"foo" = excluded."foo"
returning "_id", "current_age", "foo", "bar"
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guide/01-first-entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const config: Options = {
// check the documentation for their differences: https://mikro-orm.io/docs/metadata-providers
metadataProvider: TsMorphMetadataProvider,
// enable debug mode to log SQL queries and discovery information
debug: true,
debug: true,
};

export default config;
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guide/02-relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export class Article extends BaseEntity {
description: Opt<string>; // can be used via generics too

// ...

}
```

Expand Down Expand Up @@ -470,7 +470,7 @@ What about the password? Seeing the logger `Article` entity with populated `auth
For now, let's use `sha256` algorithm which we can create synchronously, and hash the value inside the constructor:

```ts title='user.entity.ts'
import crypto from 'crypto';
import crypto from 'crypto';

@Entity()
export class User extends BaseEntity<'bio'> {
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guide/03-project-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ import { initORM } from '../src/db.js';
export async function initTestApp(port: number) {
// this will create all the ORM services and cache them
const { orm } = await initORM({
// no need for debug information, it would only pollute the logs
// no need for debug information, it would only pollute the logs
debug: false,
// we will use in-memory database, this way we can easily parallelize our tests
dbName: ':memory:',
Expand Down Expand Up @@ -321,7 +321,7 @@ const orm = await MikroORM.init({
});
```

Since v6, you can also use the new `initSync()` method to instantiate the ORM synchronously. This will run the discovery only, and skip the database connection. When you first try to query the database (or work with it in any way that requires the connection), the ORM will connect to it lazily.
Since v6, you can also use the new `initSync()` method to instantiate the ORM synchronously. This will run the discovery only, and skip the database connection. When you first try to query the database (or work with it in any way that requires the connection), the ORM will connect to it lazily.

> The sync method never connects to the database, so `connect: false` is implicit.
Expand Down Expand Up @@ -464,7 +464,7 @@ Or via CLI:
```bash
npx mikro-orm-esm schema:create --dump # Dumps create schema SQL
npx mikro-orm-esm schema:update --dump # Dumps update schema SQL
npx mikro-orm-esm schema:drop --dump # Dumps drop schema SQL
npx mikro-orm-esm schema:drop --dump # Dumps drop schema SQL
```

Your production database (the one in `sqlite.db` file in the root of your project) is probably out of sync, as we were mostly using the in-memory database inside the tests. Let's try to sync it via the CLI. First, run it with the `--dump` (or `-d`) flag to see what queries it generates, then run them via `--run` (or `-r`):
Expand Down
Loading

0 comments on commit b523ae4

Please sign in to comment.