i18n(fr): translate utils/kysely-and-sdk.mdx#182
Conversation
📝 WalkthroughWalkthroughAjout d'une nouvelle page de documentation en français présentant Kysely (bases, dialectes supportés), exemples d'utilisation et la description des packages StudioCMS Kysely client et SDK, avec extraits de code et références externes. No changes to code or public APIs. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-07-24T11:57:15.225ZApplied to files:
🪛 LanguageToolsrc/content/docs/fr/utils/kysely-and-sdk.mdx[style] ~19-~19: Cette structure peut être modifiée afin de devenir plus percutante. (DE_BASE3) [style] ~19-~19: Une phrase longue peut induire une perte de sens pour le lecteur. Celle-ci peut donc être divisée afin d’apporter de la clarté et du rythme. (POINT_MAIS) [style] ~41-~41: Cette structure peut être modifiée afin de devenir plus percutante. (DE_BASE3) [style] ~41-~41: Utilisé hors du contexte militaire, on préfèrera d’autres tournures à « baser sur ». (BASER_SUR) [style] ~45-~45: Cette structure peut être modifiée afin de devenir plus percutante. (DE_BASE3) [style] ~50-~50: Cette structure peut être modifiée afin de devenir plus percutante. (DE_BASE3) [style] ~55-~55: Cette structure peut être modifiée afin de devenir plus percutante. (DE_BASE3) [grammar] ~77-~77: Il y a peut-être une erreur ici (QB_NEW_FR) [typographical] ~131-~131: Caractère d’apostrophe incorrect. (APOS_INCORRECT) [grammar] ~184-~184: Essayez d’enlever « d’ » (QB_NEW_FR_OTHER_ERROR_IDS_UNNECESSARY_ADPOSITION_DAPOSTROPHE) [typographical] ~184-~184: Caractère d’apostrophe incorrect. (APOS_INCORRECT) [grammar] ~256-~256: Il y a peut-être une erreur ici (QB_NEW_FR) [grammar] ~313-~313: Il y a peut-être une erreur ici (QB_NEW_FR) [typographical] ~317-~317: Caractère d’apostrophe incorrect. (APOS_INCORRECT) [style] ~323-~323: Cette structure peut être modifiée afin de devenir plus percutante. (DE_BASE3) [style] ~328-~328: Un verbe peut dynamiser votre phrase. (PROP_NOMINALES_EN_VERBALES) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/content/docs/fr/utils/kysely-and-sdk.mdx (1)
101-101: Variable shadowing:getUsersfunction declared twice in same scope.Line 101 declares the effect generator as
getUsers, and line 104 redeclares a variable with the same name inside it. While this works, it shadows the outer binding. Consider renaming the inner variable to clarify intent (e.g.,getUsersFnorexecuteGetUsers).Also applies to: 104-104
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/fr/utils/kysely-and-sdk.mdx(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ArmandPhilippot
Repo: withstudiocms/docs PR: 149
File: src/content/docs/fr/guides/upgrade/version-guides/0-1-0-beta-21.mdx:13-15
Timestamp: 2025-07-24T11:57:15.225Z
Learning: In the withstudiocms/docs repository, when reviewing French translation files, maintain consistency with the English version even if it means keeping unused imports. Structural parity between language versions is prioritized over removing unused code.
Learnt from: ArmandPhilippot
Repo: withstudiocms/docs PR: 149
File: src/content/docs/fr/guides/upgrade/version-guides/0-1-0-beta-20.mdx:18-18
Timestamp: 2025-07-24T12:00:35.014Z
Learning: In the withstudiocms/docs repository, while translations should maintain structural parity with English versions, improving readability during translation is acceptable when the original text has clear redundancy or readability issues that would also impact the translation quality. The maintainer ArmandPhilippot confirmed this approach is reasonable when the technical meaning is preserved.
Learnt from: ArmandPhilippot
Repo: withstudiocms/docs PR: 130
File: src/content/docs/fr/guides/upgrade/version-guides/0-1-0-beta-17.mdx:1-11
Timestamp: 2025-04-26T12:29:17.995Z
Learning: When reviewing translations in the withstudiocms/docs repository, compare with the corresponding English version as the source of truth, not with other files in the same target language. French translations should maintain structural parity with their English counterparts.
🪛 LanguageTool
src/content/docs/fr/utils/kysely-and-sdk.mdx
[style] ~19-~19: Cette structure peut être modifiée afin de devenir plus percutante.
Context: ...oCMS et fournissent les fonctionnalités de base de données utilisées par StudioCMS. Ils...
(DE_BASE3)
[style] ~19-~19: Une phrase longue peut induire une perte de sens pour le lecteur. Celle-ci peut donc être divisée afin d’apporter de la clarté et du rythme.
Context: ... destinés à un usage interne à StudioCMS, mais les utilisateurs peuvent également les util...
(POINT_MAIS)
[style] ~41-~41: Cette structure peut être modifiée afin de devenir plus percutante.
Context: .../kysely/" released={true} /> Un client de base de données offrant la sûreté du typage ...
(DE_BASE3)
[style] ~41-~41: Utilisé hors du contexte militaire, on préfèrera d’autres tournures à « baser sur ».
Context: ...un système de migration pour StudioCMS, basé sur Kysely. Il fourn...
(BASER_SUR)
[style] ~45-~45: Cette structure peut être modifiée afin de devenir plus percutante.
Context: .... ### Caractéristiques - Opérations de base de données avec sûreté du typage - Pr...
(DE_BASE3)
[style] ~50-~50: Cette structure peut être modifiée afin de devenir plus percutante.
Context: ...as** - Inspecter et valider les schémas de base de données lors de l'exécution - **Inté...
(DE_BASE3)
[style] ~55-~55: Cette structure peut être modifiée afin de devenir plus percutante.
Context: ...### Exemple de code #### Configuration de base du client ```ts twoslash title="client...
(DE_BASE3)
[grammar] ~77-~77: Il y a peut-être une erreur ici
Context: ...## Exemple pour obtenir les utilisateurs ts twoslash title="get-users.ts" import { getDBClientLive, type StudioCMSDatabaseSchema } from '@withstudiocms/kysely'; import { libsqlDriver } from '@withstudiocms/kysely/drivers/libsql'; import { ConfigProvider, Effect } from 'studiocms/effect'; export const getDbClient = Effect.gen(function* () { // Configurez le pilote LibSQL avec une URL de base de données à partir de la configuration. const dialect = yield* libsqlDriver.pipe( Effect.withConfigProvider( ConfigProvider.fromJson({ CMS_LIBSQL_URL: 'file:./test.db', }) ) ); // Renvoyez le client DB de Kysely avec les utilitaires d'Effect return yield* getDBClientLive<StudioCMSDatabaseSchema>(dialect); }); // ---cut--- import { Schema } from 'studiocms/effect'; import { StudioCMSUsersTable } from '@withstudiocms/kysely'; export const getUsers = Effect.gen(function* () { const { withDecoder } = yield* getDbClient; const getUsers = withDecoder({ decoder: Schema.Array(StudioCMSUsersTable.Select), callbackFn: (db) => db((client) => client.selectFrom('StudioCMSUsersTable').selectAll().execute()), }); const users = yield* getUsers(); console.log('Users:', users); /* type of 'users' is: const users: readonly { readonly url: string | null | undefined; readonly id: string; readonly name: string; readonly email: string | null | undefined; readonly avatar: string | null | undefined; readonly username: string; readonly password: string | null | undefined; readonly updatedAt: Date; readonly createdAt: Date; readonly emailVerified: boolean; readonly notifications: string | null | undefined; }[] */ }); #### Exemple pour insérer un nouvel d'utilisa...
(QB_NEW_FR)
[grammar] ~131-~131: Essayez d’enlever « d’ »
Context: ...`` #### Exemple pour insérer un nouvel d'utilisateur (withEncoder) ```ts twoslash title="...
(QB_NEW_FR_OTHER_ERROR_IDS_UNNECESSARY_ADPOSITION_DAPOSTROPHE)
[typographical] ~131-~131: Caractère d’apostrophe incorrect.
Context: ...le pour insérer un nouvel d'utilisateur (withEncoder) ```ts twoslash title="ins...
(APOS_INCORRECT)
[grammar] ~184-~184: Essayez d’enlever « d’ »
Context: ...`` #### Exemple pour insérer un nouvel d'utilisateur (withCodec) ```ts twoslash title="in...
(QB_NEW_FR_OTHER_ERROR_IDS_UNNECESSARY_ADPOSITION_DAPOSTROPHE)
[typographical] ~184-~184: Caractère d’apostrophe incorrect.
Context: ...le pour insérer un nouvel d'utilisateur (withCodec) ```ts twoslash title="inser...
(APOS_INCORRECT)
[grammar] ~256-~256: Il y a peut-être une erreur ici
Context: ...récupération d'un utilisateur par son ID ts twoslash title="get-user.ts" import { getDBClientLive, type StudioCMSDatabaseSchema } from '@withstudiocms/kysely'; import { libsqlDriver } from '@withstudiocms/kysely/drivers/libsql'; import { ConfigProvider, Effect } from 'studiocms/effect'; export const getDbClient = Effect.gen(function* () { // Configurez le pilote LibSQL avec une URL de base de données à partir de la configuration. const dialect = yield* libsqlDriver.pipe( Effect.withConfigProvider( ConfigProvider.fromJson({ CMS_LIBSQL_URL: 'file:./test.db', }) ) ); // Renvoyez le client DB de Kysely avec les utilitaires d'Effect return yield* getDBClientLive<StudioCMSDatabaseSchema>(dialect); }); // ---cut--- import { Schema } from 'studiocms/effect'; import { StudioCMSUsersTable } from '@withstudiocms/kysely'; export const insertUser = Effect.gen(function* () { const { withCodec } = yield* getDbClient; const getUserById = withCodec({ encoder: Schema.String, decoder: Schema.UndefinedOr(StudioCMSUsersTable.Select), callbackFn: (db, id) => db((client) => client.selectFrom('StudioCMSUsersTable').selectAll().where('id', '=', id).executeTakeFirst() ), }); const user = yield* getUserById('un-identifiant-utilisateur'); console.log('Utilisateur par identifiant :', user); /* le type de 'user' est : const user: { readonly url: string | null | undefined; readonly id: string; readonly name: string; readonly email: string | null | undefined; readonly avatar: string | null | undefined; readonly username: string; readonly password: string | null | undefined; readonly updatedAt: Date; readonly createdAt: Date; readonly emailVerified: boolean; readonly notifications: string | null | undefined; } | undefined */ }); ## Le paquet SDK <Integration title="@with...
(QB_NEW_FR)
[grammar] ~313-~313: Il y a peut-être une erreur ici
Context: ...ned; } | undefined */ }); ``` ## Le paquet SDK Un kit de développement logiciel complet...
(QB_NEW_FR)
[typographical] ~317-~317: Caractère d’apostrophe incorrect.
Context: ...fonctionnelle, ainsi qu'avec Kysely DB ([@withstudiocms/kysely](#le-paquet-clien...
(APOS_INCORRECT)
[style] ~323-~323: Cette structure peut être modifiée afin de devenir plus percutante.
Context: ...u typage avec validation - Opérations de base de données - Opérations CRUD avec ges...
(DE_BASE3)
[style] ~328-~328: Un verbe peut dynamiser votre phrase.
Context: ...istants d'API REST** - Utilitaires pour la création de points de terminaison REST - **Paramètr...
(PROP_NOMINALES_EN_VERBALES)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build-and-push
- GitHub Check: Run Starlight Link Check
Description
Translates in French
utils/kysely-and-sdk.mdxadded in #177Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.