From c101cfa20553660343725b945445dedc568124ea Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Sat, 18 Jan 2025 09:43:29 +0200 Subject: [PATCH] doc/faq: revert 5c91f7 (#4305) It is also already described in the annotations docs --- doc/md/faq.md | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/doc/md/faq.md b/doc/md/faq.md index 2872708b5..051a1054f 100644 --- a/doc/md/faq.md +++ b/doc/md/faq.md @@ -22,7 +22,6 @@ sidebar_label: FAQ [How to add `CHECK` constraints to table?](#how-to-add-check-constraints-to-table) [How to define a custom precision numeric field?](#how-to-define-a-custom-precision-numeric-field) [How to configure two or more `DB` to separate read and write?](#how-to-configure-two-or-more-db-to-separate-read-and-write) -[How to change the character set and/or collation of a MySQL table?](#how-to-change-the-character-set-andor-collation-of-a-mysql-table) [How to configure `json.Marshal` to inline the `edges` keys in the top level object?](#how-to-configure-jsonmarshal-to-inline-the-edges-keys-in-the-top-level-object) ## Answers @@ -769,25 +768,6 @@ func (d *multiDriver) Dialect() string { } ``` -#### How to change the character set and/or collation of a MySQL table? - -By default for MySQL the character set `utf8mb4` is used and the collation of `utf8mb4_bin`. -However if you'd like to change the schema's character set and/or collation you need to use an annotation. - -Here's an example where we set the character set to `ascii` and the collation to `ascii_general_ci`. - -```go -// Annotations of the Entity. -func (Entity) Annotations() []schema.Annotation { - return []schema.Annotation{ - entsql.Annotation{ - Charset: "ascii", - Collation: "ascii_general_ci", - }, - } -} -``` - #### How to configure `json.Marshal` to inline the `edges` keys in the top level object? To encode entities without the `edges` attribute, users can follow these two steps: